公会红点

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() {
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 {
userEx, err = this.moduleSociaty.ModuleUser.GetUserExpand(uid)
sociaty = &pb.DBSociaty{}
if err = this.moduleSociaty.service.AcrossClusterRpcCall(
context.Background(),
this.moduleSociaty.GetCrossTag(),
comm.Service_Worker,
string(comm.Rpc_ModuleFriendUseAssitHero),
pb.RPCGeneralReqA1{Param1: userEx.SociatyId},
sociaty); err != nil {
this.moduleSociaty.Errorln(err)
if err != nil {
log.Errorf("GetUserExpand uid:%v err:%v", uid, err)
return
}
}
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 = ""
if userEx.SociatyId != "" {
sociaty = &pb.DBSociaty{}
if err = this.moduleSociaty.service.AcrossClusterRpcCall(
context.Background(),
this.moduleSociaty.GetCrossTag(),
comm.Service_Worker,
string(comm.Rpc_ModuleSociaty),
pb.RPCGeneralReqA1{Param1: userEx.SociatyId},
sociaty); err != nil {
this.moduleSociaty.Errorln(err)
}
}
}
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 {
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
}