MCPcopy Create free account
hub / github.com/QuantumNous/new-api / GetSystemTask

Function GetSystemTask

controller/system_task.go:89–117  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

87}
88
89func 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}

Callers

nothing calls this directly

Calls 3

GetSystemTaskByTaskIDFunction · 0.92
ApiErrorFunction · 0.92
ToResponseMethod · 0.45

Tested by

no test coverage detected