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