🐛 修复自定义页面不显示评论条数的问题

pull/21/head
ruibaby 2018-07-14 00:17:09 +08:00
parent 15069ceb63
commit 77eae8bddf
2 changed files with 11 additions and 18 deletions

26
pom.xml
View File

@ -146,14 +146,6 @@
<version>${hutool-all.version}</version>
</dependency>
<!-- devtools热部署工具 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
<!-- 又拍云 -->
<dependency>
<groupId>com.upyun</groupId>
@ -172,18 +164,18 @@
<repositories>
<repository>
<id>nexus-aliyun</id>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</pluginRepository>
</pluginRepositories>
<profiles>
<!-- 生产环境打包配置 -->
<profile>

View File

@ -76,8 +76,9 @@ public class FrontPageController extends BaseController {
if(null==post){
return this.renderNotFound();
}
model.addAttribute("comments", CommentUtil.getComments(comments.getContent()));
model.addAttribute("post", post);
model.addAttribute("comments", CommentUtil.getComments(comments.getContent()));
model.addAttribute("commentsCount", comments.getTotalElements());
postService.updatePostView(post);
return this.render("page");
}