爬塔奖励领取

This commit is contained in:
meixiongfeng 2023-11-28 17:26:36 +08:00
parent 8e44899d3c
commit bb24e0943b

View File

@ -3,6 +3,7 @@ package pagoda
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
)
//参数校验
@ -20,13 +21,23 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewar
var (
atno []*pb.UserAtno
pagoda *pb.DBPagoda
err error
_cfg *cfg.GamePagodaTaskRewardData
)
if errdata = this.GetRewardCheck(session, req); errdata != nil {
return // 参数校验失败直接返回
}
if pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId()); err != nil {
_cfg, err := this.module.configure.GetPagodaRewardconfig(req.Id)
if pagoda, err = this.module.modelPagoda.getPagodaList(session.GetUserId()); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
return
}
_cfg, err = this.module.configure.GetPagodaRewardconfig(req.Id)
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
@ -70,6 +81,6 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewar
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), comm.GMResAddType, "PagodaGetRewardReq", atno)
})
}
return
}