Skip to content

fix: 修复blogs接口在手动删除redis数据库后抛出异常错误500问题 #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -26,10 +26,7 @@
import top.naccl.util.markdown.MarkdownUtils;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;

/**
* @Description: 博客文章业务层实现
@@ -130,7 +127,8 @@ public PageResult<BlogInfo> getBlogInfoListByIsPublished(Integer pageNum) {
PageHelper.startPage(pageNum, pageSize, orderBy);
List<BlogInfo> blogInfos = processBlogInfosPassword(blogMapper.getBlogInfoListByIsPublished());
PageInfo<BlogInfo> pageInfo = new PageInfo<>(blogInfos);
PageResult<BlogInfo> pageResult = new PageResult<>(pageInfo.getPages(), pageInfo.getList());
// PageResult<BlogInfo> pageResult = new PageResult<>(pageInfo.getPages(), pageInfo.getList());
PageResult<BlogInfo> pageResult = new PageResult<>(pageInfo.getPages(), new ArrayList<>(pageInfo.getList()));
setBlogViewsFromRedisToPageResult(pageResult);
//添加首页缓存
redisService.saveKVToHash(redisKey, pageNum, pageResult);