(c *gin.Context)
| 426 | } |
| 427 | |
| 428 | func GetUserTask(c *gin.Context) { |
| 429 | pageInfo := common.GetPageQuery(c) |
| 430 | userID := c.GetInt("id") |
| 431 | startTimestamp, _ := strconv.ParseInt(c.Query("start_timestamp"), 10, 64) |
| 432 | endTimestamp, _ := strconv.ParseInt(c.Query("end_timestamp"), 10, 64) |
| 433 | 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} |
| 434 | items := model.TaskGetAllUserTask(userID, pageInfo.GetStartIdx(), pageInfo.GetPageSize(), queryParams) |
| 435 | pageInfo.SetTotal(int(model.TaskCountAllUserTask(userID, queryParams))) |
| 436 | pageInfo.SetItems(tasksToDto(items, false, common.RoleCommonUser)) |
| 437 | common.ApiSuccess(c, pageInfo) |
| 438 | } |
| 439 | |
| 440 | func tasksToDto(tasks []*model.Task, fillUser bool, viewerRole int) []*dto.TaskDto { |
| 441 | var userIDMap map[int]*model.UserBase |
nothing calls this directly
no test coverage detected