diff --git a/aurora-springboot/src/main/java/com/aurora/service/impl/ArticleServiceImpl.java b/aurora-springboot/src/main/java/com/aurora/service/impl/ArticleServiceImpl.java index 047491a4719ea5084f16c8e63956b9950cd63d12..b2370ea0f4629e2424d35a7b8628952dbe477a2b 100644 --- a/aurora-springboot/src/main/java/com/aurora/service/impl/ArticleServiceImpl.java +++ b/aurora-springboot/src/main/java/com/aurora/service/impl/ArticleServiceImpl.java @@ -99,9 +99,13 @@ public class ArticleServiceImpl extends ServiceImpl impl public PageResultDTO listArticles() { LambdaQueryWrapper
queryWrapper = new LambdaQueryWrapper
() .eq(Article::getIsDelete, 0) - .eq(Article::getStatus, 1); + .in(Article::getStatus, 1 , 2); CompletableFuture asyncCount = CompletableFuture.supplyAsync(() -> articleMapper.selectCount(queryWrapper)); List articles = articleMapper.listArticles(PageUtil.getLimitCurrent(), PageUtil.getSize()); + // 加密文章内容 + articles.stream() + .filter(article -> article.getStatus() == 2) + .forEach(article -> article.setArticleContent("加密文章,输入密码访问")); return new PageResultDTO<>(articles, asyncCount.get()); }