| | |
| | | package com.moral.api.pojo.form; |
| | | |
| | | import com.moral.api.pojo.dto.account.AccountInsertDTO; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.util.AESUtils; |
| | | import com.moral.util.RegexUtils; |
| | | import lombok.Data; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | public AccountInsertDTO paramValid(){ |
| | | AccountInsertDTO dto = new AccountInsertDTO(); |
| | | //判断用户名是否符合条件 |
| | | if(!RegexUtils.checkAccount(account)){ |
| | | dto.setCode(ResponseCodeEnum.ACCOUNT_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.ACCOUNT_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | //判断密码是否符合条件 |
| | | if(!RegexUtils.checkPassword(AESUtils.decrypt(password))){ |
| | | dto.setCode(ResponseCodeEnum.PASSWORD_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.PASSWORD_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | //判断手机号是否符合条件 |
| | | if(!RegexUtils.checkMobile(mobile)){ |
| | | dto.setCode(ResponseCodeEnum.MOBILE_INVALID.getCode()); |
| | | dto.setMsg(ResponseCodeEnum.MOBILE_INVALID.getMsg()); |
| | | return dto; |
| | | } |
| | | //判断邮箱是否符合条件 |
| | | 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; |
| | | } |
| | | } |