| | |
| | | import com.mzl.flower.dto.response.flower.FlowerCategoryDTO; |
| | | import com.mzl.flower.dto.response.flower.FlowerCategoryTreeDTO; |
| | | import com.mzl.flower.service.flower.FlowerCategoryService; |
| | | import com.mzl.flower.service.flower.FlowerService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | @Autowired |
| | | private FlowerCategoryService categoryService; |
| | | |
| | | @Autowired |
| | | private FlowerService flowerService; |
| | | |
| | | @PostMapping("/tree/new") |
| | | @ApiOperation(value = "新增商品分类") |
| | | public ResponseEntity<ReturnDataDTO> addCategory(@RequestBody FlowerCategoryCreateDTO dto) { |
| | |
| | | @PostMapping("/tree/edit") |
| | | @ApiOperation(value = "编辑商品分类") |
| | | public ResponseEntity<ReturnDataDTO> updateCategory(@RequestBody FlowerCategoryUpdateDTO dto) { |
| | | return returnData(R.SUCCESS.getCode(), categoryService.updateCategory(dto)); |
| | | Long category = categoryService.updateCategory(dto); |
| | | flowerService.updateCategoryInfo(category); |
| | | return returnData(R.SUCCESS.getCode(), category); |
| | | } |
| | | |
| | | @GetMapping("/tree/view") |
| | |
| | | return returnData(R.SUCCESS.getCode(), categoryService.selectCategoryTree(dto)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "获取商品分类列表") |
| | | public ResponseEntity<ReturnDataDTO<List<FlowerCategoryTreeDTO>>> selectCategoryList(FlowerCategoryQueryDTO dto){ |
| | | return returnData(R.SUCCESS.getCode(), categoryService.selectCategoryList(dto)); |
| | | } |
| | | |
| | | @GetMapping("/tree/delete") |
| | | @ApiOperation(value = "删除商品分类") |
| | | @ApiImplicitParams({ |