(c *gin.Context)
| 87 | } |
| 88 | |
| 89 | func GetSystemTask(c *gin.Context) { |
| 90 | taskID := c.Param("task_id") |
| 91 | if taskID == "" { |
| 92 | c.JSON(http.StatusOK, gin.H{ |
| 93 | "success": false, |
| 94 | "message": "task id is required", |
| 95 | }) |
| 96 | return |
| 97 | } |
| 98 | |
| 99 | task, err := model.GetSystemTaskByTaskID(taskID) |
| 100 | if err != nil { |
| 101 | common.ApiError(c, err) |
| 102 | return |
| 103 | } |
| 104 | if task == nil { |
| 105 | c.JSON(http.StatusNotFound, gin.H{ |
| 106 | "success": false, |
| 107 | "message": "task not found", |
| 108 | }) |
| 109 | return |
| 110 | } |
| 111 | |
| 112 | c.JSON(http.StatusOK, gin.H{ |
| 113 | "success": true, |
| 114 | "message": "", |
| 115 | "data": task.ToResponse(), |
| 116 | }) |
| 117 | } |
nothing calls this directly
no test coverage detected