76 lines
2.0 KiB
Go
76 lines
2.0 KiB
Go
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 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, comm.Reddot30:
|
|
for k, v := range this.module.mail.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
case comm.Reddot31:
|
|
for k, v := range this.module.viking.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
|
|
case comm.Reddot32:
|
|
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
|
|
}
|