增加检查手机号和邮箱是否已注册接口
This commit is contained in:
parent
5d0a171092
commit
374390696d
@ -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获取用户信息
|
||||
*/
|
||||
|
@ -348,4 +348,8 @@ public interface ISysUserService {
|
||||
void retrievePwd(RetrievePwdVO vo);
|
||||
|
||||
void register2(AccountRegisterVO registerVO);
|
||||
|
||||
boolean isSameMobileExist(String mobile);
|
||||
|
||||
boolean isSameEmailExist(String email);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user