feat(user): 添加手机号重复注册检查并调整默认消息设置
- 添加手机号唯一性验证逻辑,防止重复注册 - 新增 REGISTER_PHONE_REPEAT 业务异常枚举 - 调整新用户默认消息配置:harmonicInfo从1改为0 - 调整新用户默认消息配置:runInfo从1改为0 - 调整新用户默认消息配置:alarmInfo从1改为0
This commit is contained in:
@@ -104,6 +104,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
|
|||||||
if (StringUtils.isBlank(devCode)) {
|
if (StringUtils.isBlank(devCode)) {
|
||||||
throw new BusinessException(UserResponseEnum.DEV_CODE_WRONG);
|
throw new BusinessException(UserResponseEnum.DEV_CODE_WRONG);
|
||||||
}
|
}
|
||||||
|
User user = this.lambdaQuery().eq(User::getPhone,phone).one();
|
||||||
|
if (!Objects.isNull(user)){
|
||||||
|
throw new BusinessException(UserResponseEnum.REGISTER_PHONE_REPEAT);
|
||||||
|
}
|
||||||
judgeCode(phone, code);
|
judgeCode(phone, code);
|
||||||
//新增用户配置表
|
//新增用户配置表
|
||||||
UserSet userSet = userSetService.addAppUserSet();
|
UserSet userSet = userSetService.addAppUserSet();
|
||||||
@@ -115,10 +119,10 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, User> impleme
|
|||||||
//消息默认配置
|
//消息默认配置
|
||||||
AppInfoSet appInfoSet = new AppInfoSet();
|
AppInfoSet appInfoSet = new AppInfoSet();
|
||||||
appInfoSet.setUserId(newUser.getId());
|
appInfoSet.setUserId(newUser.getId());
|
||||||
appInfoSet.setHarmonicInfo(1);
|
appInfoSet.setHarmonicInfo(0);
|
||||||
appInfoSet.setEventInfo(1);
|
appInfoSet.setEventInfo(1);
|
||||||
appInfoSet.setRunInfo(1);
|
appInfoSet.setRunInfo(0);
|
||||||
appInfoSet.setAlarmInfo(1);
|
appInfoSet.setAlarmInfo(0);
|
||||||
appInfoSet.setIticFunction(0);
|
appInfoSet.setIticFunction(0);
|
||||||
appInfoSet.setF47Function(0);
|
appInfoSet.setF47Function(0);
|
||||||
appInfoSetService.save(appInfoSet);
|
appInfoSetService.save(appInfoSet);
|
||||||
|
|||||||
Reference in New Issue
Block a user