|
@@ -1,30 +1,24 @@
|
|
|
package cn.iocoder.yudao.module.product.controller.admin.property;
|
|
|
|
|
|
-import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import javax.annotation.Resource;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
+import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO;
|
|
|
+import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyCreateReqVO;
|
|
|
+import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyPageReqVO;
|
|
|
+import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyUpdateReqVO;
|
|
|
+import cn.iocoder.yudao.module.product.service.property.ProductPropertyService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
-import io.swagger.annotations.*;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.validation.*;
|
|
|
-import javax.servlet.http.*;
|
|
|
-import java.util.*;
|
|
|
-import java.io.IOException;
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.validation.Valid;
|
|
|
|
|
|
-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.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.property.vo.*;
|
|
|
-import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert;
|
|
|
-import cn.iocoder.yudao.module.product.service.property.ProductPropertyService;
|
|
|
-
|
|
|
@Api(tags = "管理后台 - 规格名称")
|
|
|
@RestController
|
|
|
@RequestMapping("/product/property")
|
|
@@ -66,15 +60,6 @@ public class ProductPropertyController {
|
|
|
return success(productPropertyService.getPropertyResp(id));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/list")
|
|
|
- @ApiOperation("获得规格名称列表")
|
|
|
- @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
|
|
|
- @PreAuthorize("@ss.hasPermission('product:property:query')")
|
|
|
- public CommonResult<List<ProductPropertyAndValueRespVO>> getPropertyList(@RequestParam("ids") Collection<Long> ids) {
|
|
|
- List<ProductPropertyDO> list = productPropertyService.getPropertyList(ids);
|
|
|
- return success(ProductPropertyConvert.INSTANCE.convertList(list));
|
|
|
- }
|
|
|
-
|
|
|
@GetMapping("/page")
|
|
|
@ApiOperation("获得规格名称分页")
|
|
|
@PreAuthorize("@ss.hasPermission('product:property:query')")
|
|
@@ -82,16 +67,4 @@ public class ProductPropertyController {
|
|
|
return success(productPropertyService.getPropertyListPage(pageVO));
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/export-excel")
|
|
|
- @ApiOperation("导出规格名称 Excel")
|
|
|
- @PreAuthorize("@ss.hasPermission('product:property:export')")
|
|
|
- @OperateLog(type = EXPORT)
|
|
|
- public void exportPropertyExcel(@Valid ProductPropertyExportReqVO exportReqVO,
|
|
|
- HttpServletResponse response) throws IOException {
|
|
|
- List<ProductPropertyDO> list = productPropertyService.getPropertyList(exportReqVO);
|
|
|
- // 导出 Excel
|
|
|
- List<ProductPropertyExcelVO> datas = ProductPropertyConvert.INSTANCE.convertList02(list);
|
|
|
- ExcelUtils.write(response, "规格名称.xls", "数据", ProductPropertyExcelVO.class, datas);
|
|
|
- }
|
|
|
-
|
|
|
}
|