48 lines
1.4 KiB
Go
48 lines
1.4 KiB
Go
package moonfantasy
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/mgo"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.MoonfantasyGetListReq) (errdata *pb.ErrorData) {
|
|
|
|
return
|
|
}
|
|
|
|
///获取用户秘境列表
|
|
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.MoonfantasyGetListReq) (errdata *pb.ErrorData) {
|
|
var (
|
|
err error
|
|
info *pb.DBUserMFantasy
|
|
mfantasys []*pb.DBMoonFantasy = make([]*pb.DBMoonFantasy, 0)
|
|
)
|
|
if info, err = this.module.modelUserMF.queryUsermfantasy(session.GetUserId()); err != nil && err != mgo.MongodbNil {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_CacheReadError,
|
|
Title: pb.ErrorCode_CacheReadError.ToString(),
|
|
Message: err.Error(),
|
|
}
|
|
return
|
|
}
|
|
// this.module.modelUserMF.recoverTicket(session, info)
|
|
// if err = this.module.modelUserMF.updateUserInfo(info); err != nil {
|
|
// errdata = &pb.ErrorData{
|
|
// Code: pb.ErrorCode_DBError,
|
|
// Title: pb.ErrorCode_DBError.ToString(),
|
|
// Message: err.Error(),
|
|
// }
|
|
// return
|
|
// }
|
|
this.module.ModuleItems.RecoverTicket(session)
|
|
mfantasys, err = this.module.modelDream.querymfantasys(session.GetUserId())
|
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.MoonfantasyGetListResp{
|
|
// BattleNum: info.Ticket,
|
|
BuyNum: info.BuyNum,
|
|
Dfantasys: mfantasys,
|
|
})
|
|
return
|
|
}
|