Search in sources :

Example 1 with BloggerCategoryDTO

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

the class BloggerBlogCategoryController method get.

/**
 * 查看指定类别
 */
@RequestMapping(value = "/{categoryId}", method = RequestMethod.GET)
public ResultBean<BloggerCategoryDTO> get(HttpServletRequest request, @PathVariable Integer bloggerId, @PathVariable Integer categoryId) {
    handleAccountCheck(request, bloggerId);
    handleCategoryExistCheck(request, bloggerId, categoryId);
    BloggerCategoryDTO dto = bloggerCategoryService.getCategory(bloggerId, categoryId);
    if (dto == null)
        handlerOperateFail(request);
    return new ResultBean<>(dto);
}
Also used : BloggerCategoryDTO(com.duan.blogos.dto.blogger.BloggerCategoryDTO) ResultBean(com.duan.blogos.restful.ResultBean)

Example 2 with BloggerCategoryDTO

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

the class BloggerCategoryServiceImpl method listBlogCategory.

@Override
public ResultBean<List<BloggerCategoryDTO>> listBlogCategory(int bloggerId, int offset, int rows) {
    List<BlogCategory> categories = categoryDao.listCategoryByBloggerId(bloggerId, offset, rows);
    if (CollectionUtils.isEmpty(categories))
        return null;
    List<BloggerCategoryDTO> result = new ArrayList<>();
    for (BlogCategory category : categories) {
        result.add(getBloggerCategoryDTO(bloggerId, category));
    }
    return new ResultBean<>(result);
}
Also used : BlogCategory(com.duan.blogos.entity.blog.BlogCategory) BloggerCategoryDTO(com.duan.blogos.dto.blogger.BloggerCategoryDTO) ArrayList(java.util.ArrayList) ResultBean(com.duan.blogos.restful.ResultBean)

Aggregations

BloggerCategoryDTO (com.duan.blogos.dto.blogger.BloggerCategoryDTO)2 ResultBean (com.duan.blogos.restful.ResultBean)2 BlogCategory (com.duan.blogos.entity.blog.BlogCategory)1 ArrayList (java.util.ArrayList)1