go_dreamfactory/modules/reddot/api_getall.go
2022-11-21 11:42:50 +08:00

43 lines
1.2 KiB
Go

package reddot
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
//参数校验
func (this *apiComp) GetAllCheck(session comm.IUserSession, req *pb.ReddotGetAllReq) (code pb.ErrorCode) {
return
}
///获取系统公告
func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) (code pb.ErrorCode, data proto.Message) {
var (
reddot map[int32]bool = make(map[int32]bool)
)
if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success {
return
}
for k, v := range this.module.ModuleTask.Reddot(session, comm.Reddot1, comm.Reddot2, comm.Reddot3, comm.Reddot4) {
reddot[int32(k)] = v
}
for k, v := range this.module.mainline.Reddot(session, comm.Reddot5) {
reddot[int32(k)] = v
}
for k, v := range this.module.pagoda.Reddot(session, comm.Reddot6) {
reddot[int32(k)] = v
}
for k, v := range this.module.horoscope.Reddot(session, comm.Reddot17) {
reddot[int32(k)] = v
}
for k, v := range this.module.martialhall.Reddot(session, comm.Reddot23, comm.Reddot24, comm.Reddot25) {
reddot[int32(k)] = v
}
session.SendMsg(string(this.module.GetType()), "getall", &pb.ReddotGetAllResp{Reddot: reddot})
return
}