Search in sources :

Example 1 with BloggerLinkDTO

use of com.duan.blogos.dto.blogger.BloggerLinkDTO in project BlogSystem by DuanJiaNing.

the class BloggerLinkServiceImpl method listBloggerLink.

@Override
public ResultBean<List<BloggerLinkDTO>> listBloggerLink(int bloggerId, int offset, int rows) {
    List<BloggerLink> list = linkDao.listBlogLinkByBloggerId(bloggerId, offset, rows);
    List<BloggerLinkDTO> result = new ArrayList<>();
    for (BloggerLink link : list) {
        Integer iconId = link.getIconId();
        BloggerPicture icon = iconId == null ? pictureDao.getBloggerUniquePicture(bloggerProperties.getPictureManagerBloggerId(), DEFAULT_BLOGGER_LINK_ICON.getCode()) : pictureDao.getPictureById(iconId);
        icon.setPath(constructorManager.constructPictureUrl(icon, DEFAULT_BLOGGER_LINK_ICON));
        BloggerLinkDTO dto = fillingManager.bloggerLinkToDTO(link, icon);
        result.add(dto);
    }
    return CollectionUtils.isEmpty(result) ? null : new ResultBean<>(result);
}
Also used : BloggerLink(com.duan.blogos.entity.blogger.BloggerLink) BloggerLinkDTO(com.duan.blogos.dto.blogger.BloggerLinkDTO) BloggerPicture(com.duan.blogos.entity.blogger.BloggerPicture) ArrayList(java.util.ArrayList)

Aggregations

BloggerLinkDTO (com.duan.blogos.dto.blogger.BloggerLinkDTO)1 BloggerLink (com.duan.blogos.entity.blogger.BloggerLink)1 BloggerPicture (com.duan.blogos.entity.blogger.BloggerPicture)1 ArrayList (java.util.ArrayList)1