公会红点

This commit is contained in:
wh_zcy 2022-11-11 16:34:30 +08:00
parent d57ec13b9d
commit 764ca2a466
2 changed files with 29 additions and 22 deletions

View File

@ -197,33 +197,39 @@ func (this *ModelSociaty) getUserSociaty(uid string) (sociaty *pb.DBSociaty) {
) )
if this.moduleSociaty.IsCross() { if this.moduleSociaty.IsCross() {
userEx, err = this.moduleSociaty.ModuleUser.GetRemoteUserExpand(uid) userEx, err = this.moduleSociaty.ModuleUser.GetRemoteUserExpand(uid)
if err != nil {
log.Errorf("GetUserExpand uid:%v err:%v", uid, err)
return
}
if userEx.SociatyId != "" {
sociaty = this.getSociaty(userEx.SociatyId)
if sociaty.Id != "" {
//验证是否解散
if this.isDismiss(sociaty) {
sociaty.Id = ""
}
}
}
} else { } else {
userEx, err = this.moduleSociaty.ModuleUser.GetUserExpand(uid) userEx, err = this.moduleSociaty.ModuleUser.GetUserExpand(uid)
sociaty = &pb.DBSociaty{} if err != nil {
if err = this.moduleSociaty.service.AcrossClusterRpcCall( log.Errorf("GetUserExpand uid:%v err:%v", uid, err)
context.Background(), return
this.moduleSociaty.GetCrossTag(),
comm.Service_Worker,
string(comm.Rpc_ModuleFriendUseAssitHero),
pb.RPCGeneralReqA1{Param1: userEx.SociatyId},
sociaty); err != nil {
this.moduleSociaty.Errorln(err)
} }
} if userEx.SociatyId != "" {
if err != nil { sociaty = &pb.DBSociaty{}
log.Errorf("GetUserExpand uid:%v err:%v", uid, err) if err = this.moduleSociaty.service.AcrossClusterRpcCall(
return context.Background(),
} this.moduleSociaty.GetCrossTag(),
comm.Service_Worker,
if userEx.SociatyId != "" { string(comm.Rpc_ModuleSociaty),
sociaty = this.getSociaty(userEx.SociatyId) pb.RPCGeneralReqA1{Param1: userEx.SociatyId},
if sociaty.Id != "" { sociaty); err != nil {
//验证是否解散 this.moduleSociaty.Errorln(err)
if this.isDismiss(sociaty) {
sociaty.Id = ""
} }
} }
} }
return return
} }

View File

@ -114,6 +114,7 @@ func (this *Sociaty) Reddot(uid string, rid ...comm.ReddotType) (reddot map[comm
// 跨服获取公会 // 跨服获取公会
func (this *Sociaty) RpcGetSociaty(ctx context.Context, req *pb.RPCGeneralReqA1, reply *pb.DBSociaty) error { func (this *Sociaty) RpcGetSociaty(ctx context.Context, req *pb.RPCGeneralReqA1, reply *pb.DBSociaty) error {
this.Debug("Rpc_ModuleSociaty", log.Field{Key: "req", Value: req}) this.Debug("Rpc_ModuleSociaty", log.Field{Key: "req", Value: req})
reply = this.modelSociaty.getSociaty(req.Param1) sociaty := this.modelSociaty.getSociaty(req.Param1)
*reply = *sociaty
return nil return nil
} }