(c *gin.Context)
| 10 | ) |
| 11 | |
| 12 | func GetAllTokens(c *gin.Context) { |
| 13 | userId := c.GetInt("id") |
| 14 | pageInfo := common.GetPageQuery(c) |
| 15 | tokens, err := model.GetAllUserTokens(userId, pageInfo.GetStartIdx(), pageInfo.GetPageSize()) |
| 16 | if err != nil { |
| 17 | common.ApiError(c, err) |
| 18 | return |
| 19 | } |
| 20 | total, _ := model.CountUserTokens(userId) |
| 21 | pageInfo.SetTotal(int(total)) |
| 22 | pageInfo.SetItems(tokens) |
| 23 | common.ApiSuccess(c, pageInfo) |
| 24 | return |
| 25 | } |
| 26 | |
| 27 | func SearchTokens(c *gin.Context) { |
| 28 | userId := c.GetInt("id") |
nothing calls this directly
no test coverage detected