服务之间相互调用
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package validator
|
||||
|
||||
import "lone-services/pkg/validate"
|
||||
|
||||
type AdminOrderAuditingItemsValidator struct {
|
||||
Page int32
|
||||
Size 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
|
||||
}
|
||||
|
||||
// GetMessage 修改状态 - 提示消息
|
||||
func (p AdminOrderCreateValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"AddressId.required": "地址ID不能为空",
|
||||
"Info.required": "内容不能为空",
|
||||
}
|
||||
}
|
||||
|
||||
type OrderCreateValidator struct {
|
||||
AddressId int64 `validate:"required"`
|
||||
Note string
|
||||
}
|
||||
|
||||
func (p OrderCreateValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"AddressId.required": "地址ID不能为空",
|
||||
}
|
||||
}
|
||||
|
||||
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{}
|
||||
}
|
||||
Reference in New Issue
Block a user