32 lines
859 B
Go
32 lines
859 B
Go
package validator
|
|
|
|
import "lone-services/pkg/validate"
|
|
|
|
// CartEditValidator 查看列表
|
|
type CartEditValidator struct {
|
|
Info string `validate:"required"`
|
|
Type int32 `validate:"required,oneof=1 2 3"` //类型 1门店 , 2销售,3为用户
|
|
}
|
|
|
|
// GetMessage 查看列表 - 提示消息
|
|
func (p CartEditValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Info.required": "类型不能为空",
|
|
"Type.required": "类型不能为空",
|
|
"Type.oneof": "类型不对",
|
|
}
|
|
}
|
|
|
|
type CartValidator struct {
|
|
Type int32 `validate:"required,oneof=1 2 3"` //类型 1门店 , 2销售,3为用户
|
|
|
|
}
|
|
|
|
// GetMessage 查看列表 - 提示消息
|
|
func (p CartValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Type.required": "类型不能为空",
|
|
"Type.oneof": "类型不对",
|
|
}
|
|
}
|