Documentation ¶
Index ¶
- Constants
- Variables
- func GetBase(c *gin.Context)
- func NewResponse(data interface{}, options ...interface{}) interface{}
- func PostChangePassword(c *gin.Context)
- func PostCurrentUser(c *gin.Context)
- func PostGetSignURL(c *gin.Context)
- func PostImageAuth(c *gin.Context)
- func PostUploadImage(c *gin.Context)
- func PostUserLogin(c *gin.Context)
- func PostUserLogout(c *gin.Context)
- func PostUserName(c *gin.Context)
- func PostUserSignIn(c *gin.Context)
- type BaseController
- type CheckController
- type ImageAuthRequest
- type PostChangePasswordRequest
- type PostGetSignURLRequest
- type PostGetSignURLResponse
- type PostUserLoginRequest
- type PostUserLoginResponse
- type PostUserSignInRequest
- type PostUsernameRequest
- type Response
- type UploadController
- type UserController
Constants ¶
View Source
const ( SUCCESS_CODE = 0 PARAM_ERROR_CODE = 1000 SERVER_ERROR_CODE = 1001 AUTH_FAILED_CODE = 2001 NOT_AUTH_CODE = 2002 USERNAME_EXIST_CODE = 2003 USERNAME_NOT_EXIST_CODE = 2004 KICKED_CODE = 2005 IMAGE_AUTH_CODE = 3001 )
Variables ¶
View Source
var ( CodeMap = map[int]string{ SUCCESS_CODE: "success", PARAM_ERROR_CODE: "参数错误", SERVER_ERROR_CODE: "系统繁忙,请稍后再试", AUTH_FAILED_CODE: "登录失败", NOT_AUTH_CODE: "没有登录", USERNAME_EXIST_CODE: "用户名已经存在", USERNAME_NOT_EXIST_CODE: "用户名不存在", KICKED_CODE: "账户在另一个地方登录", } )
Functions ¶
func NewResponse ¶
func NewResponse(data interface{}, options ...interface{}) interface{}
func PostChangePassword ¶
func PostCurrentUser ¶
func PostGetSignURL ¶
func PostImageAuth ¶
func PostUploadImage ¶
func PostUserLogin ¶
func PostUserLogout ¶
func PostUserName ¶
func PostUserSignIn ¶
Types ¶
type BaseController ¶
func NewBaseController ¶
func NewBaseController() BaseController
func (BaseController) Name ¶
func (BaseController) Name() string
type CheckController ¶
type CheckController struct { PostImageAuth func(*gin.Context) `path:"/check/image-auth"` PostUserName func(*gin.Context) `path:"/check/username"` }
func NewCheckController ¶
func NewCheckController() CheckController
func (CheckController) Name ¶
func (CheckController) Name() string
type ImageAuthRequest ¶
type ImageAuthRequest struct {
Type int `form:"type" binding:"required"` //1:代表主界面
}
type PostGetSignURLRequest ¶
type PostGetSignURLRequest struct {
ObjectName string `form:"objectName"`
}
type PostGetSignURLResponse ¶
type PostGetSignURLResponse struct {
SignURL string `json:"signURL"`
}
type PostUserLoginRequest ¶
type PostUserLoginResponse ¶
type PostUserLoginResponse struct {
UserID int `json:"userID"`
}
type PostUserSignInRequest ¶
type PostUsernameRequest ¶
type PostUsernameRequest struct {
Username string `form:"username" binding:"required"`
}
type UploadController ¶
type UploadController struct { PostGetSignURL func(*gin.Context) `path:"/upload/sign-url"` PostUploadImage func(*gin.Context) `path:"/upload/image"` }
func NewUploadController ¶
func NewUploadController() UploadController
func (UploadController) Name ¶
func (UploadController) Name() string
type UserController ¶
type UserController struct { PostUserSignIn func(*gin.Context) `path:"/user/sign-in"` PostUserLogin func(*gin.Context) `path:"/user/login"` PostUserLogout func(*gin.Context) `path:"/user/logout"` PostCurrentUser func(*gin.Context) `path:"/user/current-user"` PostChangePassword func(*gin.Context) `path:"/user/change-password"` }
func NewUserController ¶
func NewUserController() UserController
func (UserController) Name ¶
func (UserController) Name() string
Click to show internal directories.
Click to hide internal directories.