| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public ApiResponse<PageData<Category>> findPage (@RequestBody PageWrap<Category> pageWrap) { |
| | | return ApiResponse.success(categoryService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/list") |
| | | @RequiresPermissions("business:category:query") |
| | | public ApiResponse<List<Category>> findList (@RequestBody Category pageWrap) { |
| | | return ApiResponse.success(categoryService.findList(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:category:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Category> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Category.class).exportData(categoryService.findPage(pageWrap).getRecords(), "分类信息表", response); |
| | | ExcelExporter.build(Category.class).export(categoryService.findPage(pageWrap).getRecords(), "分类信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(categoryService.findById(id)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("分类树查询") |
| | | @PostMapping("/tree") |
| | | @RequiresPermissions("business:category:query") |
| | | public ApiResponse<List<Category>> tree (@RequestBody Category param){ |
| | | return ApiResponse.success(categoryService.treeList(param)); |
| | | } |
| | | |
| | | } |