未加如公会也要返回红点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 {
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
}
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) {
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) {
// reddot[int32(k)] = v
// }

View File

@ -26,6 +26,7 @@ type Reddot struct {
horoscope comm.IHoroscope
arena comm.IArena
gourmet comm.IGourmet
sociaty comm.ISociaty
// mail comm.Imail
api_comp *apiComp
}
@ -68,6 +69,11 @@ func (this *Reddot) Start() (err error) {
return
}
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 {
// return
// }

View File

@ -124,29 +124,32 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
sociaty := this.modelSociaty.getUserSociaty(session.GetUserId())
if sociaty == nil || sociaty.Id == "" {
log.Warn("公会红点未获得公会信息", log.Fields{"uid": session.GetUserId()})
return
}
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
for _, v := range rid {
reddot[v] = false
}
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
} else {
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
}
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
}