From 16a840820b627559b6ab08e317bb4c1ed7dcb807 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 15 Jun 2023 22:49:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E7=82=B9=E6=8E=A5=E5=8F=A3=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/friend/module.go | 16 ++++++++++++---- modules/smithy/model_task.go | 6 +++++- modules/sociaty/module.go | 23 ++++++++++++++++++----- modules/task/module.go | 34 +++++++++++++++++++++++++++------- 4 files changed, 62 insertions(+), 17 deletions(-) diff --git a/modules/friend/module.go b/modules/friend/module.go index 287ab0c49..e8a9ef693 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -199,19 +199,27 @@ func (this *Friend) QiecuoFinishNotify(redUid, matchId string) error { return nil } -func (this *Friend) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { - reddot = make(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]*pb.ReddotItem) friend := this.modelFriend.GetFriend(session.GetUserId()) if friend == nil { for _, v := range rid { - reddot[v] = false + reddot[v] = &pb.ReddotItem{ + Rid: 0, + Activated: false, + Nextchanagetime: 0, + } } } else { for _, v := range rid { switch v { case comm.Reddot21101: if len(friend.ApplyIds) > 0 { - reddot[comm.Reddot15102] = true + reddot[comm.Reddot15102] = &pb.ReddotItem{ + Rid: 0, + Activated: true, + Nextchanagetime: 0, + } } } } diff --git a/modules/smithy/model_task.go b/modules/smithy/model_task.go index 5f67237a1..efe7e25fb 100644 --- a/modules/smithy/model_task.go +++ b/modules/smithy/model_task.go @@ -73,7 +73,11 @@ func (this *modelTask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) { return } 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, + }) } } diff --git a/modules/sociaty/module.go b/modules/sociaty/module.go index ba2493ae5..0fce23c97 100644 --- a/modules/sociaty/module.go +++ b/modules/sociaty/module.go @@ -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) { - reddot = make(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]*pb.ReddotItem) sociaty := this.modelSociaty.getUserSociaty(session.GetUserId()) if sociaty == nil || sociaty.Id == "" { log.Warn("公会红点未获得公会信息", log.Field{Key: "uid", Value: session.GetUserId()}) for _, v := range rid { - reddot[v] = false + reddot[v] = &pb.ReddotItem{ + Rid: 0, + Activated: false, + Nextchanagetime: 0, + } } } else { var applyReddot bool @@ -156,9 +160,18 @@ func (this *Sociaty) Reddot(session comm.IUserSession, rid ...comm.ReddotType) ( switch v { case comm.Reddot15102: 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: - reddot[comm.Reddot15201] = applyReddot + reddot[comm.Reddot15201] = &pb.ReddotItem{ + Rid: 0, + Activated: applyReddot, + Nextchanagetime: 0, + } } } } diff --git a/modules/task/module.go b/modules/task/module.go index 001ebd43d..405f748ee 100644 --- a/modules/task/module.go +++ b/modules/task/module.go @@ -138,27 +138,47 @@ func (this *ModuleTask) GetTaskDayFinished(uid string) []*pb.TaskData { return nil //this.modelTask.getFinishTasks(uid, comm.TASK_DAILY) } -func (this *ModuleTask) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { - reddot = make(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]*pb.ReddotItem) for _, v := range rid { switch v { case comm.Reddot10101: 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: 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: 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: 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: 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