plusone-validator 修改了方法名

dev
ZhouXY108 2023-09-10 16:47:30 +08:00
parent 7f8a37803a
commit b69983077a
3 changed files with 3 additions and 3 deletions

View File

@ -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("密码不能为空")

View File

@ -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("验证码不能为空")

View File

@ -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("密码不能为空")