增加检查手机号和邮箱是否已注册接口

This commit is contained in:
joylink_zhangsai 2022-12-14 17:03:41 +08:00
parent 5d0a171092
commit 374390696d
3 changed files with 24 additions and 2 deletions

View File

@ -46,6 +46,22 @@ public class SysAccountController {
return list;
}
/**
* 手机号是否已经注册
*/
@GetMapping("/isExist/mobile")
public boolean isMobileExist(String mobile) {
return iSysUserService.isSameMobileExist(mobile);
}
/**
* 邮箱是否已经注册
*/
@GetMapping("/isExist/email")
public boolean isEmailExist(String email) {
return iSysUserService.isSameEmailExist(email);
}
/**
*根据用户id获取用户信息
*/

View File

@ -348,4 +348,8 @@ public interface ISysUserService {
void retrievePwd(RetrievePwdVO vo);
void register2(AccountRegisterVO registerVO);
boolean isSameMobileExist(String mobile);
boolean isSameEmailExist(String email);
}

View File

@ -1032,14 +1032,16 @@ public class SysUserService implements ISysUserService {
return accounts.get(0);
}
private boolean isSameMobileExist(String mobile) {
@Override
public boolean isSameMobileExist(String mobile) {
SysAccountExample example = new SysAccountExample();
example.createCriteria()
.andMobileEqualTo(mobile);
return sysAccountDAO.countByExample(example) > 0;
}
private boolean isSameEmailExist(String email) {
@Override
public boolean isSameEmailExist(String email) {
SysAccountExample example = new SysAccountExample();
example.createCriteria()
.andEmailEqualTo(email);