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

Function GetAllTokens

controller/token.go:12–25  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

10)
11
12func 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
27func SearchTokens(c *gin.Context) {
28 userId := c.GetInt("id")

Callers

nothing calls this directly

Calls 9

GetPageQueryFunction · 0.92
GetAllUserTokensFunction · 0.92
ApiErrorFunction · 0.92
CountUserTokensFunction · 0.92
ApiSuccessFunction · 0.92
GetStartIdxMethod · 0.80
GetPageSizeMethod · 0.80
SetTotalMethod · 0.80
SetItemsMethod · 0.80

Tested by

no test coverage detected