Documentation ¶
Index ¶
- Constants
- func Fail(c *gin.Context)
- func FailWithCode(c *gin.Context, code int)
- func FailWithCodeData(c *gin.Context, code int, data interface{})
- func FailWithCodeMsg(c *gin.Context, code int, msg string)
- func FailWithError(c *gin.Context, err error)
- func FailWithMsg(c *gin.Context, msg string)
- func GetBody(c *gin.Context) []byte
- func GetDataScope(c *gin.Context) string
- func GetIntUserID(c *gin.Context) int
- func GetRoleID(c *gin.Context) int
- func GetRoleKey(c *gin.Context) string
- func GetRoleName(c *gin.Context) string
- func GetToken(c *gin.Context) string
- func GetUintUserID(c *gin.Context) uint
- func GetUserID(c *gin.Context) string
- func GetUserName(c *gin.Context) string
- func JSON(c *gin.Context, status int, data interface{})
- func OK(c *gin.Context)
- func OkWithData(c *gin.Context, data interface{})
- func OkWithDataMsg(c *gin.Context, data interface{}, msg string)
- func ParseForm(c *gin.Context, obj interface{}) error
- func ParseJSON(c *gin.Context, obj interface{}) error
- func ParseQuery(c *gin.Context, obj interface{}) error
- func Result(c *gin.Context, code int, msg string, data interface{})
- func ResultWithCode(c *gin.Context, code int)
- func ResultWithCodeData(c *gin.Context, code int, data interface{})
- func SetDataScope(c *gin.Context, dataScope string)
- func SetRoleID(c *gin.Context, id int)
- func SetRoleKey(c *gin.Context, key string)
- func SetRoleName(c *gin.Context, roleName string)
- func SetUserID(c *gin.Context, userID string)
- func SetUserName(c *gin.Context, userName string)
- func Success(c *gin.Context, data interface{})
- type Response
Constants ¶
View Source
const ( UserIDKey = prefix + "/user-id" UserNameKey = prefix + "/user-name" RoleIDKey = prefix + "/role-id" RoleKey = prefix + "/role-key" RoleNameKey = prefix + "/role-name" DataScopeKey = prefix + "/data-scope" ReqBodyKey = prefix + "/req-body" ResBodyKey = prefix + "/res-body" LoggerReqBodyKey = prefix + "/logger-req-body" )
定义上下文中的键
View Source
const ( SuccessStatus = 200 FailStatus = -1 )
Variables ¶
This section is empty.
Functions ¶
func FailWithCodeData ¶
FailWithCodeData FailWithCodeData
func FailWithCodeMsg ¶
FailWithCodeMsg FailWithCodeMsg
func OkWithDataMsg ¶
OkWithDataMsg OkWithDataMsg
func ResultWithCodeData ¶
ResultWithCodeData ResultWithCodeData
Types ¶
Click to show internal directories.
Click to hide internal directories.