上传红点模块

This commit is contained in:
liwei1dao 2022-11-10 16:33:54 +08:00
parent 18034c71dc
commit 044486720e
4 changed files with 20 additions and 7 deletions

View File

@ -51,6 +51,8 @@ func (this *Martialhall) OnInstallComp() {
} }
//红点查询 //红点查询
func (this *Martialhall) Reddot(rid comm.ReddotType, uid string) bool { func (this *Martialhall) Reddot(uid string, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) {
return this.modelMartialhall.checkReddot(uid) reddot = make(map[comm.ReddotType]bool)
return
} }

View File

@ -21,9 +21,12 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (code
if code = this.GetCheck(session, req); code != pb.ErrorCode_Success { if code = this.GetCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) { for _, v := range req.Rids {
reddot[int32(k)] = v reddot[v] = false
} }
// for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) {
// reddot[int32(k)] = v
// }
session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot}) session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot})
return return
} }

View File

@ -21,9 +21,15 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq)
if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success { if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) { reddot[int32(comm.Reddot1)] = true
reddot[int32(k)] = v reddot[int32(comm.Reddot2)] = true
} reddot[int32(comm.Reddot3)] = false
reddot[int32(comm.Reddot4)] = true
reddot[int32(comm.Reddot5)] = true
reddot[int32(comm.Reddot6)] = true
// for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) {
// reddot[int32(k)] = v
// }
session.SendMsg(string(this.module.GetType()), "getall", &pb.ReddotGetAllResp{Reddot: reddot}) session.SendMsg(string(this.module.GetType()), "getall", &pb.ReddotGetAllResp{Reddot: reddot})
return return
} }

View File

@ -27,6 +27,7 @@ import (
"go_dreamfactory/modules/pagoda" "go_dreamfactory/modules/pagoda"
"go_dreamfactory/modules/pay" "go_dreamfactory/modules/pay"
"go_dreamfactory/modules/privilege" "go_dreamfactory/modules/privilege"
"go_dreamfactory/modules/reddot"
"go_dreamfactory/modules/rtask" "go_dreamfactory/modules/rtask"
"go_dreamfactory/modules/shop" "go_dreamfactory/modules/shop"
"go_dreamfactory/modules/smithy" "go_dreamfactory/modules/smithy"
@ -101,6 +102,7 @@ func main() {
growtask.NewModule(), growtask.NewModule(),
worldtask.NewModule(), worldtask.NewModule(),
academy.NewModule(), academy.NewModule(),
reddot.NewModule(),
) )
} }