f84799c3c4
CI / changes (push) Successful in 38s
CI / ad (push) Successful in 29s
CI / admin (push) Successful in 22s
CI / bff (push) Successful in 19s
CI / chore (push) Successful in 22s
CI / equipment (push) Successful in 20s
CI / express (push) Successful in 18s
CI / log (push) Successful in 0s
CI / product (push) Successful in 15s
CI / sale (push) Successful in 16s
CI / task (push) Successful in 17s
CI / user (push) Successful in 16s
CI / wecom (push) Successful in 16s
110 lines
3.1 KiB
Go
110 lines
3.1 KiB
Go
package validator
|
|
|
|
import "lone-services/pkg/validate"
|
|
|
|
type AdminOrderAuditingItemsValidator struct {
|
|
Page int32
|
|
Size int32
|
|
Time []string
|
|
Status int32
|
|
}
|
|
|
|
// GetMessage 查看列表 - 提示消息
|
|
func (p AdminOrderAuditingItemsValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{}
|
|
}
|
|
|
|
type AdminOrderAuditingValidator struct {
|
|
Id int64 `validate:"required"`
|
|
Status int32 `validate:"required,oneof=1 2"`
|
|
Reason string `validate:"required_if=Status 2"`
|
|
}
|
|
|
|
// GetMessage 修改状态 - 提示消息
|
|
func (p AdminOrderAuditingValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Id.required": "ID不能为空",
|
|
"Status.required": "状态不能为空",
|
|
"Status.oneof": "状态传值不对",
|
|
"Reason.required_if": "理由不能为空",
|
|
}
|
|
}
|
|
|
|
type AdminOrderCreateValidator struct {
|
|
AddressId int64 `validate:"required"`
|
|
Info string `validate:"required"`
|
|
Note string
|
|
Type int32 `validate:"required"` // 发货类型,1为需要发货,2为不需要发货
|
|
|
|
}
|
|
|
|
// GetMessage 修改状态 - 提示消息
|
|
func (p AdminOrderCreateValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"AddressId.required": "地址ID不能为空",
|
|
"Info.required": "内容不能为空",
|
|
"Type.required": "类型不能为空",
|
|
}
|
|
}
|
|
|
|
type OrderCreateValidator struct {
|
|
AddressId int64 `validate:"required"`
|
|
Note string
|
|
Type int32 `validate:"required,oneof=1 2 3"` //类型 1门店 , 2销售,3为用户
|
|
}
|
|
|
|
func (p OrderCreateValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"AddressId.required": "地址ID不能为空",
|
|
"Type.required": "类型不能为空",
|
|
"Type.oneof": "类型不对",
|
|
}
|
|
}
|
|
|
|
type OrderOneCreateValidator struct {
|
|
AddressId int64 `validate:"required"`
|
|
Note string
|
|
ProductId int64 `validate:"required"`
|
|
Num int32 `validate:"required"`
|
|
Type int32 `validate:"required,oneof=1 2 3"` //类型 1门店 , 2销售,3为用户
|
|
}
|
|
|
|
func (p OrderOneCreateValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"AddressId.required": "地址ID不能为空",
|
|
"Type.required": "类型不能为空",
|
|
"Type.oneof": "类型不对",
|
|
"ProductId.required": "产品不能为空",
|
|
"Num.required": "产品数量不能为空",
|
|
}
|
|
}
|
|
|
|
type OrderItemsValidator struct {
|
|
Page int32
|
|
Size int32
|
|
ProductId int64
|
|
OrderSn string
|
|
Mobile string
|
|
StoreId int64
|
|
SaleId int64
|
|
Time []string
|
|
Status int32
|
|
}
|
|
|
|
func (p OrderItemsValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{}
|
|
}
|
|
|
|
type UpdateOrderDeliverStatusValidator struct {
|
|
Id string `validate:"required"`
|
|
DeliverStatus int32 `validate:"required"`
|
|
SignTime string
|
|
}
|
|
|
|
func (p UpdateOrderDeliverStatusValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
validate.FieldId: validate.FieldIdValue,
|
|
"DeliverStatus.required": "发货状态不能为空",
|
|
}
|
|
}
|