红点接口调整

This commit is contained in:
meixiongfeng 2023-06-15 22:49:44 +08:00
parent 7407e5a536
commit 16a840820b
4 changed files with 62 additions and 17 deletions

View File

@ -199,19 +199,27 @@ func (this *Friend) QiecuoFinishNotify(redUid, matchId string) error {
return nil return nil
} }
func (this *Friend) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { func (this *Friend) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]bool) reddot = make(map[comm.ReddotType]*pb.ReddotItem)
friend := this.modelFriend.GetFriend(session.GetUserId()) friend := this.modelFriend.GetFriend(session.GetUserId())
if friend == nil { if friend == nil {
for _, v := range rid { for _, v := range rid {
reddot[v] = false reddot[v] = &pb.ReddotItem{
Rid: 0,
Activated: false,
Nextchanagetime: 0,
}
} }
} else { } else {
for _, v := range rid { for _, v := range rid {
switch v { switch v {
case comm.Reddot21101: case comm.Reddot21101:
if len(friend.ApplyIds) > 0 { if len(friend.ApplyIds) > 0 {
reddot[comm.Reddot15102] = true reddot[comm.Reddot15102] = &pb.ReddotItem{
Rid: 0,
Activated: true,
Nextchanagetime: 0,
}
} }
} }
} }

View File

@ -73,7 +73,11 @@ func (this *modelTask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
return return
} }
if b, y := i.(comm.IReddot); y { if b, y := i.(comm.IReddot); y {
b.PushReddot(session, comm.Reddot17107) b.PushReddot(session, &pb.ReddotItem{
Rid: int32(comm.Reddot17107),
Activated: true,
Nextchanagetime: 0,
})
} }
} }

View File

@ -133,13 +133,17 @@ func (this *Sociaty) MembersBySociatyId(sociatyId string) (list []*pb.SociatyMem
} }
// 公会 // 公会
func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]bool) reddot = make(map[comm.ReddotType]*pb.ReddotItem)
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.Field{Key: "uid", Value: session.GetUserId()}) log.Warn("公会红点未获得公会信息", log.Field{Key: "uid", Value: session.GetUserId()})
for _, v := range rid { for _, v := range rid {
reddot[v] = false reddot[v] = &pb.ReddotItem{
Rid: 0,
Activated: false,
Nextchanagetime: 0,
}
} }
} else { } else {
var applyReddot bool var applyReddot bool
@ -156,9 +160,18 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (
switch v { switch v {
case comm.Reddot15102: case comm.Reddot15102:
tf := this.modelSociaty.IsSign(session.GetUserId(), sociaty) tf := this.modelSociaty.IsSign(session.GetUserId(), sociaty)
reddot[comm.Reddot15102] = !tf reddot[comm.Reddot15102] =
&pb.ReddotItem{
Rid: 0,
Activated: !tf,
Nextchanagetime: 0,
}
case comm.Reddot15201: case comm.Reddot15201:
reddot[comm.Reddot15201] = applyReddot reddot[comm.Reddot15201] = &pb.ReddotItem{
Rid: 0,
Activated: applyReddot,
Nextchanagetime: 0,
}
} }
} }
} }

View File

@ -138,27 +138,47 @@ func (this *ModuleTask) GetTaskDayFinished(uid string) []*pb.TaskData {
return nil //this.modelTask.getFinishTasks(uid, comm.TASK_DAILY) return nil //this.modelTask.getFinishTasks(uid, comm.TASK_DAILY)
} }
func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]bool) reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid { for _, v := range rid {
switch v { switch v {
case comm.Reddot10101: case comm.Reddot10101:
tf, _ := this.modelTask.noReceiveTask(session.GetUserId(), comm.TASK_DAILY) tf, _ := this.modelTask.noReceiveTask(session.GetUserId(), comm.TASK_DAILY)
reddot[comm.Reddot10101] = tf reddot[comm.Reddot10101] = &pb.ReddotItem{
Rid: 0,
Activated: tf,
Nextchanagetime: 0,
}
case comm.Reddot10102: case comm.Reddot10102:
tf, _ := this.modelTask.noReceiveTask(session.GetUserId(), comm.TASK_WEEKLY) tf, _ := this.modelTask.noReceiveTask(session.GetUserId(), comm.TASK_WEEKLY)
reddot[comm.Reddot10102] = tf reddot[comm.Reddot10102] = &pb.ReddotItem{
Rid: 0,
Activated: tf,
Nextchanagetime: 0,
}
case comm.Reddot10103: case comm.Reddot10103:
tf, _ := this.modelTask.noReceiveTask(session.GetUserId(), comm.TASK_ACHIEVE) tf, _ := this.modelTask.noReceiveTask(session.GetUserId(), comm.TASK_ACHIEVE)
reddot[comm.Reddot10103] = tf reddot[comm.Reddot10103] = &pb.ReddotItem{
Rid: 0,
Activated: tf,
Nextchanagetime: 0,
}
case comm.Reddot10201: case comm.Reddot10201:
tf, _ := this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_DAILY) tf, _ := this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_DAILY)
reddot[comm.Reddot10201] = tf reddot[comm.Reddot10201] = &pb.ReddotItem{
Rid: 0,
Activated: tf,
Nextchanagetime: 0,
}
case comm.Reddot10301: case comm.Reddot10301:
tf, _ := this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_WEEKLY) tf, _ := this.modelTaskActive.noReceiveTaskActive(session.GetUserId(), comm.TASK_WEEKLY)
reddot[comm.Reddot10301] = tf reddot[comm.Reddot10301] = &pb.ReddotItem{
Rid: 0,
Activated: tf,
Nextchanagetime: 0,
}
} }
} }
return return