init
This commit is contained in:
@@ -17,6 +17,8 @@ public class HomeUserVo {
|
||||
private String usercode;
|
||||
@Schema(description = "用户头像")
|
||||
private String avatar;
|
||||
@Schema(description = "是否关注")
|
||||
private Boolean star = false;
|
||||
@Schema(description = "相册")
|
||||
private List<String> userPictureList;
|
||||
@Schema(description = "自我描述")
|
||||
|
||||
@@ -20,4 +20,6 @@ public interface UserStarService extends IService<UserStar> {
|
||||
void starUpdate(UserStarReq req);
|
||||
|
||||
Page<UserStarListVo> pageApp(PageQuery pageQuery, UserStarQuery query);
|
||||
|
||||
boolean existsStar(Long userId, Long starUserId);
|
||||
}
|
||||
|
||||
@@ -80,6 +80,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
private RedissonClient redissonClient;
|
||||
@Autowired
|
||||
private AreaCodeService areaCodeService;
|
||||
@Autowired
|
||||
private UserStarService userStarService;
|
||||
|
||||
@Override
|
||||
public MinUser getMinUserById(Long userId){
|
||||
@@ -126,6 +128,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements Use
|
||||
if(userId.equals(currentUserId)){
|
||||
return result;
|
||||
}
|
||||
boolean star = userStarService.existsStar(currentUserId, userId);
|
||||
result.setStar(star);
|
||||
UserStatus userStatus = userStatusService.getByUserId(userId);
|
||||
boolean showAvatar = this.showAvatar(LoginHelper.getUserId(), userStatus.getShowAvatar());
|
||||
if(!showAvatar){
|
||||
|
||||
@@ -70,4 +70,9 @@ public class UserStarServiceImpl extends ServiceImpl<UserStarMapper,UserStar> im
|
||||
throw new ServiceException("参数异常");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean existsStar(Long userId, Long starUserId) {
|
||||
return this.exists(Wrappers.lambdaQuery(UserStar.class).eq(UserStar::getUserId, userId).eq(UserStar::getStarUserId, starUserId));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user