feat: product items info
This commit is contained in:
@@ -64,6 +64,27 @@ func (p ProductInfoValidator) GetMessage() validate.ValidatorMessages {
|
||||
}
|
||||
}
|
||||
|
||||
type ApiProductInfoValidator struct {
|
||||
Id int64 `validate:"required,gt=0"`
|
||||
}
|
||||
|
||||
func (p ApiProductInfoValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"Id.required": "ID不能为空",
|
||||
"Id.gt": "ID必须大于0",
|
||||
}
|
||||
}
|
||||
|
||||
type ApiProductItemsValidator struct {
|
||||
Name string `validate:"max=256"`
|
||||
}
|
||||
|
||||
func (p ApiProductItemsValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"Name.max": "产品名长度不能超过256",
|
||||
}
|
||||
}
|
||||
|
||||
type ProductItemsValidator struct {
|
||||
Name string `validate:"max=256"`
|
||||
Page uint32 `validate:"omitempty,min=1"`
|
||||
@@ -163,12 +184,12 @@ func (p ProductEditApplyPassValidator) GetMessage() validate.ValidatorMessages {
|
||||
}
|
||||
|
||||
type ProductEditBaseValidator struct {
|
||||
Id int64 `validate:"required,gt=0"`
|
||||
Name string `validate:"required,max=256"`
|
||||
Subhead string `validate:"required,max=255"`
|
||||
Content string `validate:"required"`
|
||||
Waybill string `validate:"required,max=255"`
|
||||
Weight float64 `validate:"required"`
|
||||
Id int64 `validate:"required,gt=0"`
|
||||
Name string `validate:"required,max=256"`
|
||||
Subhead string `validate:"required,max=255"`
|
||||
Content string `validate:"required"`
|
||||
Waybill string `validate:"required,max=255"`
|
||||
Weight float64 `validate:"required"`
|
||||
Cubage string `validate:"required,max=255"`
|
||||
Images []string `validate:"required,min=1,dive,required"`
|
||||
PeriodValidity int32 `validate:"required"`
|
||||
|
||||
Reference in New Issue
Block a user