Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-09-01 16:19:32 +08:00
commit 8bdd90c055

View File

@ -48,6 +48,7 @@ type ModuleQuery struct {
}
func (mquery *ModuleQuery) EncodeQuery(field string) string {
var qstr []byte = []byte("JSON_OBJECT(")
for query := range mquery.ModuleQuery {
@ -98,12 +99,16 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r
moduleName := mlist[1]
cond = fmt.Sprintf("module = '%s' and %s", moduleName, cond)
if len(mlist) == 2 {
mlist = append(mlist, "")
}
if mquery, ok := mquerys[mtable]; ok {
mquery.ModuleQuery[strings.Join(mlist[2:], ",")] = struct{}{}
} else {
mquery := &ModuleQuery{
TableName: tname,
ModuleName: mtable,
ModuleName: mtable + "." + moduleName,
ModuleQuery: map[string]struct{}{strings.Join(mlist[2:], ","): {}}}
mquerys[mtable] = mquery
}
@ -139,7 +144,7 @@ func (l *InfoLogic) Info(req *types.UserInfoRequest, userinfo *auth.UserInfo) (r
var querydata map[string]any = make(map[string]any)
err = json.Unmarshal([]byte(info["querydata"].(string)), &querydata)
if err != nil {
logx.Error(err)
logx.Error(err, info)
return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error())
}