factory worker post
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package validator
|
||||
|
||||
import "lone-services/pkg/validate"
|
||||
|
||||
type PostEditValidator struct {
|
||||
Id int64 `form:"id" json:"id" validate:"required"`
|
||||
Name string `form:"name" json:"name" validate:"required"`
|
||||
}
|
||||
|
||||
func (p PostEditValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"Id.required": "ID不能为空",
|
||||
"Name.required": "小组名称不能为空",
|
||||
}
|
||||
}
|
||||
|
||||
type PostCreateValidator struct {
|
||||
Name string `form:"name" json:"name" validate:"required"`
|
||||
}
|
||||
|
||||
func (p PostCreateValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"Name.required": "小组名称不能为空",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user