更新任务进度
This commit is contained in:
parent
7a6a06614f
commit
ce60c619a8
@ -24,7 +24,7 @@ var (
|
||||
fmt.Printf("%d- %v\n", (i + 1), v)
|
||||
}
|
||||
},
|
||||
// enabled: true,
|
||||
enabled: true,
|
||||
next: func(robot *Robot, rsp proto.Message) {
|
||||
tcs := []*TestCase{}
|
||||
if _, ok := rsp.(*pb.HeroListResp); ok {
|
||||
@ -33,9 +33,9 @@ var (
|
||||
mainType: string(comm.ModuleHero),
|
||||
subType: hero.StrengthenUplv,
|
||||
req: &pb.HeroStrengthenUplvReq{
|
||||
HeroObjID: "62dab21d9efd6536b1cc1bb5",
|
||||
HeroObjID: "62dabaacd8c5789e2cc8b95e",
|
||||
ExpCards: map[string]int32{
|
||||
"62dab23b9efd6536b1cc1c2a": 1,
|
||||
"62dabac1d8c5789e2cc8b9d3": 1,
|
||||
},
|
||||
},
|
||||
rsp: &pb.HeroStrengthenUplvResp{},
|
||||
|
@ -211,6 +211,20 @@ func (this *ModelTask) UpHeroLevel(uid string, taskId int32, tp *pb.TaskParam) *
|
||||
task.Progress = progress
|
||||
task.Status = 1
|
||||
return task
|
||||
} else {
|
||||
progress = task.Progress - tp.Second
|
||||
if progress <= 0 {
|
||||
progress = 0
|
||||
}
|
||||
update := map[string]interface{}{
|
||||
"progress": progress,
|
||||
}
|
||||
if err := this.modifyUserTask(task.Uid, task.Id, update); err != nil {
|
||||
log.Errorf("err %v", err)
|
||||
return nil
|
||||
}
|
||||
task.Progress = progress
|
||||
return task
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user