(c *gin.Context)
| 114 | } |
| 115 | |
| 116 | func GetSystemTask(c *gin.Context) { |
| 117 | taskID := c.Param("task_id") |
| 118 | if taskID == "" { |
| 119 | c.JSON(http.StatusOK, gin.H{ |
| 120 | "success": false, |
| 121 | "message": "task id is required", |
| 122 | }) |
| 123 | return |
| 124 | } |
| 125 | |
| 126 | task, err := model.GetSystemTaskByTaskID(taskID) |
| 127 | if err != nil { |
| 128 | common.ApiError(c, err) |
| 129 | return |
| 130 | } |
| 131 | if task == nil { |
| 132 | c.JSON(http.StatusNotFound, gin.H{ |
| 133 | "success": false, |
| 134 | "message": "task not found", |
| 135 | }) |
| 136 | return |
| 137 | } |
| 138 | |
| 139 | c.JSON(http.StatusOK, gin.H{ |
| 140 | "success": true, |
| 141 | "message": "", |
| 142 | "data": task.ToResponse(), |
| 143 | }) |
| 144 | } |
nothing calls this directly
no test coverage detected