master
冯凯 2023-10-27 11:57:32 +08:00
parent b603abf883
commit f40574df00
3 changed files with 6 additions and 2 deletions

View File

@ -175,6 +175,7 @@ public class SysUserController extends BaseController
//--------------邮箱注册医生-------------------------------------- //--------------邮箱注册医生--------------------------------------
@PostMapping("/register/doctor") @PostMapping("/register/doctor")
public Result<?> registerDoctor(@RequestBody Doctor doctor){ public Result<?> registerDoctor(@RequestBody Doctor doctor){
userService.checkEmail(doctor.getEmail());
Boolean flag = userService.registerDoctor(doctor); Boolean flag = userService.registerDoctor(doctor);
return Result.success(userService.registerDoctor(doctor)); return Result.success(userService.registerDoctor(doctor));
} }
@ -182,7 +183,8 @@ public class SysUserController extends BaseController
@PostMapping("/register/patient") @PostMapping("/register/patient")
public Result<?> registerPatient(@RequestBody Patient patient){ public Result<?> registerPatient(@RequestBody Patient patient){
Boolean flag = userService.registerPatient(patient); userService.checkEmail(patient.getEmail());
Boolean flag = userService.registerPatient(patient);
return Result.success(userService.registerPatient(patient)); return Result.success(userService.registerPatient(patient));
} }

View File

@ -229,4 +229,6 @@ public interface ISysUserService
Patient selectPatient(Integer userId); Patient selectPatient(Integer userId);
//------------------------------查询医生信息 //------------------------------查询医生信息
Doctor selectDoctor(Integer userId); Doctor selectDoctor(Integer userId);
void checkEmail(String email);
} }

View File

@ -637,7 +637,7 @@ public class SysUserServiceImpl implements ISysUserService
* @author * @author
* @date: 2023/10/27 10:01 * @date: 2023/10/27 10:01
*/ */
private void checkEmail(String email) { public void checkEmail(String email) {
User user=userMapper.checkEmail(email); User user=userMapper.checkEmail(email);
System.out.println(user); System.out.println(user);
Assert.isNull(user, Assert.isNull(user,