init
This commit is contained in:
@@ -9,6 +9,7 @@ public enum ImagesEnums {
|
||||
CONSUMER_FAIL_LOG("xq/images/logs/consumer-fail.png"),
|
||||
SYSTEM_LOG("xq/images/logs/system-log.png"),
|
||||
LOGO_LOG("xq/images/logs/logo.png"),
|
||||
PRIVACY_IMAGE("xq/images/avatar/privacy.png"),
|
||||
;
|
||||
|
||||
private final String path;
|
||||
|
||||
@@ -24,7 +24,9 @@ import com.ruoyi.xq.dto.app.user.vo.HomeUserVo;
|
||||
import com.ruoyi.xq.dto.app.user.vo.UserAuthMinVo;
|
||||
import com.ruoyi.xq.dto.common.user.MinUser;
|
||||
import com.ruoyi.xq.enums.ErrorEnum;
|
||||
import com.ruoyi.xq.enums.common.AuditEnum;
|
||||
import com.ruoyi.xq.enums.common.SystemConfigEnum;
|
||||
import com.ruoyi.xq.enums.image.ImagesEnums;
|
||||
import com.ruoyi.xq.enums.userinfo.UserGenderEnum;
|
||||
import com.ruoyi.xq.lock.LockKey;
|
||||
import com.ruoyi.xq.manager.LoginManager;
|
||||
@@ -135,13 +137,23 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
UserStatus userStatus = userStatusService.getByUserId(userId);
|
||||
boolean showAvatar = this.showAvatar(LoginHelper.getUserId(), userStatus.getShowAvatar());
|
||||
if(!showAvatar){
|
||||
result.setAvatar(null);
|
||||
String cos = systemConfigManager.getSystemConfig(SystemConfigEnum.COS_DOMAIN);
|
||||
result.setAvatar(cos + ImagesEnums.PRIVACY_IMAGE.getPath());
|
||||
result.setShowAvatarBool(false);
|
||||
result.setUserPictureList(Collections.emptyList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean showAvatar(Long userId, Integer avatar){
|
||||
if(userId == null){
|
||||
return ShowAvatarUtil.showAvatar(false,false,avatar);
|
||||
}
|
||||
UserAuth userAuth = userAuthService.getByUserId(userId);
|
||||
User user = this.getById(userId);
|
||||
return ShowAvatarUtil.showAvatar(user.getOpenVip(),userAuth.getCarAuth()==1, avatar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateMobileUser(UpdateMobileAdminReq bo) {
|
||||
if(!PhoneUtil.isMobile(bo.getMobile())){
|
||||
@@ -215,14 +227,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
return baseMapper.pageAdmin(pageQuery.build(), bo);
|
||||
}
|
||||
|
||||
public boolean showAvatar(Long userId, Integer avatar){
|
||||
if(userId == null){
|
||||
return ShowAvatarUtil.showAvatar(false,false,avatar);
|
||||
}
|
||||
UserAuth userAuth = userAuthService.getByUserId(userId);
|
||||
User user = this.getById(userId);
|
||||
return ShowAvatarUtil.showAvatar(user.getOpenVip(),userAuth.getCarAuth()==1, avatar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<HomeUserListVo> homePage(HomePageReq params) {
|
||||
@@ -232,7 +236,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
Long userId = LoginHelper.getUserId();
|
||||
if(userId != null){
|
||||
UserAuth userAuth = userAuthService.getByUserId(userId);
|
||||
card = userAuth != null && userAuth.getCarAuth() == 1;
|
||||
card = userAuth != null && AuditEnum.SUCCESS.getCode().equals(userAuth.getCarAuth());
|
||||
User user = this.getById(userId);
|
||||
vip = user.getOpenVip();
|
||||
}
|
||||
@@ -251,13 +255,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
}
|
||||
Page<HomeUserListVo> page = baseMapper.homePageApp(params.build(), params);
|
||||
List<HomeUserListVo> records = page.getRecords();
|
||||
String cosDomain = systemConfigManager.getSystemConfig(SystemConfigEnum.COS_DOMAIN);
|
||||
for (HomeUserListVo record : records) {
|
||||
record.setBirthdayStr(BirthdayUtil.getMinBirthday(record.getBirthday()));
|
||||
record.setAge(BirthdayUtil.getAge(record.getBirthday()));
|
||||
boolean showAvatarBool = ShowAvatarUtil.showAvatar(vip, card, record.getShowAvatar());
|
||||
record.setShowAvatarBool(showAvatarBool);
|
||||
if(!record.getShowAvatarBool()){
|
||||
record.setAvatar(null);
|
||||
record.setAvatar(cosDomain + ImagesEnums.PRIVACY_IMAGE.getPath());
|
||||
}
|
||||
}
|
||||
return page;
|
||||
@@ -268,7 +272,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
List<HomeUserListVo> result = baseMapper.vipHomePage(20);
|
||||
for (HomeUserListVo record : result) {
|
||||
record.setBirthdayStr(BirthdayUtil.getMinBirthday(record.getBirthday()));
|
||||
record.setAge(BirthdayUtil.getAge(record.getBirthday()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user