23 lines
614 B
Go
23 lines
614 B
Go
package validator
|
|
|
|
import "lone-services/pkg/validate"
|
|
|
|
// UseValidator 查看列表
|
|
type UseValidator struct {
|
|
HostCode string `validate:"required"`
|
|
UserId int64 `validate:"required"`
|
|
Data string `validate:"required"`
|
|
Stamp string `validate:"required"`
|
|
Position int32
|
|
}
|
|
|
|
// GetMessage 查看列表 - 提示消息
|
|
func (p UseValidator) GetMessage() validate.ValidatorMessages {
|
|
return validate.ValidatorMessages{
|
|
"HostCode.required": "设备不能为空",
|
|
"UserId.required": "用户不能为空",
|
|
"Data.required": "数据不能为空",
|
|
"Stamp.required": "标记不能为空",
|
|
}
|
|
}
|