41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package moonfantasy
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/mgo"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetlistCheck(session comm.IUserSession, req *pb.MoonfantasyGetListReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
///获取用户秘境列表
|
|
func (this *apiComp) Getlist(session comm.IUserSession, req *pb.MoonfantasyGetListReq) (code pb.ErrorCode, data proto.Message) {
|
|
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 {
|
|
code = pb.ErrorCode_CacheReadError
|
|
return
|
|
}
|
|
this.module.modelUserMF.recoverTicket(session, info)
|
|
if err = this.module.modelUserMF.updateUserInfo(info); err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
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
|
|
}
|