Commit 2cc60deb973a38acd0148e341f832a6821a0cdec
1 parent
9632c33d
mall:code review 商品规格、规格值的代码
Showing
20 changed files
with
84 additions
and
154 deletions
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
| 1 | package cn.iocoder.yudao.module.product.controller.admin.property; | 1 | package cn.iocoder.yudao.module.product.controller.admin.property; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | ||
| 4 | -import org.springframework.web.bind.annotation.*; | ||
| 5 | -import javax.annotation.Resource; | ||
| 6 | -import org.springframework.validation.annotation.Validated; | 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; | ||
| 6 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyCreateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyPageReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyUpdateReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; | ||
| 10 | +import io.swagger.annotations.Api; | ||
| 11 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 12 | +import io.swagger.annotations.ApiOperation; | ||
| 7 | import org.springframework.security.access.prepost.PreAuthorize; | 13 | import org.springframework.security.access.prepost.PreAuthorize; |
| 8 | -import io.swagger.annotations.*; | 14 | +import org.springframework.validation.annotation.Validated; |
| 15 | +import org.springframework.web.bind.annotation.*; | ||
| 9 | 16 | ||
| 10 | -import javax.validation.*; | ||
| 11 | -import javax.servlet.http.*; | ||
| 12 | -import java.util.*; | ||
| 13 | -import java.io.IOException; | 17 | +import javax.annotation.Resource; |
| 18 | +import javax.validation.Valid; | ||
| 14 | 19 | ||
| 15 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 16 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 17 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 18 | 21 | ||
| 19 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | ||
| 20 | - | ||
| 21 | -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.property.vo.*; | ||
| 25 | -import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; | ||
| 26 | -import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; | ||
| 27 | - | ||
| 28 | @Api(tags = "管理后台 - 规格名称") | 22 | @Api(tags = "管理后台 - 规格名称") |
| 29 | @RestController | 23 | @RestController |
| 30 | @RequestMapping("/product/property") | 24 | @RequestMapping("/product/property") |
| @@ -66,15 +60,6 @@ public class ProductPropertyController { | @@ -66,15 +60,6 @@ public class ProductPropertyController { | ||
| 66 | return success(productPropertyService.getPropertyResp(id)); | 60 | return success(productPropertyService.getPropertyResp(id)); |
| 67 | } | 61 | } |
| 68 | 62 | ||
| 69 | - @GetMapping("/list") | ||
| 70 | - @ApiOperation("获得规格名称列表") | ||
| 71 | - @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | ||
| 72 | - @PreAuthorize("@ss.hasPermission('product:property:query')") | ||
| 73 | - public CommonResult<List<ProductPropertyAndValueRespVO>> getPropertyList(@RequestParam("ids") Collection<Long> ids) { | ||
| 74 | - List<ProductPropertyDO> list = productPropertyService.getPropertyList(ids); | ||
| 75 | - return success(ProductPropertyConvert.INSTANCE.convertList(list)); | ||
| 76 | - } | ||
| 77 | - | ||
| 78 | @GetMapping("/page") | 63 | @GetMapping("/page") |
| 79 | @ApiOperation("获得规格名称分页") | 64 | @ApiOperation("获得规格名称分页") |
| 80 | @PreAuthorize("@ss.hasPermission('product:property:query')") | 65 | @PreAuthorize("@ss.hasPermission('product:property:query')") |
| @@ -82,16 +67,4 @@ public class ProductPropertyController { | @@ -82,16 +67,4 @@ public class ProductPropertyController { | ||
| 82 | return success(productPropertyService.getPropertyListPage(pageVO)); | 67 | return success(productPropertyService.getPropertyListPage(pageVO)); |
| 83 | } | 68 | } |
| 84 | 69 | ||
| 85 | - @GetMapping("/export-excel") | ||
| 86 | - @ApiOperation("导出规格名称 Excel") | ||
| 87 | - @PreAuthorize("@ss.hasPermission('product:property:export')") | ||
| 88 | - @OperateLog(type = EXPORT) | ||
| 89 | - public void exportPropertyExcel(@Valid ProductPropertyExportReqVO exportReqVO, | ||
| 90 | - HttpServletResponse response) throws IOException { | ||
| 91 | - List<ProductPropertyDO> list = productPropertyService.getPropertyList(exportReqVO); | ||
| 92 | - // 导出 Excel | ||
| 93 | - List<ProductPropertyExcelVO> datas = ProductPropertyConvert.INSTANCE.convertList02(list); | ||
| 94 | - ExcelUtils.write(response, "规格名称.xls", "数据", ProductPropertyExcelVO.class, datas); | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | } | 70 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.annotations.*; | ||
| 6 | - | ||
| 7 | -import com.alibaba.excel.annotation.ExcelProperty; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 规格名称 Excel VO | ||
| 11 | - * | ||
| 12 | - * @author 芋道源码 | ||
| 13 | - */ | ||
| 14 | -@Data | ||
| 15 | -public class ProductPropertyExcelVO { | ||
| 16 | - | ||
| 17 | - @ExcelProperty("主键") | ||
| 18 | - private Long id; | ||
| 19 | - | ||
| 20 | - @ExcelProperty("规格名称") | ||
| 21 | - private String name; | ||
| 22 | - | ||
| 23 | - @ExcelProperty("状态: 0 开启 ,1 禁用") | ||
| 24 | - private Integer status; | ||
| 25 | - | ||
| 26 | - @ExcelProperty("创建时间") | ||
| 27 | - private Date createTime; | ||
| 28 | - | ||
| 29 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.annotations.*; | ||
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 7 | -import org.springframework.format.annotation.DateTimeFormat; | ||
| 8 | - | ||
| 9 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||
| 10 | - | ||
| 11 | -@ApiModel(value = "管理后台 - 规格名称 Excel 导出 Request VO", description = "参数和 PropertyPageReqVO 是一致的") | ||
| 12 | -@Data | ||
| 13 | -public class ProductPropertyExportReqVO { | ||
| 14 | - | ||
| 15 | - @ApiModelProperty(value = "规格名称") | ||
| 16 | - private String name; | ||
| 17 | - | ||
| 18 | - @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") | ||
| 19 | - private Integer status; | ||
| 20 | - | ||
| 21 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||
| 22 | - @ApiModelProperty(value = "创建时间") | ||
| 23 | - private Date[] createTime; | ||
| 24 | - | ||
| 25 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyAndValueRespVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyAndValueRespVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; | 3 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO; |
| 4 | import io.swagger.annotations.ApiModel; | 4 | import io.swagger.annotations.ApiModel; |
| 5 | import io.swagger.annotations.ApiModelProperty; | 5 | import io.swagger.annotations.ApiModelProperty; |
| 6 | import lombok.Data; | 6 | import lombok.Data; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyBaseVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyBaseVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModelProperty; | 3 | import io.swagger.annotations.ApiModelProperty; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | -// TODO @芋艿:完整的 review 下规格 | 6 | +import javax.validation.constraints.NotEmpty; |
| 7 | + | ||
| 7 | /** | 8 | /** |
| 8 | * 规格名称 Base VO,提供给添加、修改、详细的子 VO 使用 | 9 | * 规格名称 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 9 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| @@ -11,10 +12,12 @@ import lombok.Data; | @@ -11,10 +12,12 @@ import lombok.Data; | ||
| 11 | @Data | 12 | @Data |
| 12 | public class ProductPropertyBaseVO { | 13 | public class ProductPropertyBaseVO { |
| 13 | 14 | ||
| 14 | - @ApiModelProperty(value = "规格名称") | 15 | + @ApiModelProperty(value = "规格名称", required = true, example = "颜色") |
| 16 | + @NotEmpty(message = "规格名称不能为空") | ||
| 15 | private String name; | 17 | private String name; |
| 16 | 18 | ||
| 17 | - @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") | 19 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") |
| 20 | + @NotEmpty(message = "状态不能为空") | ||
| 18 | private Integer status; | 21 | private Integer status; |
| 19 | 22 | ||
| 20 | } | 23 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyCreateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; | 3 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | import io.swagger.annotations.*; | 5 | import io.swagger.annotations.*; |
| 6 | 6 | ||
| @@ -13,6 +13,7 @@ import java.util.List; | @@ -13,6 +13,7 @@ import java.util.List; | ||
| 13 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 14 | public class ProductPropertyCreateReqVO extends ProductPropertyBaseVO { | 14 | public class ProductPropertyCreateReqVO extends ProductPropertyBaseVO { |
| 15 | 15 | ||
| 16 | + // TODO @Luowenfeng:规格值的 CRUD 可以单独;前端 + 后端,改成类似字典类型、字典数据的这种交互;在加一个 ProductPropertyValueController | ||
| 16 | @ApiModelProperty(value = "属性值") | 17 | @ApiModelProperty(value = "属性值") |
| 17 | @NotNull(message = "属性值不能为空") | 18 | @NotNull(message = "属性值不能为空") |
| 18 | List<ProductPropertyValueCreateReqVO> propertyValueList; | 19 | List<ProductPropertyValueCreateReqVO> propertyValueList; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyPageReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.annotations.*; | ||
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | +import io.swagger.annotations.ApiModel; | ||
| 5 | +import io.swagger.annotations.ApiModelProperty; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.ToString; | ||
| 7 | import org.springframework.format.annotation.DateTimeFormat; | 9 | import org.springframework.format.annotation.DateTimeFormat; |
| 8 | 10 | ||
| 11 | +import java.util.Date; | ||
| 12 | + | ||
| 9 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 13 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 10 | 14 | ||
| 11 | @ApiModel("管理后台 - 规格名称分页 Request VO") | 15 | @ApiModel("管理后台 - 规格名称分页 Request VO") |
| @@ -14,10 +18,10 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -14,10 +18,10 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 14 | @ToString(callSuper = true) | 18 | @ToString(callSuper = true) |
| 15 | public class ProductPropertyPageReqVO extends PageParam { | 19 | public class ProductPropertyPageReqVO extends PageParam { |
| 16 | 20 | ||
| 17 | - @ApiModelProperty(value = "规格名称") | 21 | + @ApiModelProperty(value = "规格名称", example = "颜色") |
| 18 | private String name; | 22 | private String name; |
| 19 | 23 | ||
| 20 | - @ApiModelProperty(value = "状态: 0 开启 ,1 禁用") | 24 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") |
| 21 | private Integer status; | 25 | private Integer status; |
| 22 | 26 | ||
| 23 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | 27 | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyUpdateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/property/ProductPropertyUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.property; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; | 3 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | import io.swagger.annotations.*; | 5 | import io.swagger.annotations.*; |
| 6 | import javax.validation.constraints.*; | 6 | import javax.validation.constraints.*; |
| @@ -12,7 +12,7 @@ import java.util.List; | @@ -12,7 +12,7 @@ import java.util.List; | ||
| 12 | @ToString(callSuper = true) | 12 | @ToString(callSuper = true) |
| 13 | public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO { | 13 | public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO { |
| 14 | 14 | ||
| 15 | - @ApiModelProperty(value = "主键", required = true) | 15 | + @ApiModelProperty(value = "主键", required = true, example = "1") |
| 16 | @NotNull(message = "主键不能为空") | 16 | @NotNull(message = "主键不能为空") |
| 17 | private Long id; | 17 | private Long id; |
| 18 | 18 |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueBaseVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueBaseVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.annotations.*; | ||
| 6 | -import javax.validation.constraints.*; | 3 | +import io.swagger.annotations.ApiModelProperty; |
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import javax.validation.constraints.NotEmpty; | ||
| 7 | +import javax.validation.constraints.NotNull; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 规格值 Base VO,提供给添加、修改、详细的子 VO 使用 | 10 | * 规格值 Base VO,提供给添加、修改、详细的子 VO 使用 |
| @@ -12,13 +13,16 @@ import javax.validation.constraints.*; | @@ -12,13 +13,16 @@ import javax.validation.constraints.*; | ||
| 12 | @Data | 13 | @Data |
| 13 | public class ProductPropertyValueBaseVO { | 14 | public class ProductPropertyValueBaseVO { |
| 14 | 15 | ||
| 15 | - @ApiModelProperty(value = "规格键id") | 16 | + @ApiModelProperty(value = "规格编号", required = true, example = "1024") |
| 17 | + @NotNull(message = "规格编号不能为空") | ||
| 16 | private Long propertyId; | 18 | private Long propertyId; |
| 17 | 19 | ||
| 18 | - @ApiModelProperty(value = "规格值名字") | 20 | + @ApiModelProperty(value = "规格值名字", required = true, example = "红色") |
| 21 | + @NotEmpty(message = "规格值名字不能为空") | ||
| 19 | private String name; | 22 | private String name; |
| 20 | 23 | ||
| 21 | - @ApiModelProperty(value = "状态: 1 开启 ,2 禁用") | 24 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") |
| 25 | + @NotEmpty(message = "状态不能为空") | ||
| 22 | private Integer status; | 26 | private Integer status; |
| 23 | 27 | ||
| 24 | } | 28 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueCreateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueCreateReqVO.java
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueRespVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueRespVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; |
| 2 | 2 | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | ||
| 5 | -import io.swagger.annotations.*; | 3 | +import io.swagger.annotations.ApiModel; |
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | +import lombok.ToString; | ||
| 8 | + | ||
| 9 | +import java.util.Date; | ||
| 6 | 10 | ||
| 7 | @ApiModel("管理后台 - 规格值 Response VO") | 11 | @ApiModel("管理后台 - 规格值 Response VO") |
| 8 | @Data | 12 | @Data |
| @@ -10,7 +14,7 @@ import io.swagger.annotations.*; | @@ -10,7 +14,7 @@ import io.swagger.annotations.*; | ||
| 10 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 11 | public class ProductPropertyValueRespVO extends ProductPropertyValueBaseVO { | 15 | public class ProductPropertyValueRespVO extends ProductPropertyValueBaseVO { |
| 12 | 16 | ||
| 13 | - @ApiModelProperty(value = "主键", required = true) | 17 | + @ApiModelProperty(value = "主键", required = true, example = "10") |
| 14 | private Long id; | 18 | private Long id; |
| 15 | 19 | ||
| 16 | @ApiModelProperty(value = "创建时间") | 20 | @ApiModelProperty(value = "创建时间") |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/propertyvalue/vo/ProductPropertyValueUpdateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValueUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo; | 1 | +package cn.iocoder.yudao.module.product.controller.admin.property.vo.value; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| @@ -10,7 +10,7 @@ import javax.validation.constraints.*; | @@ -10,7 +10,7 @@ import javax.validation.constraints.*; | ||
| 10 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 11 | public class ProductPropertyValueUpdateReqVO extends ProductPropertyValueBaseVO { | 11 | public class ProductPropertyValueUpdateReqVO extends ProductPropertyValueBaseVO { |
| 12 | 12 | ||
| 13 | - @ApiModelProperty(value = "主键", required = true) | 13 | + @ApiModelProperty(value = "主键", required = true, example = "1024") |
| 14 | @NotNull(message = "主键不能为空") | 14 | @NotNull(message = "主键不能为空") |
| 15 | private Integer id; | 15 | private Integer id; |
| 16 | 16 |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/ProductPropertyConvert.java
| @@ -4,10 +4,13 @@ import java.util.*; | @@ -4,10 +4,13 @@ import java.util.*; | ||
| 4 | 4 | ||
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | ||
| 7 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; | ||
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyCreateReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyExcelVO; | ||
| 10 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyUpdateReqVO; | ||
| 7 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | 11 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 8 | import org.mapstruct.Mapper; | 12 | import org.mapstruct.Mapper; |
| 9 | import org.mapstruct.factory.Mappers; | 13 | import org.mapstruct.factory.Mappers; |
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | ||
| 11 | 14 | ||
| 12 | /** | 15 | /** |
| 13 | * 规格名称 Convert | 16 | * 规格名称 Convert |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/propertyvalue/ProductPropertyValueConvert.java
| @@ -4,10 +4,12 @@ import java.util.*; | @@ -4,10 +4,12 @@ import java.util.*; | ||
| 4 | 4 | ||
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | 6 | ||
| 7 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO; | ||
| 9 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueUpdateReqVO; | ||
| 7 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; | 10 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; |
| 8 | import org.mapstruct.Mapper; | 11 | import org.mapstruct.Mapper; |
| 9 | import org.mapstruct.factory.Mappers; | 12 | import org.mapstruct.factory.Mappers; |
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.*; | ||
| 11 | 13 | ||
| 12 | /** | 14 | /** |
| 13 | * 规格值 Convert | 15 | * 规格值 Convert |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/ProductPropertyMapper.java
| @@ -5,9 +5,10 @@ import java.util.*; | @@ -5,9 +5,10 @@ import java.util.*; | ||
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 6 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 7 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 7 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyExportReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyPageReqVO; | ||
| 8 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | 10 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 9 | import org.apache.ibatis.annotations.Mapper; | 11 | import org.apache.ibatis.annotations.Mapper; |
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * 规格名称 Mapper | 14 | * 规格名称 Mapper |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/propertyvalue/ProductPropertyValueMapper.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/ProductPropertyValueMapper.java
| 1 | -package cn.iocoder.yudao.module.product.dal.mysql.propertyvalue; | 1 | +package cn.iocoder.yudao.module.product.dal.mysql.property; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | 4 | import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java
| 1 | package cn.iocoder.yudao.module.product.service.property; | 1 | package cn.iocoder.yudao.module.product.service.property; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | 4 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; |
| 5 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.*; | ||
| 5 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | 6 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 6 | 7 | ||
| 7 | import javax.validation.Valid; | 8 | import javax.validation.Valid; |
| @@ -62,14 +63,6 @@ public interface ProductPropertyService { | @@ -62,14 +63,6 @@ public interface ProductPropertyService { | ||
| 62 | PageResult<ProductPropertyDO> getPropertyPage(ProductPropertyPageReqVO pageReqVO); | 63 | PageResult<ProductPropertyDO> getPropertyPage(ProductPropertyPageReqVO pageReqVO); |
| 63 | 64 | ||
| 64 | /** | 65 | /** |
| 65 | - * 获得规格名称列表, 用于 Excel 导出 | ||
| 66 | - * | ||
| 67 | - * @param exportReqVO 查询条件 | ||
| 68 | - * @return 规格名称列表 | ||
| 69 | - */ | ||
| 70 | - List<ProductPropertyDO> getPropertyList(ProductPropertyExportReqVO exportReqVO); | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | * 获取属性及属性值列表 分页 | 66 | * 获取属性及属性值列表 分页 |
| 74 | * @param pageReqVO | 67 | * @param pageReqVO |
| 75 | * @return | 68 | * @return |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java
| 1 | package cn.iocoder.yudao.module.product.service.property; | 1 | package cn.iocoder.yudao.module.product.service.property; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | ||
| 5 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueCreateReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; | 4 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; |
| 5 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.*; | ||
| 6 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueCreateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO; | ||
| 7 | import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; | 8 | import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; |
| 8 | import cn.iocoder.yudao.module.product.convert.propertyvalue.ProductPropertyValueConvert; | 9 | import cn.iocoder.yudao.module.product.convert.propertyvalue.ProductPropertyValueConvert; |
| 9 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | 10 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 10 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; | 11 | import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyValueDO; |
| 11 | import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyMapper; | 12 | import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyMapper; |
| 12 | -import cn.iocoder.yudao.module.product.dal.mysql.propertyvalue.ProductPropertyValueMapper; | 13 | +import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyValueMapper; |
| 13 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 14 | import org.springframework.transaction.annotation.Transactional; | 15 | import org.springframework.transaction.annotation.Transactional; |
| 15 | import org.springframework.validation.annotation.Validated; | 16 | import org.springframework.validation.annotation.Validated; |
| @@ -103,11 +104,6 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { | @@ -103,11 +104,6 @@ public class ProductPropertyServiceImpl implements ProductPropertyService { | ||
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | @Override | 106 | @Override |
| 106 | - public List<ProductPropertyDO> getPropertyList(ProductPropertyExportReqVO exportReqVO) { | ||
| 107 | - return productPropertyMapper.selectList(exportReqVO); | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - @Override | ||
| 111 | public PageResult<ProductPropertyAndValueRespVO> getPropertyListPage(ProductPropertyPageReqVO pageReqVO) { | 107 | public PageResult<ProductPropertyAndValueRespVO> getPropertyListPage(ProductPropertyPageReqVO pageReqVO) { |
| 112 | //获取属性列表 | 108 | //获取属性列表 |
| 113 | PageResult<ProductPropertyDO> pageResult = productPropertyMapper.selectPage(pageReqVO); | 109 | PageResult<ProductPropertyDO> pageResult = productPropertyMapper.selectPage(pageReqVO); |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/sku/ProductSkuServiceImpl.java
| @@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollectionUtil; | @@ -4,8 +4,8 @@ import cn.hutool.core.collection.CollectionUtil; | ||
| 4 | import cn.hutool.core.util.ObjectUtil; | 4 | import cn.hutool.core.util.ObjectUtil; |
| 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 6 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 7 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyAndValueRespVO; | ||
| 8 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; | 7 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; |
| 8 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO; | ||
| 9 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO; | 9 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO; |
| 10 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; | 10 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; |
| 11 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuPageReqVO; | 11 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuPageReqVO; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/spu/ProductSpuServiceImpl.java
| @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.product.service.spu; | @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.product.service.spu; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | 4 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 5 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyAndValueRespVO; | 5 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.property.ProductPropertyAndValueRespVO; |
| 6 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyViewRespVO; | 6 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyViewRespVO; |
| 7 | -import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.ProductPropertyValueRespVO; | 7 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.value.ProductPropertyValueRespVO; |
| 8 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO; | 8 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuBaseVO; |
| 9 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; | 9 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuCreateOrUpdateReqVO; |
| 10 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuRespVO; | 10 | import cn.iocoder.yudao.module.product.controller.admin.sku.vo.ProductSkuRespVO; |