Search in sources :

Example 1 with BizComment

use of com.zyd.blog.persistence.beans.BizComment in project OneBlog by zhangyd-c.

the class BizCommentServiceImpl method findPageBreakByCondition.

/**
 * 分页查询
 *
 * @param vo
 * @return
 */
@Override
public PageInfo<Comment> findPageBreakByCondition(CommentConditionVO vo) {
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<BizComment> list = bizCommentMapper.findPageBreakByCondition(vo);
    List<Comment> boList = this.getComments(list);
    if (boList == null) {
        return null;
    }
    PageInfo bean = new PageInfo<BizComment>(list);
    bean.setList(boList);
    return bean;
}
Also used : Comment(com.zyd.blog.business.entity.Comment) BizComment(com.zyd.blog.persistence.beans.BizComment) BizComment(com.zyd.blog.persistence.beans.BizComment) PageInfo(com.github.pagehelper.PageInfo)

Example 2 with BizComment

use of com.zyd.blog.persistence.beans.BizComment in project OneBlog by zhangyd-c.

the class BizCommentServiceImpl method getByPrimaryKey.

@Override
public Comment getByPrimaryKey(Long primaryKey) {
    Assert.notNull(primaryKey, "PrimaryKey不可为空!");
    BizComment entity = bizCommentMapper.getById(primaryKey);
    return null == entity ? null : new Comment(entity);
}
Also used : Comment(com.zyd.blog.business.entity.Comment) BizComment(com.zyd.blog.persistence.beans.BizComment) BizComment(com.zyd.blog.persistence.beans.BizComment)

Example 3 with BizComment

use of com.zyd.blog.persistence.beans.BizComment in project OneBlog by zhangyd-c.

the class BizCommentServiceImpl method listRecentComment.

/**
 * 查询近期评论
 *
 * @param pageSize
 * @return
 */
@Override
@RedisCache
public List<Comment> listRecentComment(int pageSize) {
    CommentConditionVO vo = new CommentConditionVO();
    vo.setPageSize(pageSize);
    vo.setStatus(CommentStatusEnum.APPROVED.toString());
    PageHelper.startPage(vo.getPageNumber(), vo.getPageSize());
    List<BizComment> list = bizCommentMapper.findPageBreakByCondition(vo);
    return getComments(list);
}
Also used : CommentConditionVO(com.zyd.blog.business.vo.CommentConditionVO) BizComment(com.zyd.blog.persistence.beans.BizComment) RedisCache(com.zyd.blog.business.annotation.RedisCache)

Aggregations

BizComment (com.zyd.blog.persistence.beans.BizComment)3 Comment (com.zyd.blog.business.entity.Comment)2 PageInfo (com.github.pagehelper.PageInfo)1 RedisCache (com.zyd.blog.business.annotation.RedisCache)1 CommentConditionVO (com.zyd.blog.business.vo.CommentConditionVO)1