104 lines
2.9 KiB
Go
104 lines
2.9 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]*pb.ReddotItem = make(map[int32]*pb.ReddotItem)
|
|
)
|
|
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.Reddot24101:
|
|
for k, v := range this.module.mainline.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, comm.Reddot15401:
|
|
for k, v := range this.module.ModuleSociaty.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
//竞技场
|
|
case comm.Reddot22102:
|
|
for k, v := range this.module.arena.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
//好友
|
|
case comm.Reddot21101:
|
|
for k, v := range this.module.friend.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
//羁绊
|
|
case comm.Reddot19103, comm.Reddot19105, comm.Reddot19109, comm.Reddot19110:
|
|
for k, v := range this.module.library.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
//每日任务
|
|
case comm.Reddot25101:
|
|
for k, v := range this.module.library.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
//工会boos战
|
|
case comm.Reddot15301:
|
|
for k, v := range this.module.guildgve.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.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
|
|
}
|
|
case comm.Reddot23101:
|
|
for k, v := range this.module.gourmet.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
case comm.Reddot27101, comm.Reddot30100:
|
|
for k, v := range this.module.ModuleUser.Reddot(session, _rid) {
|
|
reddot[int32(k)] = v
|
|
}
|
|
}
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot})
|
|
return
|
|
}
|