diff --git a/comm/const.go b/comm/const.go index 8c3dd88a3..d4aedaa91 100644 --- a/comm/const.go +++ b/comm/const.go @@ -136,7 +136,7 @@ const ( // TableHunting = "hunting" // 维京远征排行榜 - TableHuntingRank = "huntingrank" + TableHuntingRecord = "huntingrecord" TableHuntingRankList = "huntingrankList" // 支线剧情任务 TableLinestory = "linestory" diff --git a/comm/imodule.go b/comm/imodule.go index e5eb9c56b..3056abf4f 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -183,6 +183,9 @@ type ( Trigger(session IUserSession, source *pb.BattleReport) } IViking interface { - CheckUserBaseVikingInfo(uid string) (data *pb.DBViking) // 查询玩家最佳通关记录 + CheckUserBaseVikingInfo(uid string) (data []*pb.DBViking) // 查询玩家最佳通关记录 + } + IHunting interface { + CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录 } ) diff --git a/lego/utils/codec/factory/factory_struct.go b/lego/utils/codec/factory/factory_struct.go index 03efeb622..b3f07a925 100644 --- a/lego/utils/codec/factory/factory_struct.go +++ b/lego/utils/codec/factory/factory_struct.go @@ -12,6 +12,12 @@ import ( "unicode" "unsafe" +<<<<<<< HEAD +======= + "go_dreamfactory/lego/sys/log" + "go_dreamfactory/lego/utils/codec/codecore" + +>>>>>>> 830997df434fe5d5d1769768c53efaa0caff2969 "github.com/modern-go/reflect2" ) diff --git a/modules/hunting/model_rank.go b/modules/hunting/model_rank.go index 7ef137a42..62c9e962d 100644 --- a/modules/hunting/model_rank.go +++ b/modules/hunting/model_rank.go @@ -15,14 +15,15 @@ type ModelRank struct { } func (this *ModelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - this.TableName = comm.TableHuntingRank + this.TableName = comm.TableHuntingRecord // 挑战记录 err = this.MCompModel.Init(service, module, comp, options) this.moduleHunting = module.(*Hunting) return } -func (this *ModelRank) AddRank(uId string, data *pb.DBHuntingRank) (err error) { - if err = this.Add(uId, data); err != nil { +func (this *ModelRank) AddRankList(uId string, objId string, data *pb.DBHuntingRank) (err error) { + + if err = this.AddList(uId, objId, data); err != nil { return } return nil @@ -91,7 +92,7 @@ func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficul Line: line, CostTime: costTime, } - this.AddList(session.GetUserId(), new.Id, new) + this.AddRankList(session.GetUserId(), new.Id, new) } return } diff --git a/modules/hunting/module.go b/modules/hunting/module.go index 2c7a00a0c..86d353374 100644 --- a/modules/hunting/module.go +++ b/modules/hunting/module.go @@ -58,3 +58,16 @@ func (this *Hunting) ModifyHuntingData(uid string, data map[string]interface{}) } return } + +func (this *Hunting) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) { + list, err := this.modelHunting.getHuntingList(uid) + if err != nil { + for k := range list.Boss { + _d := this.modulerank.getHuntingRankListByBossType(uid, k) + if _d != nil { + data = append(data, _d) + } + } + } + return +} diff --git a/modules/timer/huntingrank.go b/modules/timer/huntingrank.go index 2e62350d2..9933dcfb6 100644 --- a/modules/timer/huntingrank.go +++ b/modules/timer/huntingrank.go @@ -22,7 +22,7 @@ type HuntingRank struct { //组件初始化接口 func (this *HuntingRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { - this.DbName = comm.TableHuntingRank + this.DbName = comm.TableHuntingRecord this.TableName = comm.TableHuntingRankList this.MCompModel.Init(service, module, comp, options) this.service = service