上传红点埋点

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,18 +113,29 @@ 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 (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot25101}
ok bool
dtask *pb.DBDailytask
progress int32
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 {
this.Errorln(err)
return
}
for _, v := range rid {
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot25101:
@ -133,18 +144,19 @@ func (this *Dailytask) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
progress++
}
}
reddot[comm.Reddot25101] = &pb.ReddotItem{
items[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
items[comm.Reddot25101].Activated = false
}
break
}
}
}
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) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
func (this *Gourmet) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot23101}
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.Reddot23101: // 铁匠铺手册台
reddot[comm.Reddot23101] = &pb.ReddotItem{
items[comm.Reddot23101] = &pb.ReddotItem{
Rid: int32(comm.Reddot23101),
Activated: this.modelAtlas.checkReddot2301(session.GetUserId()),
}
break
}
}
}
return
}

View File

@ -89,19 +89,30 @@ 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 (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot15301}
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 {
return
}
for _, v := range rid {
for _, v := range selfrid {
if _, ok = rid[v]; ok {
switch v {
case comm.Reddot15301:
reddot[comm.Reddot15301] = &pb.ReddotItem{
items[comm.Reddot15301] = &pb.ReddotItem{
Rid: int32(comm.Reddot15301),
Activated: true,
Progress: member.Boosticket,
@ -109,6 +120,7 @@ func (this *GuildGve) Reddot(session comm.IUserSession, rid ...comm.ReddotType)
break
}
}
}
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) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
func (this *Hunting) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot17}
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.Reddot14102:
reddot[comm.Reddot14102] = &pb.ReddotItem{
items[comm.Reddot14102] = &pb.ReddotItem{
Rid: int32(comm.Reddot14102),
Activated: this.modelHunting.checkReddot32(session),
}
break
}
}
}
return
}

View File

@ -282,36 +282,50 @@ 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) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
func (this *Library) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot19105, comm.Reddot19103, comm.Reddot19109, comm.Reddot19110}
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.Reddot19105:
reddot[comm.Reddot19105] = &pb.ReddotItem{
items[comm.Reddot19105] = &pb.ReddotItem{
Rid: int32(comm.Reddot19105),
Activated: this.modelLibrary.checkReddot19105(session.GetUserId()),
}
break
case comm.Reddot19103:
reddot[comm.Reddot19103] = &pb.ReddotItem{
items[comm.Reddot19103] = &pb.ReddotItem{
Rid: int32(comm.Reddot19103),
Activated: this.modelFetter.checkReddot19103(session.GetUserId()),
}
break
case comm.Reddot19109:
reddot[comm.Reddot19109] = &pb.ReddotItem{
items[comm.Reddot19109] = &pb.ReddotItem{
Rid: int32(comm.Reddot19109),
Activated: this.modelLibrary.checkReddot19109(session.GetUserId()),
}
break
case comm.Reddot19110:
reddot[comm.Reddot19110] = &pb.ReddotItem{
items[comm.Reddot19110] = &pb.ReddotItem{
Rid: int32(comm.Reddot19110),
Activated: this.modelLibrary.checkReddot19110(session.GetUserId()),
}
break
}
}
}
return
}

View File

@ -107,18 +107,32 @@ 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) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
func (this *Mail) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot12101, comm.Reddot12102}
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.Reddot12101:
if isredot := this.modelMail.checkReddot26(session.GetUserId()); isredot {
reddot[comm.Reddot12101] = &pb.ReddotItem{
items[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: true,
}
} else {
reddot[comm.Reddot12101] = &pb.ReddotItem{
items[comm.Reddot12101] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
@ -126,12 +140,12 @@ func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (red
break
case comm.Reddot12102:
if isredot := this.modelMail.checkReddot30(session.GetUserId()); isredot {
reddot[comm.Reddot12102] = &pb.ReddotItem{
items[comm.Reddot12102] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: true,
}
} else {
reddot[comm.Reddot12102] = &pb.ReddotItem{
items[comm.Reddot12102] = &pb.ReddotItem{
Rid: int32(comm.Reddot12101),
Activated: false,
}
@ -139,6 +153,7 @@ func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (red
break
}
}
}
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) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
func (this *Mainline) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
var (
selfrid []comm.ReddotType = []comm.ReddotType{comm.Reddot24101}
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 {
if v == comm.Reddot24101 {
reddot[comm.Reddot24101] = &pb.ReddotItem{
items[comm.Reddot24101] = &pb.ReddotItem{
Rid: int32(comm.Reddot24101),
Activated: this.CheckPoint(session.GetUserId()),
}
break
}
}
}
return
}

View File

@ -122,12 +122,26 @@ 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) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)
for _, v := range rid {
func (this *Viking) Reddot(session comm.IUserSession, rid map[comm.ReddotType]struct{}) (items map[comm.ReddotType]*pb.ReddotItem) {
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:
reddot[comm.Reddot13102] = &pb.ReddotItem{
items[comm.Reddot13102] = &pb.ReddotItem{
Rid: int32(comm.Reddot13102),
Activated: this.modelViking.checkReddot31(session),
}
@ -135,6 +149,7 @@ func (this *Viking) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r
}
}
}
return
}