优化
This commit is contained in:
parent
3ec456db01
commit
69fbe8d12c
@ -15,19 +15,24 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
|||||||
|
|
||||||
rsp := &pb.SysFuncGetListResp{}
|
rsp := &pb.SysFuncGetListResp{}
|
||||||
rsp.Cond = make(map[string]int32, 0)
|
rsp.Cond = make(map[string]int32, 0)
|
||||||
|
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
|
||||||
if len(req.Keys) == 0 {
|
if len(req.Keys) == 0 {
|
||||||
confList := this.module.configure.getOpencondList()
|
confList := this.module.configure.getOpencondList()
|
||||||
for _, v := range confList {
|
for _, v := range confList {
|
||||||
if v.ActivateType == 0 {
|
|
||||||
id := this.module.modelSys.validCond(session.GetUserId(), v)
|
id := this.module.modelSys.validCond(session.GetUserId(), v)
|
||||||
if id != "" {
|
if id != "" {
|
||||||
|
if v.ActivateType == 1 {
|
||||||
|
if _, ok := list.Cond[id]; ok {
|
||||||
|
rsp.Cond[id] = 1
|
||||||
|
} else {
|
||||||
|
rsp.Cond[id] = 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
rsp.Cond[id] = 1
|
rsp.Cond[id] = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
rsp.Cond[v.Id] = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for _, key := range req.Keys {
|
for _, key := range req.Keys {
|
||||||
@ -36,22 +41,22 @@ func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetLi
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if conf, ok := opencfg.GetDataMap()[key]; ok {
|
if conf, ok := opencfg.GetDataMap()[key]; ok {
|
||||||
if conf.ActivateType == 0 {
|
|
||||||
id := this.module.modelSys.validCond(session.GetUserId(), conf)
|
id := this.module.modelSys.validCond(session.GetUserId(), conf)
|
||||||
if id != "" {
|
if id != "" {
|
||||||
|
if conf.ActivateType == 1 {
|
||||||
|
if _, ok := list.Cond[id]; ok {
|
||||||
rsp.Cond[id] = 1
|
rsp.Cond[id] = 1
|
||||||
|
} else {
|
||||||
|
rsp.Cond[id] = 0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
rsp.Cond[conf.Id] = 0
|
rsp.Cond[id] = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId())
|
|
||||||
for k, v := range list.Cond {
|
|
||||||
rsp.Cond[k] = v
|
|
||||||
}
|
|
||||||
if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil {
|
if err := session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp); err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user