use of com.duan.blogos.dto.blogger.BlogListItemDTO in project BlogSystem by DuanJiaNing.
the class BloggerBlogServiceImpl method constructResult.
@Override
protected ResultBean<List<BlogListItemDTO>> constructResult(Map<Integer, Blog> blogHashMap, List<BlogStatistics> statistics, Map<Integer, int[]> blogIdMapCategoryIds, Map<Integer, String> blogImgs) {
// 重组结果
List<BlogListItemDTO> result = new ArrayList<>();
for (BlogStatistics s : statistics) {
Integer blogId = s.getBlogId();
int[] ids = blogIdMapCategoryIds.get(blogId);
List<BlogCategory> categories = CollectionUtils.isEmpty(ids) ? null : categoryDao.listCategoryById(ids);
Blog blog = blogHashMap.get(blogId);
BlogListItemDTO dto = dataFillingManager.bloggerBlogListItemToDTO(blog, s, categories);
result.add(dto);
}
return new ResultBean<>(result);
}
Aggregations