mirror of https://gitee.com/stylefeng/roses
【8.1.7】【system】新增通过邮箱获取用户信息接口
parent
3dbcb13501
commit
7e2e6894fd
|
@ -190,4 +190,12 @@ public interface SysUserServiceApi {
|
|||
*/
|
||||
void simpleAddUser(AddUserDTO addUserDTO, Long orgId, Long positionId);
|
||||
|
||||
/**
|
||||
* 通过用户的邮箱获取用户的详细信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/5/24 9:30
|
||||
*/
|
||||
UserInfoDetailDTO getUserDetailByEmail(String email);
|
||||
|
||||
}
|
||||
|
|
|
@ -73,7 +73,12 @@ public enum SysUserExceptionEnum implements AbstractExceptionEnum {
|
|||
/**
|
||||
* 组织机构id为空,请检查参数
|
||||
*/
|
||||
ORG_ID_EMPTY_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10012", "组织机构id为空,请检查参数");
|
||||
ORG_ID_EMPTY_ERROR(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10012", "组织机构id为空,请检查参数"),
|
||||
|
||||
/**
|
||||
* 用户邮箱存在重复
|
||||
*/
|
||||
EMAIL_REPEAT(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + "10013", "用户邮箱存在重复");
|
||||
|
||||
/**
|
||||
* 错误编码
|
||||
|
|
|
@ -822,6 +822,29 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
BusinessLogUtil.addContent("用户详细信息如下:\n", simpleUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserInfoDetailDTO getUserDetailByEmail(String email) {
|
||||
|
||||
LambdaQueryWrapper<SysUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SysUser::getEmail, email);
|
||||
lambdaQueryWrapper.select(SysUser::getUserId, SysUser::getRealName, SysUser::getNickName, SysUser::getAccount, SysUser::getBirthday, SysUser::getSex, SysUser::getEmail, SysUser::getPhone,
|
||||
SysUser::getTel, SysUser::getSuperAdminFlag, SysUser::getStatusFlag, SysUser::getUserSort, SysUser::getMasterUserId);
|
||||
List<SysUser> list = this.list(lambdaQueryWrapper);
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (list.size() > 1) {
|
||||
throw new ServiceException(SysUserExceptionEnum.EMAIL_REPEAT);
|
||||
}
|
||||
|
||||
SysUser sysUser = list.get(0);
|
||||
|
||||
UserInfoDetailDTO userInfoDetailDTO = new UserInfoDetailDTO();
|
||||
BeanUtil.copyProperties(sysUser, userInfoDetailDTO);
|
||||
return userInfoDetailDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue