Documentation ¶
Index ¶
- func Abort403(c *gin.Context, msg ...string)
- func Abort404(c *gin.Context, msg ...string)
- func Abort500(c *gin.Context, msg ...string)
- func BadRequest(c *gin.Context, err error, msg ...string)
- func Created(c *gin.Context, data interface{})
- func CreatedJSON(c *gin.Context, data interface{})
- func Data(c *gin.Context, data interface{})
- func Error(c *gin.Context, err error, msg ...string)
- func JSON(c *gin.Context, data interface{})
- func Success(c *gin.Context)
- func Unauthorized(c *gin.Context, msg ...string)
- func ValidationError(c *gin.Context, errors map[string][]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest 响应 400,传参 err 对象,未传参 msg 时使用默认消息 在解析用户请求,请求的格式或者方法不符合预期时调用
func Unauthorized ¶
Unauthorized 响应 401,未传参 msg 时使用默认消息 登录失败、jwt 解析失败时调用
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.