New file |
| | |
| | | package com.moral.api.pojo.form; |
| | | |
| | | import com.moral.api.pojo.dto.account.AccountInsertDTO; |
| | | import com.moral.api.pojo.dto.account.AccountUpdateDTO; |
| | | import com.moral.constant.ResponseCodeEnum; |
| | | import com.moral.util.AESUtils; |
| | | import com.moral.util.RegexUtils; |
| | | import lombok.Data; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName AccountUpdateRequest |
| | | * @Description TODO |
| | | * @Author 陈凯裕 |
| | | * @Date 2021/3/15 15:34 |
| | | * @Version TODO |
| | | **/ |
| | | @Data |
| | | public class AccountUpdateForm { |
| | | |
| | | private Integer accountId; |
| | | |
| | | private String userName; |
| | | |
| | | private String email; |
| | | |
| | | private String mobile; |
| | | |
| | | private String wechat; |
| | | |
| | | private List<Integer> roleIds; |
| | | |
| | | public boolean valid(){ |
| | | if ( |
| | | ObjectUtils.isEmpty(accountId) || |
| | | ObjectUtils.isEmpty(userName) || |
| | | ObjectUtils.isEmpty(email) || |
| | | ObjectUtils.isEmpty(mobile) || |
| | | ObjectUtils.isEmpty(roleIds) |
| | | ) |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | public AccountUpdateDTO paramValid(){ |
| | | AccountUpdateDTO dto = new AccountUpdateDTO(); |
| | | //判断手机号是否符合条件 |
| | | 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; |
| | | } |
| | | |
| | | } |