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