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

Function ListSystemTasks

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

Source from the content-addressed store, hash-verified

66}
67
68func ListSystemTasks(c *gin.Context) {
69 limit, _ := strconv.Atoi(c.Query("limit"))
70
71 tasks, err := model.ListSystemTasks(limit)
72 if err != nil {
73 common.ApiError(c, err)
74 return
75 }
76
77 responses := make([]model.SystemTaskResponse, 0, len(tasks))
78 for _, task := range tasks {
79 responses = append(responses, task.ToResponse())
80 }
81
82 c.JSON(http.StatusOK, gin.H{
83 "success": true,
84 "message": "",
85 "data": responses,
86 })
87}
88
89func GetSystemTask(c *gin.Context) {
90 taskID := c.Param("task_id")

Callers

nothing calls this directly

Calls 4

ListSystemTasksFunction · 0.92
ApiErrorFunction · 0.92
QueryMethod · 0.80
ToResponseMethod · 0.45

Tested by

no test coverage detected