|
@@ -111,6 +111,10 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
|
|
|
@Autowired
|
|
|
private CommunityUserPromptMapper communityUserPromptMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private CommunityArticleCollectMapper communityArticleCollectMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询文章列表
|
|
|
*
|
|
@@ -879,6 +883,38 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
return communityUserPromptVos;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<CommunityArticleVo> selectUserLike(int pageNum, int pageSize, int searchType) {
|
|
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
+ // 查询自己的通知列表
|
|
|
+ List<CommunityLike> communityUserLike
|
|
|
+ = communityLikeMapper
|
|
|
+ .selectList(new QueryWrapper<CommunityLike>().eq("user_id", userId));
|
|
|
+ List<Long> articleIds = communityUserLike.stream().map(item -> item.getArticleId()).collect(Collectors.toList());
|
|
|
+ TableDataInfo rspData = new TableDataInfo();
|
|
|
+ CommunityArticle communityArticle = new CommunityArticle();
|
|
|
+ communityArticle.setArticleIds(articleIds);
|
|
|
+ List<CommunityArticleVo> communityArticleVos = communityArticleService.selectCommunityArticleList(rspData, communityArticle, pageNum, pageSize, searchType);
|
|
|
+ return communityArticleVos;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<CommunityArticleVo> selectUserCollect(int pageNum, int pageSize, int searchType) {
|
|
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
+ // 查询自己的通知列表
|
|
|
+ List<CommunityArticleCollect> communityArticleCollects
|
|
|
+ = communityArticleCollectMapper
|
|
|
+ .selectList(new QueryWrapper<CommunityArticleCollect>().eq("user_id", userId));
|
|
|
+
|
|
|
+
|
|
|
+ List<Long> articleIds = communityArticleCollects.stream().map(item -> item.getArticleId()).collect(Collectors.toList());
|
|
|
+ TableDataInfo rspData = new TableDataInfo();
|
|
|
+ CommunityArticle communityArticle = new CommunityArticle();
|
|
|
+ communityArticle.setArticleIds(articleIds);
|
|
|
+ List<CommunityArticleVo> communityArticleVos = communityArticleService.selectCommunityArticleList(rspData, communityArticle, pageNum, pageSize, searchType);
|
|
|
+ return communityArticleVos;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 判断是否是视频文件
|
|
|
*
|