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

Function GetAllTask

controller/task.go:16–37  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

14)
15
16func GetAllTask(c *gin.Context) {
17 pageInfo := common.GetPageQuery(c)
18
19 startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64)
20 endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64)
21 // 解析其他查询参数
22 queryParams := model.SyncTaskQueryParams{
23 Platform: constant.TaskPlatform(c.Query("platform")),
24 TaskID: c.Query("task_id"),
25 Status: c.Query("status"),
26 Action: c.Query("action"),
27 StartTimestamp: startTimestamp,
28 EndTimestamp: endTimestamp,
29 ChannelID: c.Query("channel_id"),
30 }
31
32 items := model.TaskGetAllTasks(pageInfo.GetStartIdx(), pageInfo.GetPageSize(), queryParams)
33 total := model.TaskCountAllTasks(queryParams)
34 pageInfo.SetTotal(int(total))
35 pageInfo.SetItems(tasksToDto(items, true))
36 common.ApiSuccess(c, pageInfo)
37}
38
39func GetUserTask(c *gin.Context) {
40 pageInfo := common.GetPageQuery(c)

Callers

nothing calls this directly

Calls 11

GetPageQueryFunction · 0.92
TaskPlatformTypeAlias · 0.92
TaskGetAllTasksFunction · 0.92
TaskCountAllTasksFunction · 0.92
ApiSuccessFunction · 0.92
tasksToDtoFunction · 0.85
QueryMethod · 0.80
GetStartIdxMethod · 0.80
GetPageSizeMethod · 0.80
SetTotalMethod · 0.80
SetItemsMethod · 0.80

Tested by

no test coverage detected