use of com.duan.blogos.dto.blog.BlogCommentDTO in project BlogSystem by DuanJiaNing.
the class BlogBrowseServiceImpl method listBlogComment.
@Override
public ResultBean<List<BlogCommentDTO>> listBlogComment(int blogId, int offset, int rows) {
List<BlogCommentDTO> result = new ArrayList<>();
List<BlogComment> comments = commentDao.listCommentByBlogId(blogId, offset, rows, BlogCommentStatusEnum.RIGHTFUL.getCode());
for (BlogComment comment : comments) {
// 评论者数据
int sid = comment.getSpokesmanId();
BloggerAccount smAccount = accountDao.getAccountById(sid);
BloggerProfile smProfile = getProfile(sid);
BloggerDTO smDTO = dataFillingManager.bloggerAccountToDTO(smAccount, smProfile, getAvatar(smProfile.getAvatarId()));
BlogCommentDTO dto = dataFillingManager.blogCommentToDTO(comment, smDTO);
result.add(dto);
}
return CollectionUtils.isEmpty(result) ? null : new ResultBean<>(result);
}
Aggregations