feat: 任务增加进度接口
This commit is contained in:
@@ -59,6 +59,9 @@ public class Task extends SimpleEntity {
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Comment("任务状态")
|
||||
private Status status = Status.RUNNING;
|
||||
@Column(nullable = false)
|
||||
@Comment("任务进度")
|
||||
private Integer step = 0;
|
||||
@Comment("任务开始时间")
|
||||
private LocalDateTime launchedTime;
|
||||
@Comment("任务结束时间")
|
||||
|
||||
@@ -15,4 +15,8 @@ public interface TaskRepository extends SimpleRepository<Task> {
|
||||
@Modifying
|
||||
@Query("update Task task set task.status = com.lanyuanxiaoyao.leopard.core.entity.Task.Status.FAILURE where task.status = com.lanyuanxiaoyao.leopard.core.entity.Task.Status.RUNNING")
|
||||
void updateAllRunningTaskToFailure();
|
||||
|
||||
@Modifying
|
||||
@Query("update Task task set task.step = ?1 where task.id = ?2")
|
||||
void updateStepById(Integer step, Long id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user