MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / GetUserTask

Function GetUserTask

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

Source from the content-addressed store, hash-verified

249}
250
251func GetUserTask(c *gin.Context) {
252 pageInfo := common.GetPageQuery(c)
253
254 userId := c.GetInt("id")
255
256 startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64)
257 endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64)
258
259 queryParams := model.SyncTaskQueryParams{
260 Platform: constant.TaskPlatform(c.Query("platform")),
261 TaskID: c.Query("task_id"),
262 Status: c.Query("status"),
263 Action: c.Query("action"),
264 StartTimestamp: startTimestamp,
265 EndTimestamp: endTimestamp,
266 }
267
268 items := model.TaskGetAllUserTask(userId, pageInfo.GetStartIdx(), pageInfo.GetPageSize(), queryParams)
269 total := model.TaskCountAllUserTask(userId, queryParams)
270 pageInfo.SetTotal(int(total))
271 pageInfo.SetItems(items)
272 common.ApiSuccess(c, pageInfo)
273}

Callers

nothing calls this directly

Calls 9

GetPageQueryFunction · 0.92
TaskPlatformTypeAlias · 0.92
TaskGetAllUserTaskFunction · 0.92
TaskCountAllUserTaskFunction · 0.92
ApiSuccessFunction · 0.92
GetStartIdxMethod · 0.80
GetPageSizeMethod · 0.80
SetTotalMethod · 0.80
SetItemsMethod · 0.80

Tested by

no test coverage detected