Documentation
¶
Index ¶
- Constants
- func Bind(ctx *gin.Context, param iChecker) bool
- func BindForm(ctx *gin.Context, param iChecker) bool
- func BindQuery(ctx *gin.Context, param iChecker) bool
- func BindUri(ctx *gin.Context, param iChecker) bool
- func I18nCode(ctx *gin.Context, code err_code.Code, args ...string) string
- func I18nCodeOrKey(ctx *gin.Context, code err_code.Code, key string, args ...string) string
- func I18nKey(ctx *gin.Context, key string, args ...string) string
- func InitValidator() error
- func Response(ctx *gin.Context, data interface{}, err error)
- func ResponseDetail(ctx *gin.Context, httpStatus int, code codes.Code, data interface{}, ...)
- func ResponseErr(ctx *gin.Context, err error)
- func ResponseErrCodeKey(ctx *gin.Context, code err_code.Code, textKey string, args ...string)
- func ResponseErrCodeKeyWithStatus(ctx *gin.Context, httpStatus int, code err_code.Code, textKey string, ...)
- func ResponseErrWithStatus(ctx *gin.Context, httpStatus int, err error)
- func ResponseOK(ctx *gin.Context)
- func ResponseOKWithData(ctx *gin.Context, data interface{})
- func ResponseRawByte(ctx *gin.Context, httpStatus int, data []byte)
Constants ¶
View Source
const ( CLAIMS = "claims" STATUS = "STATUS" RESULT = "RESULT" // http header X_LANGUAGE = "X-Language" // 当前语言 X_ORG_ID = "X-Org-Id" // 当前组织 X_CLIENT_ID = "X-Client-Id" // gin.Context USER_ID = "USER_ID" // 当前用户 IS_ADMIN = "IS_ADMIN" // USER_ID是否当前组织X_ORG_ID的内置管理员角色 IS_SYSTEM = "IS_SYSTEM" // 当前组织X_ORG_ID是否是【系统】 // openapi相关 APP_ID = "APP_ID" APP_TYPE = "APP_TYPE" ANSWER = "ANSWER" // OAuth相关 OAUTH_SCOPE = "SCOPE" OAUTH_CLIENT_ID = "OAuth_Client_ID" )
gin.Contex key
View Source
const ( PageNo = "pageNo" PageSize = "pageSize" )
http common query key
Variables ¶
This section is empty.
Functions ¶
func I18nCodeOrKey ¶
func InitValidator ¶
func InitValidator() error
func ResponseDetail ¶
func ResponseDetail(ctx *gin.Context, httpStatus int, code codes.Code, data interface{}, msg string)
ResponseDetail 直接返回httpStatus/code/data/msg,msg无i18n
func ResponseErr ¶
ResponseDetail 返回400与err信息,err有i18n
func ResponseErrCodeKey ¶
ResponseErrCodeKey 返回400/code与错误信息,code/key有i18n
func ResponseErrCodeKeyWithStatus ¶
func ResponseErrCodeKeyWithStatus(ctx *gin.Context, httpStatus int, code err_code.Code, textKey string, args ...string)
ResponseErrCodeKey 返回httpStatus/code与错误信息,code/key有i18n
func ResponseErrWithStatus ¶
ResponseDetail 返回httpStatus与err信息,err有i18n
func ResponseOKWithData ¶
ResponseOKWithData 返回200与data信息
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.