Documentation ¶
Index ¶
- Constants
- 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, msg string)
- func Fail(c *gin.Context, errCode int, errMsg string)
- func FailCode(c *gin.Context, errCode int)
- func FailMessage(c *gin.Context, errCode int, errMsg string)
- func NotFound(c *gin.Context, msg string)
- func OK(c *gin.Context, data interface{})
- func Page(context *gin.Context, total int64, list interface{})
- func Response(c *gin.Context, httpCode, errCode int, data interface{})
- func ResponseWithJson(c *gin.Context, httpCode int, jsonStr string)
- func Success(c *gin.Context, data interface{})
- func SuccessWithHeader(c *gin.Context, data interface{}, headers map[string]string)
- func SystemError(c *gin.Context)
- func SystemErrorCode(c *gin.Context, errCode int)
- func SystemErrorMessage(c *gin.Context, msg string)
- func Unauthorized(c *gin.Context, msg string)
- type Gin
Constants ¶
View Source
const ( //服务器代码发生错误 ServerOccurredErrorCode int = -500100 ServerOccurredErrorMsg string = "服务器内部发生代码执行错误,请联系开发者排查错误日志" )
Variables ¶
This section is empty.
Functions ¶
func ResponseWithJson ¶
将json字符窜以标准json格式返回(例如,从redis读取json、格式的字符串,返回给浏览器json格式)
func SuccessWithHeader ¶
func SystemErrorCode ¶
func SystemErrorMessage ¶
func Unauthorized ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.