上传故事线代码

This commit is contained in:
liwei 2023-08-09 15:50:21 +08:00
parent e7e6b6864e
commit 7a86e715f0
5 changed files with 8 additions and 5 deletions

View File

@ -342,6 +342,9 @@ const (
TableGamePuzzle = "puzzle" TableGamePuzzle = "puzzle"
TableGameLattice = "lattice" TableGameLattice = "lattice"
//开服任务
TableStoryline = "storyline"
) )
// RPC服务接口定义处 // RPC服务接口定义处

View File

@ -21,7 +21,7 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.StorylineInfoReq) (
return return
} }
if info, err = this.module.modeltask.getUserDTasks(session.GetUserId()); err != nil { if info, err = this.module.modeltask.getUserStoryline(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), Title: pb.ErrorCode_DBError.ToString(),

View File

@ -37,7 +37,7 @@ func (this *apiComp) Complete(session comm.IUserSession, req *pb.StorylineComple
return return
} }
if info, err = this.module.modeltask.getUserDTasks(session.GetUserId()); err != nil { if info, err = this.module.modeltask.getUserStoryline(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), Title: pb.ErrorCode_DBError.ToString(),

View File

@ -49,7 +49,7 @@ func (this *apiComp) Turnon(session comm.IUserSession, req *pb.StorylineTurnonRe
isprotect = true isprotect = true
} }
if info, err = this.module.modeltask.getUserDTasks(session.GetUserId()); err != nil { if info, err = this.module.modeltask.getUserStoryline(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{ errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError, Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(), Title: pb.ErrorCode_DBError.ToString(),

View File

@ -19,7 +19,7 @@ type Modeltask struct {
func (this *Modeltask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { func (this *Modeltask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options) err = this.MCompModel.Init(service, module, comp, options)
this.TableName = comm.Tablekftask this.TableName = comm.TableStoryline
this.module = module.(*StoryLine) this.module = module.(*StoryLine)
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
@ -28,7 +28,7 @@ func (this *Modeltask) Init(service core.IService, module core.IModule, comp cor
} }
// 获取用户全部的埋点数据 // 获取用户全部的埋点数据
func (this *Modeltask) getUserDTasks(uid string) (results *pb.DBStoryline, err error) { func (this *Modeltask) getUserStoryline(uid string) (results *pb.DBStoryline, err error) {
results = &pb.DBStoryline{} results = &pb.DBStoryline{}
if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil { if err = this.Get(uid, results); err != nil && err != mgo.MongodbNil {
this.module.Errorln(err) this.module.Errorln(err)