MCPcopy Create free account
hub / github.com/RaymondCode/simple-demo / UserInfo

Function UserInfo

controller/user.go:79–92  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

77}
78
79func UserInfo(c *gin.Context) {
80 token := c.Query("token")
81
82 if user, exist := usersLoginInfo[token]; exist {
83 c.JSON(http.StatusOK, UserResponse{
84 Response: Response{StatusCode: 0},
85 User: user,
86 })
87 } else {
88 c.JSON(http.StatusOK, UserResponse{
89 Response: Response{StatusCode: 1, StatusMsg: "User doesn't exist"},
90 })
91 }
92}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected