store
This commit is contained in:
@@ -206,3 +206,40 @@ func (p NamesByIdsValidator) GetMessage() validate.ValidatorMessages {
|
||||
"Ids.gt": "id必须大于0",
|
||||
}
|
||||
}
|
||||
|
||||
type ApiSalesCreateValidator struct {
|
||||
Mobile string `form:"mobile" json:"mobile" validate:"required"`
|
||||
Name string `form:"name" json:"name" validate:"required"`
|
||||
District string `form:"district" json:"district" validate:"required"`
|
||||
Address string `form:"address" json:"address" validate:"required"`
|
||||
Account string `form:"account" json:"account"`
|
||||
Credentials string `form:"credentials" json:"credentials" validate:"required"`
|
||||
Sex int32 `form:"sex" json:"sex" validate:"oneof=1 2 3"`
|
||||
BirthDate string `form:"birth_date" json:"birth_date"`
|
||||
Type int32 `form:"type" json:"type" validate:"oneof=3 4"`
|
||||
}
|
||||
|
||||
// GetMessage 提示消息
|
||||
func (p ApiSalesCreateValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
validate.FieldTypeIn: validate.FieldTypeInValue,
|
||||
"Name.required": "名称不能为空",
|
||||
"Mobile.required": "手机号不能为空",
|
||||
"District.required": "地址不能为空",
|
||||
"Address.required": "详细地址不能为空",
|
||||
"Credentials.required": "证明材料不能为空",
|
||||
"Sex.oneof": "性别不对",
|
||||
}
|
||||
}
|
||||
|
||||
type ApiSalesItemsValidator struct {
|
||||
Name string `form:"name" json:"name"`
|
||||
Page int64 `form:"page" json:"page"`
|
||||
Size int64 `form:"size" json:"size"`
|
||||
Type int32 `form:"type" json:"type"`
|
||||
}
|
||||
|
||||
// GetMessage 提示消息
|
||||
func (p ApiSalesItemsValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user