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

Function GetToken

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

Source from the content-addressed store, hash-verified

42}
43
44func GetToken(c *gin.Context) {
45 id, err := strconv.Atoi(c.Param("id"))
46 userId := c.GetInt("id")
47 if err != nil {
48 common.ApiError(c, err)
49 return
50 }
51 token, err := model.GetTokenByIds(id, userId)
52 if err != nil {
53 common.ApiError(c, err)
54 return
55 }
56 c.JSON(http.StatusOK, gin.H{
57 "success": true,
58 "message": "",
59 "data": token,
60 })
61 return
62}
63
64func GetTokenStatus(c *gin.Context) {
65 tokenId := c.GetInt("token_id")

Callers

nothing calls this directly

Calls 2

ApiErrorFunction · 0.92
GetTokenByIdsFunction · 0.92

Tested by

no test coverage detected