use of com.tale.model.dto.Comment 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;
}
use of com.tale.model.dto.Comment 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;
}