Documentation ¶
Index ¶
Constants ¶
View Source
const ( // code= 100x... 用户模块的错误 ERROR_USERNAME_USED = 1001 ERROR_PASSWORD_WRONG = 1002 ERROR_ABNORMAL_PERMISSIONS = 1003 // code= 200x... token 相关错误 ERROR_TOKEN_NOT_EXIST = 2001 ERROR_TOKEN_WRONG = 2002 ERROR_TOKEN_EXPIRE = 2003 // code= 300x... 参数验证错误 ERROR_PARAMETER_VALIDATION = 3001 )
View Source
const ( ERROR = 500 SUCCESS = 200 )
Variables ¶
This section is empty.
Functions ¶
func OkWithData ¶
func ValidateBind ¶ added in v1.0.4
bind请求体并进行参数验证
Types ¶
type BusinessError ¶
type BusinessError struct {
Code int
}
func (BusinessError) Error ¶
func (e BusinessError) Error() string
type HTTPError ¶
type HTTPError struct { Code int `json:"code" example:"500"` Msg string `json:"msg" example:"操作失败"` }
HTTPError example
Click to show internal directories.
Click to hide internal directories.