growtask errdata
This commit is contained in:
parent
efab828c47
commit
015c649c04
@ -38,14 +38,20 @@ func (this *apiComp) Advreceive(session comm.IUserSession, req *pb.GrowtaskAdvRe
|
||||
|
||||
// 当前进阶奖励是否已领取
|
||||
if gt.AdvReceive == req.TaskType {
|
||||
code = pb.ErrorCode_GrowtaskAdvReceive
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_GrowtaskAdvReceive,
|
||||
Title: pb.ErrorCode_GrowtaskAdvReceive.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// 当前进阶任务是否都完成
|
||||
ok := this.module.modelGrowtask.isAllFinish(gt, req.TaskType)
|
||||
if !ok {
|
||||
code = pb.ErrorCode_GrowtaskAdvReceive
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_GrowtaskAdvReceive,
|
||||
Title: pb.ErrorCode_GrowtaskAdvReceive.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -86,7 +92,7 @@ func (this *apiComp) Advreceive(session comm.IUserSession, req *pb.GrowtaskAdvRe
|
||||
}
|
||||
|
||||
if conf, ok := rewardCnf.GetDataMap()[req.TaskType]; ok {
|
||||
if code := this.module.DispenseRes(session, conf.Allreward, true); errdata != nil {
|
||||
if errdata := this.module.DispenseRes(session, conf.Allreward, true); errdata != nil {
|
||||
this.module.Errorf("进阶奖励发放失败 taskType:%v uid:%v", req.TaskType, uid)
|
||||
}
|
||||
}
|
||||
@ -95,8 +101,6 @@ func (this *apiComp) Advreceive(session comm.IUserSession, req *pb.GrowtaskAdvRe
|
||||
TaskType: req.TaskType,
|
||||
}
|
||||
|
||||
if err := session.SendMsg(string(this.module.GetType()), GrowtaskSubTypeAdvreceive, rsp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), GrowtaskSubTypeAdvreceive, rsp)
|
||||
return
|
||||
}
|
||||
|
@ -26,7 +26,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.GrowtaskReceiveR
|
||||
|
||||
// 领取
|
||||
if err := this.module.modelGrowtask.receive(uid, req.TaskId); err != nil {
|
||||
code = pb.ErrorCode_GrowtaskReceive
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_GrowtaskReceive,
|
||||
Title: pb.ErrorCode_GrowtaskReceive.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -50,7 +53,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.GrowtaskReceiveR
|
||||
}
|
||||
|
||||
if conf, ok := ggt.GetDataMap()[req.TaskId]; ok {
|
||||
if code := this.module.DispenseRes(session, conf.Reward, true); errdata != nil {
|
||||
if errdata := this.module.DispenseRes(session, conf.Reward, true); errdata != nil {
|
||||
this.module.Errorf("子任务奖励发放失败 taskId:%v uid:%v", req.TaskId, uid)
|
||||
}
|
||||
}
|
||||
@ -59,8 +62,6 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.GrowtaskReceiveR
|
||||
TaskId: req.TaskId,
|
||||
}
|
||||
|
||||
if err := session.SendMsg(string(this.module.GetType()), GrowtaskSubTypeReceive, rsp); err != nil {
|
||||
code = pb.ErrorCode_SystemError
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), GrowtaskSubTypeReceive, rsp)
|
||||
return
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ func (this *ModelGrowtask) list(uid string, taskType int32, gt *pb.DBGrowtask) (
|
||||
}
|
||||
|
||||
//任务完成
|
||||
if code := this.moduleGrowtask.ModuleRtask.CheckCondi(uid, v.Fstask); code == pb.ErrorCode_Success {
|
||||
if code := this.moduleGrowtask.ModuleRtask.CheckCondi(uid, v.Fstask); code == nil {
|
||||
if v.PreTask == 0 {
|
||||
v.Status = pb.GrowtaskStatus_Wait //待领奖状态
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user