From 14f4068e3e01d7002e6c5f66e964e004912a5a70 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 21 Nov 2022 15:00:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=AE=98=E7=BD=91?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 4 ++-- modules/gateway/options.go | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 909af6305..59181cb3c 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -270,14 +270,14 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) { if len(serviceTag) == 0 { if err = this.gateway.Service().RpcCall(context.Background(), servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { this.gateway.Error("[UserResponse]", - log.Fields{"uid": this.uId, "req": req.String(), "err": err.Error()}, + log.Fields{"uid": this.uId, "serviceTag": serviceTag, "servicePath": servicePath, "req": req.String(), "err": err.Error()}, ) return } } else { //跨集群调用 if err = this.gateway.Service().AcrossClusterRpcCall(context.Background(), serviceTag, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { this.gateway.Error("[UserResponse]", - log.Fields{"uid": this.uId, "req": req.String(), "err": err.Error()}, + log.Fields{"uid": this.uId, "serviceTag": serviceTag, "servicePath": servicePath, "req": req.String(), "err": err.Error()}, ) return } diff --git a/modules/gateway/options.go b/modules/gateway/options.go index e47f55b3e..c4ed54b02 100644 --- a/modules/gateway/options.go +++ b/modules/gateway/options.go @@ -1,6 +1,8 @@ package gateway import ( + "errors" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/utils/mapstructure" "go_dreamfactory/modules" ) @@ -26,5 +28,8 @@ func (this *Options) LoadConfig(settings map[string]interface{}) (err error) { } err = mapstructure.Decode(settings, this) } + if this.Log = log.NewTurnlog(this.Debug, log.Clone("", 4)); this.Log == nil { + err = errors.New("log is nil") + } return } From c994874a1845694de9a241a172f8a4c31100ee63 Mon Sep 17 00:00:00 2001 From: zhaocy Date: Mon, 21 Nov 2022 15:39:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A5=BD=E5=8F=8B?= =?UTF-8?q?=E8=8E=B7=E8=B5=9E=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/v2/ui/views/friend_randlist.go | 9 +++++---- modules/friend/api_cross_list.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/v2/ui/views/friend_randlist.go b/cmd/v2/ui/views/friend_randlist.go index 14d42c940..54af004ff 100644 --- a/cmd/v2/ui/views/friend_randlist.go +++ b/cmd/v2/ui/views/friend_randlist.go @@ -43,14 +43,15 @@ func (this *FriendRandListView) CreateView(t *model.TestCase) fyne.CanvasObject }) //好友申请 friendApplyBtn := widget.NewButton("申请", func() { - selItems := this.itemList.SelItemIds - if len(selItems) == 0 || (len(selItems) > 0 && selItems[0] == "") { + selItemId := this.itemList.SelItemId + logrus.Debug(selItemId) + if selItemId == ""{ common.ShowTip("请选择项目") return } - logrus.Debug(this.itemList.SelItemIds[0]) + if err := service.GetPttService().SendToClient(t.MainType, "apply", &pb.FriendApplyReq{ - FriendId: this.itemList.SelItemIds[0], + FriendId: selItemId, }); err != nil { logrus.Error(err) } diff --git a/modules/friend/api_cross_list.go b/modules/friend/api_cross_list.go index d724062b3..f829f5007 100644 --- a/modules/friend/api_cross_list.go +++ b/modules/friend/api_cross_list.go @@ -50,7 +50,7 @@ func (this *apiComp) List(session comm.IUserSession, req *pb.FriendListReq) (cod } //判断是否已接收获赞 - if _, ok := utils.Findx(self.ZanIds, userId); ok { + if _, ok := utils.Findx(self.GetZandIds, userId); ok { base.IsGetZaned = true } From 2527e10578b83263c284bdaecf5822b8aeb9bee4 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 21 Nov 2022 16:20:57 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BA=A2=E7=82=B9?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 ++ modules/reddot/api_get.go | 18 +++++++++++++----- modules/reddot/api_getall.go | 6 ++++++ modules/reddot/module.go | 10 ++++++++++ 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index 1e45bf0e8..84da7c71e 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -23,6 +23,8 @@ type ( Imail interface { CreateNewMail(session IUserSession, mail *pb.DBMailData) bool SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服 + ///红点 + IReddot } //道具背包接口 IItems interface { diff --git a/modules/reddot/api_get.go b/modules/reddot/api_get.go index 608cd7959..d4c97900d 100644 --- a/modules/reddot/api_get.go +++ b/modules/reddot/api_get.go @@ -33,26 +33,34 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (code for k, v := range this.module.ModuleTask.Reddot(session, _rid) { reddot[int32(k)] = v } - case (comm.Reddot3): + case comm.Reddot3: for k, v := range this.module.ModuleSociaty.Reddot(session, _rid) { reddot[int32(k)] = v } - case (comm.Reddot4): + case comm.Reddot4: for k, v := range this.module.ModuleTask.Reddot(session, _rid) { reddot[int32(k)] = v } - case (comm.Reddot17): + case comm.Reddot17: for k, v := range this.module.horoscope.Reddot(session, _rid) { reddot[int32(k)] = v } - case (comm.Reddot19): + case comm.Reddot19: for k, v := range this.module.arena.Reddot(session, _rid) { reddot[int32(k)] = v } - case (comm.Reddot23), (comm.Reddot24), (comm.Reddot25): + 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: + for k, v := range this.module.gourmet.Reddot(session, _rid) { + reddot[int32(k)] = v + } } } session.SendMsg(string(this.module.GetType()), "get", &pb.ReddotGetAllResp{Reddot: reddot}) diff --git a/modules/reddot/api_getall.go b/modules/reddot/api_getall.go index 0c4cb4df6..824e12633 100644 --- a/modules/reddot/api_getall.go +++ b/modules/reddot/api_getall.go @@ -39,6 +39,12 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq) for k, v := range this.module.arena.Reddot(session, comm.Reddot19) { reddot[int32(k)] = v } + for k, v := range this.module.gourmet.Reddot(session, comm.Reddot20, comm.Reddot21, comm.Reddot22) { + reddot[int32(k)] = v + } + for k, v := range this.module.mail.Reddot(session, comm.Reddot26) { + reddot[int32(k)] = v + } session.SendMsg(string(this.module.GetType()), "getall", &pb.ReddotGetAllResp{Reddot: reddot}) return } diff --git a/modules/reddot/module.go b/modules/reddot/module.go index d48ff521f..4434a3c99 100644 --- a/modules/reddot/module.go +++ b/modules/reddot/module.go @@ -25,6 +25,8 @@ type Reddot struct { martialhall comm.IMartialhall horoscope comm.IHoroscope arena comm.IArena + gourmet comm.IGourmet + mail comm.Imail api_comp *apiComp } @@ -62,6 +64,14 @@ func (this *Reddot) Start() (err error) { return } this.arena = module.(comm.IArena) + if module, err = this.service.GetModule(comm.ModuleGourmet); err != nil { + return + } + this.gourmet = module.(comm.IGourmet) + if module, err = this.service.GetModule(comm.ModuleMail); err != nil { + return + } + this.mail = module.(comm.Imail) return }