Commit 0d017e4b1cd1afcc43c4566a9b6aadbed0091260

Authored by jeromesoar
1 parent 937180c2

fix: 删除品牌和分类的无用接口

yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/brand/BrandController.java
1 package cn.iocoder.yudao.module.product.controller.admin.brand; 1 package cn.iocoder.yudao.module.product.controller.admin.brand;
2 2
3 -import org.springframework.web.bind.annotation.*;  
4 -import javax.annotation.Resource;  
5 -import org.springframework.validation.annotation.Validated;  
6 -import org.springframework.security.access.prepost.PreAuthorize;  
7 -import io.swagger.annotations.*;  
8 -  
9 -import javax.validation.constraints.*;  
10 -import javax.validation.*;  
11 -import javax.servlet.http.*;  
12 -import java.util.*;  
13 -import java.io.IOException;  
14 -  
15 -import cn.iocoder.yudao.framework.common.pojo.PageResult;  
16 import cn.iocoder.yudao.framework.common.pojo.CommonResult; 3 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
17 -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;  
18 - 4 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
19 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; 5 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
20 -  
21 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; 6 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
22 -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;  
23 -  
24 import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*; 7 import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*;
25 -import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO;  
26 import cn.iocoder.yudao.module.product.convert.brand.BrandConvert; 8 import cn.iocoder.yudao.module.product.convert.brand.BrandConvert;
  9 +import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO;
27 import cn.iocoder.yudao.module.product.service.brand.BrandService; 10 import cn.iocoder.yudao.module.product.service.brand.BrandService;
  11 +import io.swagger.annotations.Api;
  12 +import io.swagger.annotations.ApiImplicitParam;
  13 +import io.swagger.annotations.ApiOperation;
  14 +import org.springframework.security.access.prepost.PreAuthorize;
  15 +import org.springframework.validation.annotation.Validated;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import javax.annotation.Resource;
  19 +import javax.servlet.http.HttpServletResponse;
  20 +import javax.validation.Valid;
  21 +import java.io.IOException;
  22 +import java.util.List;
  23 +
  24 +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
  25 +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
28 26
29 @Api(tags = "管理后台 - 品牌") 27 @Api(tags = "管理后台 - 品牌")
30 @RestController 28 @RestController
@@ -68,16 +66,6 @@ public class BrandController { @@ -68,16 +66,6 @@ public class BrandController {
68 return success(BrandConvert.INSTANCE.convert(brand)); 66 return success(BrandConvert.INSTANCE.convert(brand));
69 } 67 }
70 68
71 - // TODO @JeromeSoar:这个接口,是不是没用哈  
72 - @GetMapping("/list")  
73 - @ApiOperation("获得品牌列表")  
74 - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)  
75 - @PreAuthorize("@ss.hasPermission('product:brand:query')")  
76 - public CommonResult<List<BrandRespVO>> getBrandList(@RequestParam("ids") Collection<Long> ids) {  
77 - List<BrandDO> list = brandService.getBrandList(ids);  
78 - return success(BrandConvert.INSTANCE.convertList(list));  
79 - }  
80 -  
81 @GetMapping("/page") 69 @GetMapping("/page")
82 @ApiOperation("获得品牌分页") 70 @ApiOperation("获得品牌分页")
83 @PreAuthorize("@ss.hasPermission('product:brand:query')") 71 @PreAuthorize("@ss.hasPermission('product:brand:query')")
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/category/CategoryController.java
1 package cn.iocoder.yudao.module.product.controller.admin.category; 1 package cn.iocoder.yudao.module.product.controller.admin.category;
2 2
3 import cn.iocoder.yudao.framework.common.pojo.CommonResult; 3 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
4 -import cn.iocoder.yudao.framework.common.pojo.PageResult;  
5 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; 4 import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
6 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; 5 import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
7 import cn.iocoder.yudao.module.product.controller.admin.category.vo.*; 6 import cn.iocoder.yudao.module.product.controller.admin.category.vo.*;
@@ -19,7 +18,6 @@ import javax.annotation.Resource; @@ -19,7 +18,6 @@ import javax.annotation.Resource;
19 import javax.servlet.http.HttpServletResponse; 18 import javax.servlet.http.HttpServletResponse;
20 import javax.validation.Valid; 19 import javax.validation.Valid;
21 import java.io.IOException; 20 import java.io.IOException;
22 -import java.util.Collection;  
23 import java.util.Comparator; 21 import java.util.Comparator;
24 import java.util.List; 22 import java.util.List;
25 23
@@ -68,16 +66,8 @@ public class CategoryController { @@ -68,16 +66,8 @@ public class CategoryController {
68 return success(CategoryConvert.INSTANCE.convert(category)); 66 return success(CategoryConvert.INSTANCE.convert(category));
69 } 67 }
70 68
71 - // TODO @JeromeSoar:这个接口,是不是没用哈  
72 - @GetMapping("/listByIds")  
73 - @ApiOperation("获得商品分类列表")  
74 - @PreAuthorize("@ss.hasPermission('product:category:query')")  
75 - public CommonResult<List<CategoryRespVO>> getCategoryList(@RequestParam("ids") Collection<Long> ids) {  
76 - List<CategoryDO> list = categoryService.getCategoryList(ids);  
77 - return success(CategoryConvert.INSTANCE.convertList(list));  
78 - }  
79 -  
80 // TODO @JeromeSoar:这应该是个 app 的接口,提供商品分类的树结构。这个调整下,后端只返回列表,前端构建 tree。注意,不需要返回创建时间、是否开启等无关字段。 69 // TODO @JeromeSoar:这应该是个 app 的接口,提供商品分类的树结构。这个调整下,后端只返回列表,前端构建 tree。注意,不需要返回创建时间、是否开启等无关字段。
  70 + // TODO @YunaiV: 这个是在管理端展示了一个类似菜单的分类树列表, treeListReqVO 只是查询参数的封装命名,返给前端的是列表数据。PS: 这里 /page 接口没有使用到。
81 @GetMapping("/listByQuery") 71 @GetMapping("/listByQuery")
82 @ApiOperation("获得商品分类列表") 72 @ApiOperation("获得商品分类列表")
83 @PreAuthorize("@ss.hasPermission('product:category:query')") 73 @PreAuthorize("@ss.hasPermission('product:category:query')")
@@ -86,15 +76,7 @@ public class CategoryController { @@ -86,15 +76,7 @@ public class CategoryController {
86 list.sort(Comparator.comparing(CategoryDO::getSort)); 76 list.sort(Comparator.comparing(CategoryDO::getSort));
87 return success(CategoryConvert.INSTANCE.convertList(list)); 77 return success(CategoryConvert.INSTANCE.convertList(list));
88 } 78 }
89 -  
90 - @GetMapping("/page")  
91 - @ApiOperation("获得商品分类分页")  
92 - @PreAuthorize("@ss.hasPermission('product:category:query')")  
93 - public CommonResult<PageResult<CategoryRespVO>> getCategoryPage(@Valid CategoryPageReqVO pageVO) {  
94 - PageResult<CategoryDO> pageResult = categoryService.getCategoryPage(pageVO);  
95 - return success(CategoryConvert.INSTANCE.convertPage(pageResult));  
96 - }  
97 - 79 +
98 @GetMapping("/export-excel") 80 @GetMapping("/export-excel")
99 @ApiOperation("导出商品分类 Excel") 81 @ApiOperation("导出商品分类 Excel")
100 @PreAuthorize("@ss.hasPermission('product:category:export')") 82 @PreAuthorize("@ss.hasPermission('product:category:export')")