init
This commit is contained in:
@@ -283,8 +283,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
|||||||
@Override
|
@Override
|
||||||
public List<HomeUserListVo> vipHomePage() {
|
public List<HomeUserListVo> vipHomePage() {
|
||||||
List<HomeUserListVo> result = baseMapper.vipHomePage(20);
|
List<HomeUserListVo> result = baseMapper.vipHomePage(20);
|
||||||
|
String cosDomain = systemConfigManager.getSystemConfig(SystemConfigEnum.COS_DOMAIN);
|
||||||
|
boolean vip = false; // 是否为VIP
|
||||||
|
boolean card = false; // 是否实名认证
|
||||||
|
Long userId = LoginHelper.getUserId();
|
||||||
|
if(userId != null){
|
||||||
|
UserAuth userAuth = userAuthService.getByUserId(userId);
|
||||||
|
card = userAuth != null && AuditEnum.SUCCESS.getCode().equals(userAuth.getCarAuth());
|
||||||
|
User user = this.getById(userId);
|
||||||
|
vip = user.getOpenVip();
|
||||||
|
}
|
||||||
for (HomeUserListVo record : result) {
|
for (HomeUserListVo record : result) {
|
||||||
record.setBirthdayStr(BirthdayUtil.getMinBirthday(record.getBirthday()));
|
record.setBirthdayStr(BirthdayUtil.getMinBirthday(record.getBirthday()));
|
||||||
|
boolean showAvatarBool = ShowAvatarUtil.showAvatar(vip, card, record.getShowAvatar());
|
||||||
|
record.setShowAvatarBool(showAvatarBool);
|
||||||
|
if(!record.getShowAvatarBool()){
|
||||||
|
record.setAvatar(cosDomain + ImagesEnums.PRIVACY_IMAGE.getPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user