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/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/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 } 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 } 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 }