go_dreamfactory/modules/hunting/api_getlist.go

34 lines
1003 B
Go

package hunting
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.HuntingGetListReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) GetList(session comm.IUserSession, req *pb.HuntingGetListReq) (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.modelHunting.getHuntingList(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()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list})
return
}