上传红点埋点

This commit is contained in:
liwei1dao 2024-02-23 13:58:45 +08:00
parent f4e011979b
commit ca40bc579c
8 changed files with 228 additions and 118 deletions

View File

@ -113,36 +113,48 @@ func (this *Dailytask) OpenCmdNotice(session comm.IUserSession, keys ...string)
} }
// 查询每日红点信息 // 查询每日红点信息
func (this *Dailytask) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Dailytask) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var ( var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot25101}
ok bool
dtask *pb.DBDailytask dtask *pb.DBDailytask
progress int32 progress int32
err error err error
) )
reddot = make(map[comm.ReddotType]*pb.ReddotItem) items = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range selfrid {
if _, ok = rid[v]; ok {
break
}
}
if ok {
return
}
if dtask, err = this.modelDailytask.getUserDTasks(session.GetUserId()); err != nil { if dtask, err = this.modelDailytask.getUserDTasks(session.GetUserId()); err != nil {
this.Errorln(err) this.Errorln(err)
return return
} }
for _, v := range rid { for _, v := range selfrid {
switch v { if _, ok = rid[v]; ok {
case comm.Reddot25101: switch v {
case comm.Reddot25101:
for _, v := range dtask.Groups { for _, v := range dtask.Groups {
if v.Complete { if v.Complete {
progress++ progress++
}
} }
items[comm.Reddot25101] = &pb.ReddotItem{
Rid: int32(comm.Reddot25101),
Activated: true,
Progress: progress,
Total: int32(len(dtask.Groups)),
}
if len(dtask.Groups) == 0 {
items[comm.Reddot25101].Activated = false
}
break
} }
reddot[comm.Reddot25101] = &pb.ReddotItem{
Rid: int32(comm.Reddot25101),
Activated: true,
Progress: progress,
Total: int32(len(dtask.Groups)),
}
if len(dtask.Groups) == 0 {
reddot[comm.Reddot25101].Activated = false
}
break
} }
} }
return return

View File

@ -45,18 +45,32 @@ func (this *Gourmet) OnInstallComp() {
} }
//红点查询 //红点查询
func (this *Gourmet) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Gourmet) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem) var (
for _, v := range rid { selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot23101}
switch v { ok bool
case comm.Reddot23101: // 铁匠铺手册台 )
reddot[comm.Reddot23101] = &pb.ReddotItem{ items = make(map[comm.ReddotType]*pb.ReddotItem)
Rid: int32(comm.Reddot23101), for _, v := range selfrid {
Activated: this.modelAtlas.checkReddot2301(session.GetUserId()), if _, ok = rid[v]; ok {
}
break break
} }
} }
if ok {
return
}
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot23101: // 铁匠铺手册台
items[comm.Reddot23101] = &pb.ReddotItem{
Rid: int32(comm.Reddot23101),
Activated: this.modelAtlas.checkReddot2301(session.GetUserId()),
}
break
}
}
}
return return
} }

View File

@ -89,24 +89,36 @@ func (this *GuildGve) Rpc_ModuleGuildBossSettlement(ctx context.Context, req *pb
} }
// 红点 // 红点
func (this *GuildGve) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *GuildGve) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var ( var (
member *pb.DBGuildMember selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot15301}
err error ok bool
member *pb.DBGuildMember
err error
) )
reddot = make(map[comm.ReddotType]*pb.ReddotItem) items = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range selfrid {
if _, ok = rid[v]; ok {
break
}
}
if ok {
return
}
if member, err = this.modelGuildMember.inquireGuildMember(session.GetUserId()); err != nil { if member, err = this.modelGuildMember.inquireGuildMember(session.GetUserId()); err != nil {
return return
} }
for _, v := range rid { for _, v := range selfrid {
switch v { if _, ok = rid[v]; ok {
case comm.Reddot15301: switch v {
reddot[comm.Reddot15301] = &pb.ReddotItem{ case comm.Reddot15301:
Rid: int32(comm.Reddot15301), items[comm.Reddot15301] = &pb.ReddotItem{
Activated: true, Rid: int32(comm.Reddot15301),
Progress: member.Boosticket, Activated: true,
Progress: member.Boosticket,
}
break
} }
break
} }
} }
return return

View File

@ -89,18 +89,32 @@ func (this *Hunting) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingR
} }
//红点查询 //红点查询
func (this *Hunting) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Hunting) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem) var (
for _, v := range rid { selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot17}
switch v { ok bool
case comm.Reddot14102: )
reddot[comm.Reddot14102] = &pb.ReddotItem{ items = make(map[comm.ReddotType]*pb.ReddotItem)
Rid: int32(comm.Reddot14102), for _, v := range selfrid {
Activated: this.modelHunting.checkReddot32(session), if _, ok = rid[v]; ok {
}
break break
} }
} }
if ok {
return
}
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot14102:
items[comm.Reddot14102] = &pb.ReddotItem{
Rid: int32(comm.Reddot14102),
Activated: this.modelHunting.checkReddot32(session),
}
break
}
}
}
return return
} }

View File

@ -282,34 +282,48 @@ func (this *Library) TaskFinishNotify(uid string, taskId, fetterId int32) error
} }
// 红点 // 红点
func (this *Library) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Library) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem) var (
for _, v := range rid { selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot19105, comm.Reddot19103, comm.Reddot19109, comm.Reddot19110}
switch v { ok bool
case comm.Reddot19105: )
reddot[comm.Reddot19105] = &pb.ReddotItem{ items = make(map[comm.ReddotType]*pb.ReddotItem)
Rid: int32(comm.Reddot19105), for _, v := range selfrid {
Activated: this.modelLibrary.checkReddot19105(session.GetUserId()), if _, ok = rid[v]; ok {
}
break break
case comm.Reddot19103: }
reddot[comm.Reddot19103] = &pb.ReddotItem{ }
Rid: int32(comm.Reddot19103), if ok {
Activated: this.modelFetter.checkReddot19103(session.GetUserId()), return
}
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot19105:
items[comm.Reddot19105] = &pb.ReddotItem{
Rid: int32(comm.Reddot19105),
Activated: this.modelLibrary.checkReddot19105(session.GetUserId()),
}
break
case comm.Reddot19103:
items[comm.Reddot19103] = &pb.ReddotItem{
Rid: int32(comm.Reddot19103),
Activated: this.modelFetter.checkReddot19103(session.GetUserId()),
}
break
case comm.Reddot19109:
items[comm.Reddot19109] = &pb.ReddotItem{
Rid: int32(comm.Reddot19109),
Activated: this.modelLibrary.checkReddot19109(session.GetUserId()),
}
break
case comm.Reddot19110:
items[comm.Reddot19110] = &pb.ReddotItem{
Rid: int32(comm.Reddot19110),
Activated: this.modelLibrary.checkReddot19110(session.GetUserId()),
}
break
} }
break
case comm.Reddot19109:
reddot[comm.Reddot19109] = &pb.ReddotItem{
Rid: int32(comm.Reddot19109),
Activated: this.modelLibrary.checkReddot19109(session.GetUserId()),
}
break
case comm.Reddot19110:
reddot[comm.Reddot19110] = &pb.ReddotItem{
Rid: int32(comm.Reddot19110),
Activated: this.modelLibrary.checkReddot19110(session.GetUserId()),
}
break
} }
} }
return return

View File

@ -107,36 +107,51 @@ func (this *Mail) SendNewMail(mail *pb.DBMailData, uid ...string) bool {
} }
//红点查询 //红点查询
func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Mail) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid { var (
switch v { selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot12101, comm.Reddot12102}
case comm.Reddot12101: ok bool
if isredot := this.modelMail.checkReddot26(session.GetUserId()); isredot { )
reddot[comm.Reddot12101] = &pb.ReddotItem{ items = make(map[comm.ReddotType]*pb.ReddotItem)
Rid: int32(comm.Reddot12101), for _, v := range selfrid {
Activated: true, if _, ok = rid[v]; ok {
}
} else {
reddot[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
}
break break
case comm.Reddot12102: }
if isredot := this.modelMail.checkReddot30(session.GetUserId()); isredot { }
reddot[comm.Reddot12102] = &pb.ReddotItem{ if ok {
Rid: int32(comm.Reddot12101), return
Activated: true, }
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot12101:
if isredot := this.modelMail.checkReddot26(session.GetUserId()); isredot {
items[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: true,
}
} else {
items[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
} }
} else { break
reddot[comm.Reddot12102] = &pb.ReddotItem{ case comm.Reddot12102:
Rid: int32(comm.Reddot12101), if isredot := this.modelMail.checkReddot30(session.GetUserId()); isredot {
Activated: false, items[comm.Reddot12102] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: true,
}
} else {
items[comm.Reddot12102] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
} }
break
} }
break
} }
} }
return return

View File

@ -58,17 +58,31 @@ func (this *Mainline) Start() (err error) {
} }
// 红点查询 // 红点查询
func (this *Mainline) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Mainline) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem) var (
for _, v := range rid { selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot24101}
if v == comm.Reddot24101 { ok bool
reddot[comm.Reddot24101] = &pb.ReddotItem{ )
Rid: int32(comm.Reddot24101), items = make(map[comm.ReddotType]*pb.ReddotItem)
Activated: this.CheckPoint(session.GetUserId()), for _, v := range selfrid {
} if _, ok = rid[v]; ok {
break break
} }
} }
if ok {
return
}
for _, v := range selfrid {
if _, ok = rid[v]; ok {
if v == comm.Reddot24101 {
items[comm.Reddot24101] = &pb.ReddotItem{
Rid: int32(comm.Reddot24101),
Activated: this.CheckPoint(session.GetUserId()),
}
break
}
}
}
return return
} }

View File

@ -122,17 +122,32 @@ func (this *Viking) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank
} }
//红点查询 //红点查询
func (this *Viking) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) { func (this *Viking) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
switch v {
case comm.Reddot13102:
reddot[comm.Reddot13102] = &pb.ReddotItem{
Rid: int32(comm.Reddot13102),
Activated: this.modelViking.checkReddot31(session),
}
break
var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot13102}
ok bool
)
items = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range selfrid {
if _, ok = rid[v]; ok {
break
}
}
if ok {
return
}
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot13102:
items[comm.Reddot13102] = &pb.ReddotItem{
Rid: int32(comm.Reddot13102),
Activated: this.modelViking.checkReddot31(session),
}
break
}
} }
} }
return return