(c *gin.Context)
| 35 | } |
| 36 | |
| 37 | func GetCurrentSystemTask(c *gin.Context) { |
| 38 | taskType := c.Query("type") |
| 39 | if taskType == "" { |
| 40 | c.JSON(http.StatusOK, gin.H{ |
| 41 | "success": false, |
| 42 | "message": "type is required", |
| 43 | }) |
| 44 | return |
| 45 | } |
| 46 | |
| 47 | task, err := model.GetActiveSystemTask(taskType) |
| 48 | if err != nil { |
| 49 | common.ApiError(c, err) |
| 50 | return |
| 51 | } |
| 52 | if task == nil { |
| 53 | c.JSON(http.StatusOK, gin.H{ |
| 54 | "success": true, |
| 55 | "message": "", |
| 56 | "data": nil, |
| 57 | }) |
| 58 | return |
| 59 | } |
| 60 | |
| 61 | c.JSON(http.StatusOK, gin.H{ |
| 62 | "success": true, |
| 63 | "message": "", |
| 64 | "data": task.ToResponse(), |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | func ListSystemTasks(c *gin.Context) { |
| 69 | limit, _ := strconv.Atoi(c.Query("limit")) |
nothing calls this directly
no test coverage detected