Documentation ¶
Overview ¶
*
- @Time : 2020-04-30 16:30
- @Author : MassAdobe
- @Description: system
*
*
- @Time : 2020-04-26 19:57
- @Author : MassAdobe
- @Description: system
*
*
- @Time : 2020-04-30 11:36
- @Author : MassAdobe
- @Description: system
*
Index ¶
- func BindAndCheck(c *gin.Context, data interface{})
- func CheckParams(data interface{})
- func FailRes(c *gin.Context, errCode int, data interface{})
- func InitValidator()
- func SuccRes(c *gin.Context, data interface{})
- func SuccResFeign(c *gin.Context, data interface{})
- type CanCheck
- type Response
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckParams ¶
func CheckParams(data interface{})
*
- @Author: MassAdobe
- @TIME: 2020-06-01 17:29
- @Description: 检查参数,一般get请求使用
*
func InitValidator ¶
func InitValidator()
*
- @Author: MassAdobe
- @TIME: 2020-04-30 15:46
- @Description: 初始化验证器
*
func SuccResFeign ¶
*
- @Author: MassAdobe
- @TIME: 2020/12/18 6:19 下午
- @Description: 内部调用 成功时返回 支持data为空
*
Types ¶
type CanCheck ¶
type CanCheck interface {
Check() error
}
*
- @Author: MassAdobe
- @TIME: 2020-04-30 15:51
- @Description: 如果需要特殊校验,可以实现验证接口,或者通过自定义tag标签实现
*
type Response ¶
type Response struct { Code int `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
*
- @Author: MassAdobe
- @TIME: 2020-04-26 21:12
- @Description: 通用返回结构体封账
*
type Validator ¶
type Validator struct { Validate *validator.Validate Trans ut.Translator }
*
- @Author: MassAdobe
- @TIME: 2020-04-30 15:45
- @Description: 自定义验证器
*
Click to show internal directories.
Click to hide internal directories.