|
@@ -117,12 +117,12 @@ public class TbMyPublishServiceImpl extends ServiceImpl<TbMyPublishMapper, TbMyP
|
|
|
private ITbFamilyService familyService;
|
|
|
|
|
|
/**
|
|
|
- * 我的近况详情
|
|
|
+ * 我的近况详情(登录人只能看好友和族友的点赞、评论)
|
|
|
* @param id
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public TbMyPublish getPublish(Long id) {
|
|
|
+ public TbMyPublish getPublish(Long id, Long appUserId) {
|
|
|
TbMyPublish publish = this.getById(id);
|
|
|
if (publish != null) {
|
|
|
Long familyId = null;
|
|
@@ -137,7 +137,7 @@ public class TbMyPublishServiceImpl extends ServiceImpl<TbMyPublishMapper, TbMyP
|
|
|
}
|
|
|
}
|
|
|
// 只能看好友和族友的点赞、评论
|
|
|
- List<Long> fids = getMyFrientIds(publish.getAppUserId(), familyId);
|
|
|
+ List<Long> fids = getMyFrientIds(appUserId, familyId);
|
|
|
|
|
|
// 图片列表
|
|
|
List<TbPublishImg> publishImgs = imgService.list(new LambdaQueryWrapper<TbPublishImg>()
|
|
@@ -179,6 +179,64 @@ public class TbMyPublishServiceImpl extends ServiceImpl<TbMyPublishMapper, TbMyP
|
|
|
return publish;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 会员的所有近况详情
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public TbMyPublish getPublish(Long id) {
|
|
|
+ TbMyPublish publish = this.getById(id);
|
|
|
+ if (publish != null) {
|
|
|
+ Long familyId = null;
|
|
|
+ TbFamilyMember member = memberService.getOne(new LambdaQueryWrapper<TbFamilyMember>()
|
|
|
+ .eq(TbFamilyMember::getAppUserId,publish.getAppUserId())
|
|
|
+ .last("limit 1")
|
|
|
+ );
|
|
|
+ if (member != null) {
|
|
|
+ TbFamily family = familyService.myFamily(member.getId());
|
|
|
+ if (family != null) {
|
|
|
+ familyId = family.getId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 图片列表
|
|
|
+ List<TbPublishImg> publishImgs = imgService.list(new LambdaQueryWrapper<TbPublishImg>()
|
|
|
+ .in(TbPublishImg::getPublishId, id)
|
|
|
+ );
|
|
|
+ // 点赞列表
|
|
|
+ List<TbPublishThumbs> thumbsList = thumbsService.selectList(new LambdaQueryWrapper<TbPublishThumbs>()
|
|
|
+ .in(TbPublishThumbs::getPublishId, id)
|
|
|
+ );
|
|
|
+ // 评论列表
|
|
|
+ List<TbPublishComment> commentList = commentService.selectList(new LambdaQueryWrapper<TbPublishComment>()
|
|
|
+ .in(TbPublishComment::getPublishId, id)
|
|
|
+ );
|
|
|
+ //点赞数
|
|
|
+ int thumbs = this.getThumbs(id);
|
|
|
+ //评论数
|
|
|
+ int comments = this.getComments(id);
|
|
|
+ TbAppUser userPublish = userService.getById(publish.getAppUserId());
|
|
|
+ if (userPublish != null) {
|
|
|
+ publish.setNickName(userPublish.getNickName());
|
|
|
+ publish.setAvatar(userPublish.getAvatar());
|
|
|
+ }
|
|
|
+ // 如果是留念人发表
|
|
|
+ if (publish.getMessageUserId() != null) {
|
|
|
+ TbAppUser user = userService.getById(publish.getMessageUserId());
|
|
|
+ if (user != null) {
|
|
|
+ publish.setMessageUser(user.getNickName());
|
|
|
+ publish.setMessageUserAvatar(user.getAvatar());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ publish.setImgList(publishImgs);
|
|
|
+ publish.setCommentList(commentList);
|
|
|
+ publish.setThumbsList(thumbsList);
|
|
|
+ publish.setThumbs(thumbs);
|
|
|
+ publish.setComments(comments);
|
|
|
+ }
|
|
|
+ return publish;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean delPublish(List<Long> ids){
|
|
|
List<TbMyPublish> publishList = baseMapper.selectList(new LambdaQueryWrapper<TbMyPublish>()
|