From 374390696d51ff1c2291c1180a94f6c18163b11a Mon Sep 17 00:00:00 2001 From: joylink_zhangsai <1021828630@qq.com> Date: Wed, 14 Dec 2022 17:03:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A3=80=E6=9F=A5=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=E5=92=8C=E9=82=AE=E7=AE=B1=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=B7=B2=E6=B3=A8=E5=86=8C=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/user/SysAccountController.java | 16 ++++++++++++++++ .../joylink/rtss/services/ISysUserService.java | 4 ++++ .../joylink/rtss/services/SysUserService.java | 6 ++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/club/joylink/rtss/controller/user/SysAccountController.java b/src/main/java/club/joylink/rtss/controller/user/SysAccountController.java index 36b81972e..982087133 100644 --- a/src/main/java/club/joylink/rtss/controller/user/SysAccountController.java +++ b/src/main/java/club/joylink/rtss/controller/user/SysAccountController.java @@ -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获取用户信息 */ diff --git a/src/main/java/club/joylink/rtss/services/ISysUserService.java b/src/main/java/club/joylink/rtss/services/ISysUserService.java index bde5d3690..9f13a10a6 100644 --- a/src/main/java/club/joylink/rtss/services/ISysUserService.java +++ b/src/main/java/club/joylink/rtss/services/ISysUserService.java @@ -348,4 +348,8 @@ public interface ISysUserService { void retrievePwd(RetrievePwdVO vo); void register2(AccountRegisterVO registerVO); + + boolean isSameMobileExist(String mobile); + + boolean isSameEmailExist(String email); } diff --git a/src/main/java/club/joylink/rtss/services/SysUserService.java b/src/main/java/club/joylink/rtss/services/SysUserService.java index 97dddef2a..45e863c93 100644 --- a/src/main/java/club/joylink/rtss/services/SysUserService.java +++ b/src/main/java/club/joylink/rtss/services/SysUserService.java @@ -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);