This commit is contained in:
meixiongfeng 2022-11-21 16:32:24 +08:00
commit 0743fc3f1f
8 changed files with 44 additions and 12 deletions

View File

@ -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)
}

View File

@ -23,6 +23,8 @@ type (
Imail interface {
CreateNewMail(session IUserSession, mail *pb.DBMailData) bool
SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服
///红点
IReddot
}
//道具背包接口
IItems interface {

View File

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

View File

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

View File

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

View File

@ -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})

View File

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

View File

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