Documentation ¶
Index ¶
- Constants
- func Bad(c *gin.Context, errCode int, errMsg string)
- func Error(c *gin.Context, httpCode int)
- func ErrorCode(c *gin.Context, httpCode int, errCode int)
- func ErrorMessage(c *gin.Context, httpCode int, dataCode int, msg string)
- func Exception(c *gin.Context, errCode int, errMessage string, msg string)
- func Fail(c *gin.Context)
- func FailCode(c *gin.Context, errCode int)
- func FailError(c *gin.Context, err *errors.Error)
- func FailMessage(c *gin.Context, errCode int, errMsg string)
- func Forbidden(c *gin.Context, msg string)
- func NotAllowed(c *gin.Context, msg string)
- func NotFound(c *gin.Context, msg string)
- func OK(c *gin.Context, data interface{}) *gin.Context
- func Page(context *gin.Context, total int64, list interface{})
- func Response(c *gin.Context, httpCode, errCode int, data interface{}) *gin.Context
- func ResponseWithJson(c *gin.Context, httpCode int, jsonStr string) *gin.Context
- func Success(c *gin.Context, data interface{})
- func SuccessWithHeader(c *gin.Context, data interface{}, headers map[string]string)
- func SystemError(c *gin.Context, err error)
- func SystemErrorCode(c *gin.Context, errCode int)
- func SystemErrorMessage(c *gin.Context, errCode int, msg string)
- func SystemFail(c *gin.Context, err error)
- func SystemFailError(c *gin.Context, e *errors.Error, err error)
- func Unauthorized(c *gin.Context, msg string)
- func Unprocessable(c *gin.Context, msg string)
- type Gin
Constants ¶
View Source
const ( //业务处理发生错误 BusinessOccurredErrorCode int = -4000000 BusinessOccurredErrorMsg string = "业务执行错误,请联系管理员处理" //服务器代码发生错误 ServerOccurredErrorCode int = -5000000 ServerOccurredErrorMsg string = "服务器内部发生代码执行错误,请联系开发者排查错误日志" )
Variables ¶
This section is empty.
Functions ¶
func NotAllowed ¶ added in v0.0.3
func ResponseWithJson ¶
将json字符窜以标准json格式返回(例如,从redis读取json、格式的字符串,返回给浏览器json格式)
func SuccessWithHeader ¶
func SystemErrorCode ¶
func SystemFail ¶ added in v0.0.3
func SystemFailError ¶ added in v0.0.3
func Unauthorized ¶
func Unprocessable ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.