Commit 0e9421d1 authored by 刘基明's avatar 刘基明

修复评论查询

parent 57a31af8
......@@ -124,8 +124,9 @@ public class CommentService {
throw new BizException("评论未找到,id:" + commentId);
}
commentEntity.setReportStatus(ReportStatusEnum.REPORTED.getCode());
commentMapper.updateById(commentEntity);
redisCache.evict(StringUtils.joinWith("_", CAHCE_COMMENT_ID, commentId));
commentMapper.updateById(commentEntity);//失效缓存
redisCache.evict(StringUtils.joinWith("_", CACHE_COMMENT_THEMEID, commentEntity.getThemeId()));
redisCache.evict(StringUtils.joinWith("_", CACHE_THEME_ID, commentEntity.getThemeId()));
}
//删除评论
......@@ -137,8 +138,9 @@ public class CommentService {
}
commentEntity.setDeleteTag(DeleteTagEnum.DELETED.getCode());
commentMapper.updateById(commentEntity);
//删除主题的评论列表缓存
redisCache.evict(StringUtils.joinWith("_", CAHCE_COMMENT_ID, commentEntity.getThemeId()));
//失效缓存
redisCache.evict(StringUtils.joinWith("_", CACHE_COMMENT_THEMEID, commentEntity.getThemeId()));
redisCache.evict(StringUtils.joinWith("_", CACHE_THEME_ID, commentEntity.getThemeId()));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment