(c *gin.Context)
| 14 | ) |
| 15 | |
| 16 | func 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 | |
| 39 | func GetUserTask(c *gin.Context) { |
| 40 | pageInfo := common.GetPageQuery(c) |
nothing calls this directly
no test coverage detected