diff --git a/cmd/robot/hero.go b/cmd/robot/hero.go index b841760ba..243dea09a 100644 --- a/cmd/robot/hero.go +++ b/cmd/robot/hero.go @@ -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{}, diff --git a/modules/task/model_task.go b/modules/task/model_task.go index c2f3f96ff..f21dd0367 100644 --- a/modules/task/model_task.go +++ b/modules/task/model_task.go @@ -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