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

Function GetAllTask

controller/task.go:417–426  ·  view source on GitHub ↗

* The task list handlers below deliberately do not call projectTaskArtifacts. Artifact projection is confined to the explicit endpoints above. */

(c *gin.Context)

Source from the content-addressed store, hash-verified

415*/
416
417func GetAllTask(c *gin.Context) {
418 pageInfo := common.GetPageQuery(c)
419 startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64)
420 endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64)
421 queryParams := model.SyncTaskQueryParams{Platform: constant.TaskPlatform(c.Query("platform")), TaskID: c.Query("task_id"), Status: c.Query("status"), Action: c.Query("action"), StartTimestamp: startTimestamp, EndTimestamp: endTimestamp, ChannelID: c.Query("channel_id")}
422 items := model.TaskGetAllTasks(pageInfo.GetStartIdx(), pageInfo.GetPageSize(), queryParams)
423 pageInfo.SetTotal(int(model.TaskCountAllTasks(queryParams)))
424 pageInfo.SetItems(tasksToDto(items, true, c.GetInt("role")))
425 common.ApiSuccess(c, pageInfo)
426}
427
428func GetUserTask(c *gin.Context) {
429 pageInfo := common.GetPageQuery(c)

Callers

nothing calls this directly

Calls 9

TaskPlatformTypeAlias · 0.92
TaskGetAllTasksFunction · 0.92
TaskCountAllTasksFunction · 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