Search in sources :

Example 1 with BizCommentDTO

use of com.zyd.blog.business.dto.BizCommentDTO in project OneBlog by zhangyd-c.

the class BizCommentServiceImpl method convert2DTO.

private List<BizCommentDTO> convert2DTO(List<Comment> list) {
    if (CollectionUtils.isEmpty(list)) {
        return null;
    }
    List<BizCommentDTO> dtoList = new LinkedList<>();
    for (Comment comment : list) {
        BizCommentDTO dto = BeanConvertUtil.doConvert(comment, BizCommentDTO.class);
        dto.setParentDTO(BeanConvertUtil.doConvert(comment.getParent(), BizCommentDTO.class));
        if (null != comment.getUser()) {
            dto.setUserType(comment.getUser().getUserTypeEnum());
        }
        dtoList.add(dto);
    }
    return dtoList;
}
Also used : Comment(com.zyd.blog.business.entity.Comment) BizComment(com.zyd.blog.persistence.beans.BizComment) BizCommentDTO(com.zyd.blog.business.dto.BizCommentDTO)

Aggregations

BizCommentDTO (com.zyd.blog.business.dto.BizCommentDTO)1 Comment (com.zyd.blog.business.entity.Comment)1 BizComment (com.zyd.blog.persistence.beans.BizComment)1