【7.1.6】【user】更新通过用户id获取头像url的service

pull/25/head
fengshuonan 2021-12-29 17:32:01 +08:00
parent 82fabd9623
commit d6954e8beb
2 changed files with 22 additions and 0 deletions

View File

@ -151,4 +151,12 @@ public interface UserServiceApi {
*/
Boolean userExist(Long userId);
/**
* url
*
* @author fengshuonan
* @date 2021/12/29 17:27
*/
String getUserAvatarUrlByUserId(Long userId);
}

View File

@ -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());
}
/**
*
*