53 lines
845 B
Go
53 lines
845 B
Go
package web
|
|
|
|
import (
|
|
"gitea.party/public-messag-service/common/request"
|
|
"github.com/gin-gonic/gin/binding"
|
|
)
|
|
|
|
func init() {
|
|
request.Validate = binding.Validator.ValidateStruct
|
|
}
|
|
|
|
var (
|
|
BindForm = _FormBind{}
|
|
BindMultipartForm = _FormMultipartBind{}
|
|
BindQuery = _QueryBind{}
|
|
BindHead = _HeadHead{}
|
|
)
|
|
|
|
/**
|
|
**************************************************/
|
|
|
|
type _FormBind struct {
|
|
request.FormBind
|
|
}
|
|
|
|
func (_FormBind) Name() string {
|
|
return "custom_form"
|
|
}
|
|
|
|
type _QueryBind struct {
|
|
request.QueryBind
|
|
}
|
|
|
|
func (_QueryBind) Name() string {
|
|
return "custom_query"
|
|
}
|
|
|
|
type _FormMultipartBind struct {
|
|
request.FormMultipartBind
|
|
}
|
|
|
|
func (_FormMultipartBind) Name() string {
|
|
return "custom_form_multipart"
|
|
}
|
|
|
|
type _HeadHead struct {
|
|
request.HeaderBind
|
|
}
|
|
|
|
func (_HeadHead) Name() string {
|
|
return "custom_head"
|
|
}
|