(c *gin.Context)
| 58 | } |
| 59 | |
| 60 | func Login(c *gin.Context) { |
| 61 | username := c.Query("username") |
| 62 | password := c.Query("password") |
| 63 | |
| 64 | token := username + password |
| 65 | |
| 66 | if user, exist := usersLoginInfo[token]; exist { |
| 67 | c.JSON(http.StatusOK, UserLoginResponse{ |
| 68 | Response: Response{StatusCode: 0}, |
| 69 | UserId: user.Id, |
| 70 | Token: token, |
| 71 | }) |
| 72 | } else { |
| 73 | c.JSON(http.StatusOK, UserLoginResponse{ |
| 74 | Response: Response{StatusCode: 1, StatusMsg: "User doesn't exist"}, |
| 75 | }) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func UserInfo(c *gin.Context) { |
| 80 | token := c.Query("token") |
nothing calls this directly
no outgoing calls
no test coverage detected