plusone-validator 修改了方法名
parent
7f8a37803a
commit
b69983077a
|
@ -36,7 +36,7 @@ class LoginCommandValidator extends BaseValidator<LoginCommand> {
|
|||
private LoginCommandValidator() {
|
||||
ruleForString(LoginCommand::getAccount)
|
||||
.notNull("邮箱地址不能为空")
|
||||
.matchesOr(new Pattern[] { PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE },
|
||||
.matchesOne(new Pattern[] { PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE },
|
||||
value -> new RuntimeException('"' + value + "\" 不是邮箱地址或手机号"));
|
||||
ruleForString(LoginCommand::getPwd)
|
||||
.notNull("密码不能为空")
|
||||
|
|
|
@ -16,7 +16,7 @@ public class LoginByOtpCommandValidator extends BaseValidator<LoginByOtpCommand>
|
|||
ruleForString(LoginByOtpCommand::getPrincipal)
|
||||
.notNull("输入邮箱地址或手机号")
|
||||
.notEmpty("输入邮箱地址或手机号")
|
||||
.matchesOr(List.of(PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE), "输入用户名、邮箱地址或手机号");
|
||||
.matchesOne(List.of(PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE), "输入用户名、邮箱地址或手机号");
|
||||
ruleForString(LoginByOtpCommand::getOtp)
|
||||
.notNull("验证码不能为空")
|
||||
.notEmpty("验证码不能为空")
|
||||
|
|
|
@ -15,7 +15,7 @@ public class LoginByPasswordCommandValidator extends BaseValidator<LoginByPasswo
|
|||
ruleForString(LoginByPasswordCommand::getPrincipal)
|
||||
.notNull("输入用户名、邮箱地址或手机号")
|
||||
.notEmpty("输入用户名、邮箱地址或手机号")
|
||||
.matchesOr(List.of(PatternConsts.USERNAME, PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE),
|
||||
.matchesOne(List.of(PatternConsts.USERNAME, PatternConsts.EMAIL, PatternConsts.MOBILE_PHONE),
|
||||
"输入用户名、邮箱地址或手机号");
|
||||
ruleForString(LoginByPasswordCommand::getPassword)
|
||||
.notNull("密码不能为空")
|
||||
|
|
Loading…
Reference in New Issue