Merge branches 'dev' and 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
liwei1dao 2022-10-13 12:06:37 +08:00
commit cf91bd07e2
6 changed files with 30 additions and 7 deletions

View File

@ -136,7 +136,7 @@ const (
// //
TableHunting = "hunting" TableHunting = "hunting"
// 维京远征排行榜 // 维京远征排行榜
TableHuntingRank = "huntingrank" TableHuntingRecord = "huntingrecord"
TableHuntingRankList = "huntingrankList" TableHuntingRankList = "huntingrankList"
// 支线剧情任务 // 支线剧情任务
TableLinestory = "linestory" TableLinestory = "linestory"

View File

@ -183,6 +183,9 @@ type (
Trigger(session IUserSession, source *pb.BattleReport) Trigger(session IUserSession, source *pb.BattleReport)
} }
IViking interface { IViking interface {
CheckUserBaseVikingInfo(uid string) (data *pb.DBViking) // 查询玩家最佳通关记录 CheckUserBaseVikingInfo(uid string) (data []*pb.DBViking) // 查询玩家最佳通关记录
}
IHunting interface {
CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录
} }
) )

View File

@ -12,6 +12,12 @@ import (
"unicode" "unicode"
"unsafe" "unsafe"
<<<<<<< HEAD
=======
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/utils/codec/codecore"
>>>>>>> 830997df434fe5d5d1769768c53efaa0caff2969
"github.com/modern-go/reflect2" "github.com/modern-go/reflect2"
) )

View File

@ -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) { 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) err = this.MCompModel.Init(service, module, comp, options)
this.moduleHunting = module.(*Hunting) this.moduleHunting = module.(*Hunting)
return return
} }
func (this *ModelRank) AddRank(uId string, data *pb.DBHuntingRank) (err error) { func (this *ModelRank) AddRankList(uId string, objId string, data *pb.DBHuntingRank) (err error) {
if err = this.Add(uId, data); err != nil {
if err = this.AddList(uId, objId, data); err != nil {
return return
} }
return nil return nil
@ -91,7 +92,7 @@ func (this *ModelRank) updatehuntingRankList(session comm.IUserSession, difficul
Line: line, Line: line,
CostTime: costTime, CostTime: costTime,
} }
this.AddList(session.GetUserId(), new.Id, new) this.AddRankList(session.GetUserId(), new.Id, new)
} }
return return
} }

View File

@ -58,3 +58,16 @@ func (this *Hunting) ModifyHuntingData(uid string, data map[string]interface{})
} }
return 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
}

View File

@ -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) { 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.TableName = comm.TableHuntingRankList
this.MCompModel.Init(service, module, comp, options) this.MCompModel.Init(service, module, comp, options)
this.service = service this.service = service