f5749b87dc
CI / changes (push) Successful in 1m30s
CI / ad (push) Successful in 31s
CI / admin (push) Successful in 22s
CI / bff (push) Successful in 20s
CI / chore (push) Successful in 21s
CI / equipment (push) Successful in 22s
CI / express (push) Successful in 21s
CI / factory (push) Successful in 19s
CI / message (push) Successful in 18s
CI / order (push) Successful in 19s
CI / payment (push) Successful in 20s
CI / percutaneous (push) Successful in 19s
CI / product (push) Successful in 20s
CI / record (push) Successful in 19s
CI / sale (push) Successful in 19s
CI / support (push) Successful in 19s
CI / task (push) Successful in 18s
CI / user (push) Successful in 19s
CI / wecom (push) Successful in 20s
86 lines
2.4 KiB
Go
86 lines
2.4 KiB
Go
package validator
|
|
|
|
import "lone-services/pkg/validate"
|
|
|
|
type PrintLoginValidator struct {
|
|
Username string `form:"username" json:"username" validate:"required"`
|
|
Password string `form:"password" json:"password" validate:"required"`
|
|
}
|
|
|
|
// GetMessage 提示消息
|
|
func (p PrintLoginValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Username.required": "用户名不能为空",
|
|
"Password.required": "密码不能为空",
|
|
}
|
|
}
|
|
|
|
type PrintExpressTransitValidator struct {
|
|
Company string `form:"company" json:"company" validate:"required"`
|
|
}
|
|
|
|
func (p PrintExpressTransitValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Company.required": "公司信息不能为空",
|
|
}
|
|
}
|
|
|
|
type PrintTransitBindValidator struct {
|
|
Codes string `form:"codes" json:"codes" binding:"required"`
|
|
}
|
|
|
|
// GetMessage 提示消息
|
|
func (p PrintTransitBindValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"Codes.required": "codes不能为空",
|
|
}
|
|
}
|
|
|
|
// PrintBarCodeValidator 创建产品
|
|
type PrintBarCodeValidator struct {
|
|
Number int32 `form:"number" json:"number"`
|
|
ProductId int64 `form:"product_id" json:"product_id" validate:"required"`
|
|
}
|
|
|
|
// GetMessage 提示消息
|
|
func (p PrintBarCodeValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"ProductId.required": "产品ID不能为空",
|
|
}
|
|
}
|
|
|
|
type PrintBarCodeUseValidator struct {
|
|
Id int64 `form:"id" json:"id" validate:"required"`
|
|
}
|
|
|
|
// GetMessage 提示消息
|
|
func (p PrintBarCodeUseValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
validate.FieldId: validate.FieldIdValue,
|
|
}
|
|
}
|
|
|
|
type PrintOrderValidator struct {
|
|
Status int32 `form:"status" json:"status"`
|
|
OrderSn string `form:"order_sn" json:"order_sn"`
|
|
Time string `form:"time" json:"time"`
|
|
}
|
|
|
|
// GetMessage 提示消息
|
|
func (p PrintOrderValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{}
|
|
}
|
|
|
|
type PrintOrderUseValidator struct {
|
|
Id int64 `form:"id" json:"id" validate:"required"`
|
|
TransitId int64 `form:"transit_id" json:"transit_id"`
|
|
}
|
|
|
|
// GetMessage 提示消息
|
|
func (p PrintOrderUseValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
validate.FieldId: validate.FieldIdValue,
|
|
//"TransitId.required": "快递ID不能为空",
|
|
}
|
|
}
|