集成redis & task
This commit is contained in:
@@ -117,11 +117,9 @@ public class BlogController {
|
||||
@GetMapping("/blog/read/{bid}")
|
||||
public String read(@PathVariable("bid") String bid,Model model){
|
||||
Blog blog = blogService.getOne(new QueryWrapper<Blog>().eq("bid", bid));
|
||||
// todo: redis缓存. 防止阅读重复
|
||||
blog.setViews(blog.getViews()+1);
|
||||
blogService.updateById(blog);
|
||||
model.addAttribute("blog",blog);
|
||||
// todo: 查询评论
|
||||
List<Comment> commentList = commentService.list(new QueryWrapper<Comment>().eq("topic_id", bid).orderByDesc("gmt_create"));
|
||||
model.addAttribute("commentList",commentList);
|
||||
return "blog/read";
|
||||
|
||||
Reference in New Issue
Block a user