mirror of https://gitee.com/stylefeng/roses
【7.1.6】【user】更新通过用户id获取头像url的service
parent
82fabd9623
commit
d6954e8beb
|
@ -151,4 +151,12 @@ public interface UserServiceApi {
|
|||
*/
|
||||
Boolean userExist(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户的头像url
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/12/29 17:27
|
||||
*/
|
||||
String getUserAvatarUrlByUserId(Long userId);
|
||||
|
||||
}
|
||||
|
|
|
@ -758,6 +758,20 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAvatarUrlByUserId(Long userId) {
|
||||
|
||||
// 获取用户头像文件id
|
||||
LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<SysUser>().eq(SysUser::getUserId, userId).select(SysUser::getAvatar);
|
||||
SysUser sysUser = this.getOne(wrapper, false);
|
||||
|
||||
if (sysUser == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return this.getUserAvatarUrl(sysUser.getAvatar());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统用户
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue