feat: add task cancell

This commit is contained in:
engigu
2026-02-10 16:47:18 +08:00
parent ea4f7be11e
commit aef124defc
10 changed files with 335 additions and 111 deletions
+16
View File
@@ -236,3 +236,19 @@ func (tc *TaskController) DeleteTask(c *gin.Context) {
utils.SuccessMsg(c, "删除成功")
}
func (tc *TaskController) StopTask(c *gin.Context) {
logID, err := strconv.ParseUint(c.Param("logID"), 10, 32)
if err != nil {
utils.BadRequest(c, "无效的日志ID")
return
}
err = tc.executorService.StopTaskExecution(uint(logID))
if err != nil {
utils.BadRequest(c, err.Error())
return
}
utils.SuccessMsg(c, "停止请求已发送")
}