package reddot import ( "go_dreamfactory/comm" "go_dreamfactory/pb" ) //参数校验 func (this *apiComp) GetCheck(session comm.IUserSession, req *pb.ReddotGetReq) (errdata *pb.ErrorData) { return } ///获取系统公告 func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (errdata *pb.ErrorData) { var ( reddot map[int32]bool = make(map[int32]bool) ) if errdata = this.GetCheck(session, req); errdata != nil { return } for _, rid := range req.Rids { _rid := comm.ReddotType(rid) switch _rid { //任务 case comm.Reddot10101, comm.Reddot10102, comm.Reddot10103, comm.Reddot10201, comm.Reddot10301: for k, v := range this.module.ModuleTask.Reddot(session, _rid) { reddot[int32(k)] = v } //主线 case comm.Reddot11100: for k, v := range this.module.mail.Reddot(session, _rid) { reddot[int32(k)] = v } //铁匠铺 case comm.Reddot17102, comm.Reddot17106, comm.Reddot17107: for k, v := range this.module.smithy.Reddot(session, _rid) { reddot[int32(k)] = v } //工会 case comm.Reddot15102, comm.Reddot15201: for k, v := range this.module.ModuleSociaty.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.Reddot20, comm.Reddot21, comm.Reddot22: for k, v := range this.module.gourmet.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot12101, comm.Reddot12102: for k, v := range this.module.mail.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot13102: for k, v := range this.module.viking.Reddot(session, _rid) { reddot[int32(k)] = v } case comm.Reddot14102: for k, v := range this.module.hunting.Reddot(session, _rid) { reddot[int32(k)] = v } } } session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot}) return }