Commit de20f8d0 by guojuxing

新增超级管理员接口

parent 12cb2c54
......@@ -114,6 +114,31 @@ public class UserApiServiceImpl implements UserApiService {
}
}
@Override
public ServiceResponse<Integer> saveAdmin(UserDTO userDTO) {
//valid param
ServiceResponse paramResult = ValidUtil.allCheckValidate(userDTO, UserDTO.SaveUserValid.class);
if (!paramResult.isSuccess()) {
return paramResult;
}
if (userService.isPhoneRepeat(null, userDTO.getPhoneNumber(), userDTO.getEnterpriseId())) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "手机号码不能重复");
}
if (userDTO.getPasswordType() == null) {
//默认自定义创建密码类型
userDTO.setPasswordType(2);
}
if (StringUtils.isBlank(userDTO.getPhoneAreaCode())) {
userDTO.setPhoneAreaCode("86");
}
userDTO.setCreateTime(new Date());
userDTO.setUpdateTime(new Date());
userDTO.setStatus(1);
Integer userId = userService.saveUser(userDTO);
return ServiceResponse.success(userId);
}
@Transactional(rollbackFor = Exception.class)
@Override
public ServiceResponse editUser(UserDTO userDTO) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment