26 lines
811 B
Go
26 lines
811 B
Go
package validator
|
|
|
|
import "lone-services/pkg/validate"
|
|
|
|
type CallValidator struct {
|
|
Action string `validate:"required,max=128"`
|
|
Version string `validate:"required,max=32"`
|
|
Request string `validate:"max=1024"`
|
|
A string `validate:"required,max=128"`
|
|
S string `validate:"required,max=128"`
|
|
}
|
|
|
|
func (p CallValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Action.required": "action不能为空",
|
|
"Action.max": "action过长",
|
|
"Version.required": "version不能为空",
|
|
"Version.max": "version过长",
|
|
"Request.max": "request过长",
|
|
"A.required": "accessKeyId不能为空",
|
|
"A.max": "accessKeyId过长",
|
|
"S.required": "accessKeySecret不能为空",
|
|
"S.max": "accessKeySecret过长",
|
|
}
|
|
}
|