feat: user password
This commit is contained in:
@@ -24,6 +24,21 @@ func (p LoginValidator) GetMessage() validate.ValidatorMessages {
|
||||
}
|
||||
}
|
||||
|
||||
type PasswordValidator struct {
|
||||
OldPassword string `validate:"required,max=64"`
|
||||
Password string `validate:"required,min=6,max=64"`
|
||||
}
|
||||
|
||||
func (p PasswordValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"OldPassword.required": "原密码不能为空",
|
||||
"OldPassword.max": "原密码过长",
|
||||
"Password.required": "新密码不能为空",
|
||||
"Password.min": "新密码长度不能小于6位",
|
||||
"Password.max": "新密码过长",
|
||||
}
|
||||
}
|
||||
|
||||
type GetOpenidValidator struct {
|
||||
Code string `validate:"required,max=128"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user