Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
saysky committed Oct 16, 2019
1 parent e1fccbc commit 89a9d76
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,11 @@ public String getPost(@PathVariable Long postId,
model.addAttribute("isAuthor", Boolean.TRUE);
}

model.addAttribute("sameCategoryPosts", sameCategoryPosts);
model.addAttribute("post", post);
model.addAttribute("rainbow", commentPage.getRainbow());
model.addAttribute("comments", commentPage.getCommentListPage());
model.addAttribute("tagWords", CollUtil.join(tagWords, ","));

//侧边栏
model.addAttribute("sidebarType", SidebarTypeEnum.DETAIL.getValue());
User user = userService.get(post.getUserId());
if (user != null) {
post.setUser(user);
//该用户的文章数
user.setPostCount(postService.countByUserId(user.getId()));
//该用户的评论数
Expand All @@ -136,6 +131,13 @@ public String getPost(@PathVariable Long postId,
model.addAttribute("tagRanking", tagService.getTagRankingByUserId(user.getId(), 100));
model.addAttribute("postRanking", postService.getPostRankingByUserIdAndPostView(user.getId(), 10));
}

//文章相关
model.addAttribute("sameCategoryPosts", sameCategoryPosts);
model.addAttribute("post", post);
model.addAttribute("rainbow", commentPage.getRainbow());
model.addAttribute("comments", commentPage.getCommentListPage());
model.addAttribute("tagWords", CollUtil.join(tagWords, ","));
return this.render("post");
}

Expand Down

0 comments on commit 89a9d76

Please sign in to comment.