赛季塔

This commit is contained in:
meixiongfeng 2022-08-18 16:56:21 +08:00
parent 8c8e785517
commit 87fb35d43c
3 changed files with 51 additions and 1 deletions

View File

@ -103,6 +103,8 @@ const (
TableGourmet = "gourmet"
// 随机任务
TableRtask = "rtask"
///爬塔排行
TablePagodaRank = "pagodarank"
)
//RPC服务接口定义处

View File

@ -28,7 +28,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
code = pb.ErrorCode_PagodaNotFound
return
}
cfg := this.module.configure.GetPagodaconfig(req.LevelID)
cfg := this.module.configure.GetPagodaConfigData(req.PagodaType, req.LevelID)
if cfg == nil {
code = pb.ErrorCode_PagodaNotFound
return

View File

@ -0,0 +1,48 @@
package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type ModelRank struct {
modules.MCompModel
moduleUser *Pagoda
}
func (this *ModelRank) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
this.TableName = comm.TablePagodaRank
err = this.MCompModel.Init(service, module, comp, options)
this.moduleUser = module.(*Pagoda)
return
}
//获取用户
func (this *ModelRank) getUserSession(uid string) (cuser *pb.CacheUser) {
cuser = &pb.CacheUser{}
if err := this.Get(uid, cuser); err != nil {
this.moduleUser.Errorf("GetUserSession err:%v", err)
return
}
return
}
//获取用户通过扩展表
// func (this *ModelRank) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) {
// result = &pb.DBUserExpand{}
// if err = this.moduleUser.modelExpand.Get(uid, result); err != nil && redis.RedisNil != err {
// return
// }
// err = nil
// return result, err
// }
// func (this *ModelRank) ChangeUserExpand(uid string, value map[string]interface{}) (err error) {
// if len(value) == 0 {
// return nil
// }
// return this.moduleUser.modelExpand.Change(uid, value)
// }