feat: sale add create user
This commit is contained in:
@@ -153,7 +153,7 @@ type ItemsValidator struct {
|
||||
PageSize uint32 `validate:"omitempty,min=1,max=100"`
|
||||
SaleId int64 `validate:"omitempty,gte=0"`
|
||||
Type uint32 `validate:"omitempty,oneof=1 2 3"`
|
||||
Status uint32 `validate:"omitempty,oneof=1 2 3 9"`
|
||||
Status uint32 `validate:"omitempty,oneof=1 2"`
|
||||
}
|
||||
|
||||
func (p ItemsValidator) GetMessage() validate.ValidatorMessages {
|
||||
@@ -168,8 +168,8 @@ func (p ItemsValidator) GetMessage() validate.ValidatorMessages {
|
||||
|
||||
type StatusValidator struct {
|
||||
Id int64 `validate:"required,gt=0"`
|
||||
Status uint32 `validate:"required,oneof=1 2 3"`
|
||||
Reason string `validate:"required_if=Status 2 required_if=Status 3,max=255"`
|
||||
Status uint32 `validate:"required,oneof=1 2"`
|
||||
Reason string `validate:"required_if=Status 2,max=255"`
|
||||
}
|
||||
|
||||
func (p StatusValidator) GetMessage() validate.ValidatorMessages {
|
||||
@@ -177,8 +177,8 @@ func (p StatusValidator) GetMessage() validate.ValidatorMessages {
|
||||
"Id.required": "ID不能为空",
|
||||
"Id.gt": "ID必须大于0",
|
||||
"Status.required": "状态不能为空",
|
||||
"Status.oneof": "状态不对",
|
||||
"Reason.required_if": "未通过或禁用状态,理由不能为空",
|
||||
"Status.oneof": "状态不对,仅支持1开启或2禁用",
|
||||
"Reason.required_if": "禁用时理由不能为空",
|
||||
"Reason.max": "理由长度不能超过255",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user