查询狩猎记录接口
This commit is contained in:
parent
d60181b948
commit
830997df43
@ -136,7 +136,7 @@ const (
|
||||
//
|
||||
TableHunting = "hunting"
|
||||
// 维京远征排行榜
|
||||
TableHuntingRank = "huntingrank"
|
||||
TableHuntingRecord = "huntingrecord"
|
||||
TableHuntingRankList = "huntingrankList"
|
||||
// 支线剧情任务
|
||||
TableLinestory = "linestory"
|
||||
|
@ -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) // 查询玩家最佳通关记录
|
||||
}
|
||||
)
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"unicode"
|
||||
"unsafe"
|
||||
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/lego/utils/codec/codecore"
|
||||
|
||||
"github.com/modern-go/reflect2"
|
||||
@ -108,6 +109,7 @@ func describeStruct(ctx *codecore.Ctx, typ reflect2.Type) *StructDescriptor {
|
||||
bindings := []*Binding{}
|
||||
for i := 0; i < structType.NumField(); i++ {
|
||||
field := structType.Field(i)
|
||||
log.Debugf("field:%v", field)
|
||||
tag, hastag := field.Tag().Lookup(ctx.Config.TagKey)
|
||||
if ctx.Config.OnlyTaggedField && !hastag && !field.Anonymous() {
|
||||
continue
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user