From 044486720e9eeb29240cc0d2694ff2f66c630702 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 10 Nov 2022 16:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BA=A2=E7=82=B9=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/martialhall/module.go | 6 ++++-- modules/reddot/api_get.go | 7 +++++-- modules/reddot/api_getall.go | 12 +++++++++--- services/worker/main.go | 2 ++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/modules/martialhall/module.go b/modules/martialhall/module.go index 1028595ab..40cb48538 100644 --- a/modules/martialhall/module.go +++ b/modules/martialhall/module.go @@ -51,6 +51,8 @@ func (this *Martialhall) OnInstallComp() { } //红点查询 -func (this *Martialhall) Reddot(rid comm.ReddotType, uid string) bool { - return this.modelMartialhall.checkReddot(uid) +func (this *Martialhall) Reddot(uid string, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { + reddot = make(map[comm.ReddotType]bool) + + return } diff --git a/modules/reddot/api_get.go b/modules/reddot/api_get.go index e4146554b..490103ab5 100644 --- a/modules/reddot/api_get.go +++ b/modules/reddot/api_get.go @@ -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 { return } - for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) { - reddot[int32(k)] = v + for _, v := range req.Rids { + 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}) return } diff --git a/modules/reddot/api_getall.go b/modules/reddot/api_getall.go index cd74c8a7b..482c86a9b 100644 --- a/modules/reddot/api_getall.go +++ b/modules/reddot/api_getall.go @@ -21,9 +21,15 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success { return } - for k, v := range this.module.martialhall.Reddot(session.GetUserId(), comm.Reddot1) { - reddot[int32(k)] = v - } + reddot[int32(comm.Reddot1)] = true + 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}) return } diff --git a/services/worker/main.go b/services/worker/main.go index ea2a8fcdd..dc0ae2e10 100644 --- a/services/worker/main.go +++ b/services/worker/main.go @@ -27,6 +27,7 @@ import ( "go_dreamfactory/modules/pagoda" "go_dreamfactory/modules/pay" "go_dreamfactory/modules/privilege" + "go_dreamfactory/modules/reddot" "go_dreamfactory/modules/rtask" "go_dreamfactory/modules/shop" "go_dreamfactory/modules/smithy" @@ -101,6 +102,7 @@ func main() { growtask.NewModule(), worldtask.NewModule(), academy.NewModule(), + reddot.NewModule(), ) }