package reddot import ( "go_dreamfactory/comm" "go_dreamfactory/pb" "google.golang.org/protobuf/proto" ) //参数校验 func (this *apiComp) GetCheck(session comm.IUserSession, req *pb.ReddotGetReq) (code pb.ErrorCode) { return } ///获取系统公告 func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (code pb.ErrorCode, data proto.Message) { var ( reddot map[int32]bool = make(map[int32]bool) ) if code = this.GetCheck(session, req); code != pb.ErrorCode_Success { return } for _, rid := range req.Rids { // reddot[v] = false _rid := comm.ReddotType(rid) switch _rid { case comm.Reddot1: for k, v := range this.module.ModuleTask.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot2: for k, v := range this.module.ModuleTask.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot3: for k, v := range this.module.ModuleSociaty.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot4: for k, v := range this.module.ModuleTask.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot17: for k, v := range this.module.horoscope.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot19: for k, v := range this.module.arena.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot23, comm.Reddot24, comm.Reddot25: for k, v := range this.module.martialhall.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot20, comm.Reddot21, comm.Reddot22: for k, v := range this.module.gourmet.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot26: for k, v := range this.module.gourmet.Reddot(session, _rid) { reddot[int32(k)] = v } } } session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot}) return }