未加如公会也要返回红点key

This commit is contained in:
wh_zcy 2022-11-25 16:44:16 +08:00
parent e6cb3b71b2
commit 9919a3797c
3 changed files with 35 additions and 21 deletions

View File

@ -21,7 +21,8 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq)
if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success { if code = this.GetAllCheck(session, req); code != pb.ErrorCode_Success {
return return
} }
for k, v := range this.module.ModuleTask.Reddot(session, comm.Reddot1, comm.Reddot2, comm.Reddot3, comm.Reddot4) { for k, v := range this.module.ModuleTask.Reddot(session, comm.Reddot1, comm.Reddot2, comm.Reddot4, comm.Reddot27,
comm.Reddot28) {
reddot[int32(k)] = v reddot[int32(k)] = v
} }
for k, v := range this.module.mainline.Reddot(session, comm.Reddot5) { for k, v := range this.module.mainline.Reddot(session, comm.Reddot5) {
@ -42,6 +43,10 @@ func (this *apiComp) GetAll(session comm.IUserSession, req *pb.ReddotGetAllReq)
for k, v := range this.module.gourmet.Reddot(session, comm.Reddot20, comm.Reddot21, comm.Reddot22) { for k, v := range this.module.gourmet.Reddot(session, comm.Reddot20, comm.Reddot21, comm.Reddot22) {
reddot[int32(k)] = v reddot[int32(k)] = v
} }
for k, v := range this.module.sociaty.Reddot(session, comm.Reddot3, comm.Reddot29) {
reddot[int32(k)] = v
}
// for k, v := range this.module.mail.Reddot(session, comm.Reddot26) { // for k, v := range this.module.mail.Reddot(session, comm.Reddot26) {
// reddot[int32(k)] = v // reddot[int32(k)] = v
// } // }

View File

@ -26,6 +26,7 @@ type Reddot struct {
horoscope comm.IHoroscope horoscope comm.IHoroscope
arena comm.IArena arena comm.IArena
gourmet comm.IGourmet gourmet comm.IGourmet
sociaty comm.ISociaty
// mail comm.Imail // mail comm.Imail
api_comp *apiComp api_comp *apiComp
} }
@ -68,6 +69,11 @@ func (this *Reddot) Start() (err error) {
return return
} }
this.gourmet = module.(comm.IGourmet) this.gourmet = module.(comm.IGourmet)
if module, err = this.service.GetModule(comm.ModuleSociaty); err != nil {
return
}
this.sociaty = module.(comm.ISociaty)
// if module, err = this.service.GetModule(comm.ModuleMail); err != nil { // if module, err = this.service.GetModule(comm.ModuleMail); err != nil {
// return // return
// } // }

View File

@ -124,29 +124,32 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
sociaty := this.modelSociaty.getUserSociaty(session.GetUserId()) sociaty := this.modelSociaty.getUserSociaty(session.GetUserId())
if sociaty == nil || sociaty.Id == "" { if sociaty == nil || sociaty.Id == "" {
log.Warn("公会红点未获得公会信息", log.Fields{"uid": session.GetUserId()}) log.Warn("公会红点未获得公会信息", log.Fields{"uid": session.GetUserId()})
return for _, v := range rid {
} reddot[v] = false
var applyReddot bool
if this.modelSociaty.isRight(session.GetUserId(), sociaty,
pb.SociatyJob_PRESIDENT,
pb.SociatyJob_VICEPRESIDENT,
pb.SociatyJob_ADMIN) {
if len(sociaty.ApplyRecord) > 0 {
applyReddot = true
} }
return } else {
} var applyReddot bool
for _, v := range rid { if this.modelSociaty.isRight(session.GetUserId(), sociaty,
switch v { pb.SociatyJob_PRESIDENT,
case comm.Reddot3: pb.SociatyJob_VICEPRESIDENT,
tf := this.modelSociaty.IsSign(session.GetUserId(), sociaty) pb.SociatyJob_ADMIN) {
reddot[comm.Reddot3] = tf
case comm.Reddot29: if len(sociaty.ApplyRecord) > 0 {
reddot[comm.Reddot29] = applyReddot applyReddot = true
}
return
}
for _, v := range rid {
switch v {
case comm.Reddot3:
tf := this.modelSociaty.IsSign(session.GetUserId(), sociaty)
reddot[comm.Reddot3] = tf
case comm.Reddot29:
reddot[comm.Reddot29] = applyReddot
}
} }
} }
return return
} }