|
@@ -119,16 +119,36 @@ public class TbMyPublishServiceImpl extends ServiceImpl<TbMyPublishMapper, TbMyP
|
|
|
public TbMyPublish getPublish(Long id) {
|
|
|
TbMyPublish publish = this.getById(id);
|
|
|
if (publish != null) {
|
|
|
+ // 图片列表
|
|
|
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());
|
|
|
publish.setMessageUser(user.getNickName());
|
|
|
+ publish.setMessageUserAvatar(user.getAvatar());
|
|
|
}
|
|
|
publish.setImgList(publishImgs);
|
|
|
+ publish.setCommentList(commentList);
|
|
|
+ publish.setThumbsList(thumbsList);
|
|
|
publish.setThumbs(thumbs);
|
|
|
publish.setComments(comments);
|
|
|
}
|