Documentation ¶
Index ¶
- Variables
- func BadRequestException(ctx *gin.Context, message string)
- func ForbiddenException(ctx *gin.Context, message string)
- func InternalServerException(ctx *gin.Context, message string)
- func NotFoundException(ctx *gin.Context, message string)
- func ResponseJson(ctx *gin.Context, status int, errcode Code, message string, data interface{})
- func SuccessJson(ctx *gin.Context, message string, data interface{})
- func UnauthorizedException(ctx *gin.Context, message string)
- type Code
- type JsonResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var CodeMap = map[Code]string{ Success: "请求成功", Failed: "请求失败", UnAuthed: "用户未认证", AuthExpired: "会话过期,请重新登录", InternalErr: "服务器内部错误", RequestMethodErr: "请求方式错误", RequestParamErr: "请求参数错误", RequestFormErr: "请求表单错误", AccountInfoErr: "账号信息有误", }
Functions ¶
func BadRequestException ¶
BadRequestException 400错误
func ForbiddenException ¶
ForbiddenException 403错误
func InternalServerException ¶
InternalServerException 500错误
func NotFoundException ¶
NotFoundException 404错误
func ResponseJson ¶
ResponseJson 基础返回
func SuccessJson ¶ added in v1.0.3
SuccessJson 成功返回
func UnauthorizedException ¶
UnauthorizedException 401错误
Types ¶
Click to show internal directories.
Click to hide internal directories.