Search in sources :

Example 1 with Page

use of io.github.biezhi.anima.page.Page in project tale by otale.

the class Theme method comments.

/**
 * 获取当前文章/页面的评论
 *
 * @param limit
 * @return
 */
public static Page<Comment> comments(int limit) {
    Contents contents = current_article();
    if (null == contents) {
        return new Page<>();
    }
    InterpretContext ctx = InterpretContext.current();
    Object value = ctx.getValueStack().getValue("cp");
    int page = 1;
    if (null != value) {
        page = (int) value;
    }
    Page<Comment> comments = siteService.getComments(contents.getCid(), page, limit);
    return comments;
}
Also used : Comment(com.tale.model.dto.Comment) Contents(com.tale.model.entity.Contents) InterpretContext(jetbrick.template.runtime.InterpretContext) Page(io.github.biezhi.anima.page.Page)

Aggregations

Comment (com.tale.model.dto.Comment)1 Contents (com.tale.model.entity.Contents)1 Page (io.github.biezhi.anima.page.Page)1 InterpretContext (jetbrick.template.runtime.InterpretContext)1