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;
}
Aggregations