package sys import ( "go_dreamfactory/comm" "go_dreamfactory/pb" ) func (this *apiComp) FuncGetListCheck(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { return } func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { rsp := &pb.SysFuncGetListResp{} rsp.Cond = make(map[string]int32, 0) list, _ := this.module.modelSys.GetOpenCondList(session.GetUserId()) if len(req.Keys) == 0 { confList := this.module.configure.getOpencondList() for _, v := range confList { id := this.module.modelSys.validCond(session.GetUserId(), v) 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 } } } } else { for _, key := range req.Keys { opencfg, err := this.module.configure.getOpencondCfg() if err != nil { continue } if conf, ok := opencfg.GetDataMap()[key]; ok { id := this.module.modelSys.validCond(session.GetUserId(), conf) if id != "" { if conf.ActivateType == 1 { if _, ok := list.Cond[id]; ok { rsp.Cond[id] = 1 } else { rsp.Cond[id] = 0 } } else { rsp.Cond[id] = 1 } } } } } session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp) return }