1
0

feat: 任务增加进度接口

This commit is contained in:
2025-09-08 21:26:39 +08:00
parent 30225afcba
commit 3114654280
7 changed files with 72 additions and 27 deletions

View File

@@ -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("任务结束时间")

View File

@@ -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);
}