Documentation ¶
Index ¶
Constants ¶
View Source
const ( Ok = 200 NotOk = 405 Forbidden = 403 InternalServerError = 500 )
自定义错误码
View Source
const ( OkMsg = "操作成功" NotOkMsg = "操作失败" LoginCheckErrorMsg = "用户名或密码错误" ForbiddenMsg = "无权访问该资源" InternalServerErrorMsg = "服务器内部错误" IdempotenceTokenEmptyMsg = "幂等性token为空" IdempotenceTokenInvalidMsg = "幂等性token失效" )
自定义错误信息
Variables ¶
View Source
var CustomError = map[int]string{ Ok: OkMsg, NotOk: NotOkMsg, Unauthorized: UnauthorizedMsg, Forbidden: ForbiddenMsg, InternalServerError: InternalServerErrorMsg, }
自定义错误映射
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.