| | |
| | | |
| | | public AccountDTO paramValid(){ |
| | | AccountDTO dto = new AccountDTO(); |
| | | //判断用户名是否符合条件 |
| | | //判断账号是否符合条件 |
| | | if(!RegexUtils.checkAccount(account)){ |
| | | dto.setCode(ResponseCodeEnum.ACCOUNT_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.ACCOUNT_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | //判断用户名是否符合条件 |
| | | if(!RegexUtils.checkChinese(userName)||userName.contains(" ")){ |
| | | dto.setCode(ResponseCodeEnum.USERNAME_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.USERNAME_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | //判断密码是否符合条件 |
| | |
| | | return dto; |
| | | } |
| | | //判断手机号是否符合条件 |
| | | if (!ObjectUtils.isEmpty(mobile)) { |
| | | if(!RegexUtils.checkMobile(mobile)){ |
| | | dto.setCode(ResponseCodeEnum.MOBILE_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.MOBILE_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | } |
| | | //判断邮箱是否符合条件 |
| | | if (!ObjectUtils.isEmpty(email)) { |
| | | if(!RegexUtils.checkEmail(email)){ |
| | | dto.setCode(ResponseCodeEnum.EMAIL_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.EMAIL_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | } |
| | | dto.setCode(ResponseCodeEnum.SUCCESS.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); |
| | | return dto; |
| | | |
| | | } |
| | | |
| | | public ManageAccount formConvertEntity(){ |