33 lines
971 B
Go
33 lines
971 B
Go
package viking
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.VikingGetListReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.VikingGetListReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
|
code = this.GetListCheck(session, req)
|
|
if code != pb.ErrorCode_Success {
|
|
return // 参数校验失败直接返回
|
|
}
|
|
// 刷新挑战卷
|
|
if code = this.module.ModuleItems.RecoverTicket(session); code != pb.ErrorCode_Success {
|
|
return
|
|
}
|
|
list, _ := this.module.modelViking.getVikingList(session.GetUserId())
|
|
|
|
if session.GetUserId() != "" { // 恢复时间
|
|
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
|
|
list.RecoveryTime = userexpand.Recovertimeunifiedticket
|
|
}
|
|
}
|
|
session.SendMsg(string(this.module.GetType()), VikingGetListResp, &pb.VikingGetListResp{Data: list})
|
|
return
|
|
}
|