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

This commit is contained in:
jeromesoar 2022-05-12 17:21:26 +08:00
parent 937180c290
commit 0d017e4b1c
2 changed files with 19 additions and 49 deletions

View File

@ -1,30 +1,28 @@
package cn.iocoder.yudao.module.product.controller.admin.brand;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.product.controller.admin.brand.vo.*;
import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO;
import cn.iocoder.yudao.module.product.convert.brand.BrandConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.brand.BrandDO;
import cn.iocoder.yudao.module.product.service.brand.BrandService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Api(tags = "管理后台 - 品牌")
@RestController
@ -68,16 +66,6 @@ public class BrandController {
return success(BrandConvert.INSTANCE.convert(brand));
}
// TODO @JeromeSoar这个接口是不是没用哈
@GetMapping("/list")
@ApiOperation("获得品牌列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
@PreAuthorize("@ss.hasPermission('product:brand:query')")
public CommonResult<List<BrandRespVO>> getBrandList(@RequestParam("ids") Collection<Long> ids) {
List<BrandDO> list = brandService.getBrandList(ids);
return success(BrandConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得品牌分页")
@PreAuthorize("@ss.hasPermission('product:brand:query')")

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.product.controller.admin.category;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.product.controller.admin.category.vo.*;
@ -19,7 +18,6 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
@ -68,16 +66,8 @@ public class CategoryController {
return success(CategoryConvert.INSTANCE.convert(category));
}
// TODO @JeromeSoar这个接口是不是没用哈
@GetMapping("/listByIds")
@ApiOperation("获得商品分类列表")
@PreAuthorize("@ss.hasPermission('product:category:query')")
public CommonResult<List<CategoryRespVO>> getCategoryList(@RequestParam("ids") Collection<Long> ids) {
List<CategoryDO> list = categoryService.getCategoryList(ids);
return success(CategoryConvert.INSTANCE.convertList(list));
}
// TODO @JeromeSoar这应该是个 app 的接口提供商品分类的树结构这个调整下后端只返回列表前端构建 tree注意不需要返回创建时间是否开启等无关字段
// TODO @YunaiV: 这个是在管理端展示了一个类似菜单的分类树列表, treeListReqVO 只是查询参数的封装命名返给前端的是列表数据PS: 这里 /page 接口没有使用到
@GetMapping("/listByQuery")
@ApiOperation("获得商品分类列表")
@PreAuthorize("@ss.hasPermission('product:category:query')")
@ -87,14 +77,6 @@ public class CategoryController {
return success(CategoryConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@ApiOperation("获得商品分类分页")
@PreAuthorize("@ss.hasPermission('product:category:query')")
public CommonResult<PageResult<CategoryRespVO>> getCategoryPage(@Valid CategoryPageReqVO pageVO) {
PageResult<CategoryDO> pageResult = categoryService.getCategoryPage(pageVO);
return success(CategoryConvert.INSTANCE.convertPage(pageResult));
}
@GetMapping("/export-excel")
@ApiOperation("导出商品分类 Excel")
@PreAuthorize("@ss.hasPermission('product:category:export')")