# Packages
No description provided by the author
# Functions
*
* NewContext 请求上下文封装, 实现了日志链路追踪、参数解析、参数校验
*
* Example:
*
* import (
* _ "github.com/scrawld/library/ginx"
* ginxMiddleware "gva_server/library/ginx/middleware"
* )
*
* router := gin.Default()
* router.Use(ginxMiddleware.RequestId()).Use(ginxMiddleware.Logger())
*
* type UserIndexReq struct {
* UserId int `json:"userId" binding:"required"`
* UserName string `json:"userName" binding:"trimspace,required"` // trimspace tag 需要写在最前面,先去两端空格再验证必填
* }
*
* func (this *UserController) Index(c *gin.Context) {
* p := &UserIndexReq{}
* ctx, ok := ginx.NewContext(c, ginx.UserTypeAny, p)
* if !ok {
* return
* }
* r := UserIndexResp{}
*
* c.Log.Infof("userId %s", p.UserId)
* c.Log.Errorf("userId %s", p.UserId)
*
* // ..
ValidateCustomTimeType 将自定义Time转成time.Time进行校验.
ValidateDecimalType 将Decimal转成float64进行校验.
ValidateTrimSpace 去除string两端空格.
# Constants
授权过期.
无权限.
不允许使用.
内容不存在.
No description provided by the author
参数验证错误.
请求体过大.
稍后重试.
服务器内部错误.
不支持的媒体类型.
允许全部用户访问.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author