feat: add system task runner (#5680)

This commit is contained in:
Calcium-Ion
2026-06-24 17:16:21 +08:00
committed by GitHub
parent acb52d0f78
commit 5377192293
39 changed files with 2575 additions and 596 deletions
+21
View File
@@ -65,6 +65,27 @@ func GetCurrentSystemTask(c *gin.Context) {
})
}
func ListSystemTasks(c *gin.Context) {
limit, _ := strconv.Atoi(c.Query("limit"))
tasks, err := model.ListSystemTasks(limit)
if err != nil {
common.ApiError(c, err)
return
}
responses := make([]model.SystemTaskResponse, 0, len(tasks))
for _, task := range tasks {
responses = append(responses, task.ToResponse())
}
c.JSON(http.StatusOK, gin.H{
"success": true,
"message": "",
"data": responses,
})
}
func GetSystemTask(c *gin.Context) {
taskID := c.Param("task_id")
if taskID == "" {