 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- func BindAndCheck(ctx *gin.Context, data interface{}) bool
- func BindAndCheckReturnErr(ctx *gin.Context, data interface{}) (errFields []*validator.FormErrorField)
- func GetEnableShortID(ctx context.Context) bool
- func GetLang(ctx *gin.Context) i18n.Language
- func GetLangByCtx(ctx context.Context) i18n.Language
- func HandleResponse(ctx *gin.Context, err error, data interface{})
- type RespBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindAndCheck ¶
BindAndCheck bind request and check
func BindAndCheckReturnErr ¶
func BindAndCheckReturnErr(ctx *gin.Context, data interface{}) (errFields []*validator.FormErrorField)
BindAndCheckReturnErr bind request and check
func GetEnableShortID ¶
GetEnableShortID get language from header
func GetLangByCtx ¶
GetLangByCtx get language from header
func HandleResponse ¶
HandleResponse Handle response body
Types ¶
type RespBody ¶
type RespBody struct {
	// http code
	Code int `json:"code"`
	// reason key
	Reason string `json:"reason"`
	// response message
	Message string `json:"msg"`
	// response data
	Data interface{} `json:"data"`
}
    RespBody response body.
func NewRespBody ¶
NewRespBody new response body
func NewRespBodyData ¶
NewRespBodyData new response body with data
func NewRespBodyFromError ¶
NewRespBodyFromError new response body from error
 Click to show internal directories. 
   Click to hide internal directories.