feat: client items
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package validator
|
||||
|
||||
import "lone-services/pkg/validate"
|
||||
|
||||
type ClientValidator struct {
|
||||
Name string `validate:"omitempty,max=64"`
|
||||
Type string `validate:"omitempty,oneof=user sale store"`
|
||||
SubjectType uint32 `validate:"omitempty,oneof=1 2 3"`
|
||||
}
|
||||
|
||||
func (p ClientValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"Name.max": "名称过长",
|
||||
"Type.oneof": "类型不正确",
|
||||
"SubjectType.oneof": "主体类型不正确",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user