Files
lone-services/services/factory/validator/group.go
T
gjs 1cbce2c1a3
CI / changes (push) Successful in 36s
CI / ad (push) Successful in 0s
CI / admin (push) Successful in 0s
CI / bff (push) Successful in 0s
CI / chore (push) Successful in 0s
CI / equipment (push) Successful in 0s
CI / express (push) Successful in 1s
CI / factory (push) Successful in 26s
CI / payment (push) Successful in 0s
CI / product (push) Successful in 1s
CI / record (push) Successful in 0s
CI / sale (push) Successful in 0s
CI / task (push) Successful in 1s
CI / user (push) Successful in 0s
CI / wecom (push) Successful in 0s
factroy store
2026-09-15 15:31:53 +08:00

54 lines
1.7 KiB
Go

package validator
import "lone-services/pkg/validate"
type GroupEditValidator struct {
Id int64 `form:"id" json:"id" validate:"required"`
Name string `form:"name" json:"name" validate:"required"`
Account string `form:"account" json:"account" validate:"required"`
Password string `form:"password" json:"password"`
}
type GroupPasswordValidator struct {
Id int64 `form:"id" json:"id" validate:"required"`
Password string `form:"password" json:"password" validate:"required"`
}
func (p GroupEditValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
validate.FieldId: validate.FieldIdValue,
"Name.required": "小组名称不能为空",
"Account.required": "账号不能为空",
}
}
type GroupCreateValidator struct {
Name string `form:"name" json:"name" validate:"required"`
Account string `form:"account" json:"account" validate:"required"`
Password string `form:"password" json:"password" validate:"required"`
}
func (p GroupCreateValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
"Name.required": "小组名称不能为空",
"Account.required": "账号不能为空",
}
}
func (p GroupPasswordValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
validate.FieldId: validate.FieldIdValue,
"Password.required": "密码不能为空",
}
}
type GroupItemsValidator struct {
Page int32 `form:"page" json:"page"`
Size int32 `form:"size" json:"size"`
Name string `form:"name" json:"name"`
Status int32 `form:"status" json:"status"`
}
func (p GroupItemsValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{}
}