Search in sources :

Example 1 with Comments

use of com.tale.model.entity.Comments in project tale by otale.

the class IndexController method index.

/**
 * 仪表盘
 */
@GetRoute(value = { "/", "index" })
public String index(Request request) {
    List<Comments> comments = siteService.recentComments(5);
    List<Contents> contents = siteService.getContens(Types.RECENT_ARTICLE, 5);
    Statistics statistics = siteService.getStatistics();
    request.attribute("comments", comments);
    request.attribute("articles", contents);
    request.attribute("statistics", statistics);
    return "admin/index";
}
Also used : Contents(com.tale.model.entity.Contents) Comments(com.tale.model.entity.Comments) Statistics(com.tale.model.dto.Statistics) GetRoute(com.blade.mvc.annotation.GetRoute)

Example 2 with Comments

use of com.tale.model.entity.Comments in project tale by otale.

the class CommentsService method apply.

private Comment apply(Comments parent) {
    Comment comment = new Comment(parent);
    List<Comments> children = new ArrayList<>();
    getChildren(children, comment.getCoid());
    comment.setChildren(children);
    if (BladeKit.isNotEmpty(children)) {
        comment.setLevels(1);
    }
    return comment;
}
Also used : Comment(com.tale.model.dto.Comment) Comments(com.tale.model.entity.Comments) ArrayList(java.util.ArrayList)

Aggregations

Comments (com.tale.model.entity.Comments)2 GetRoute (com.blade.mvc.annotation.GetRoute)1 Comment (com.tale.model.dto.Comment)1 Statistics (com.tale.model.dto.Statistics)1 Contents (com.tale.model.entity.Contents)1 ArrayList (java.util.ArrayList)1