Commit 733a3c4615cf7e6ee23e0a16e2c74f4201e9389e
1 parent
9dad9e55
商品规格实体类增加Product前缀
Showing
15 changed files
with
113 additions
and
115 deletions
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/PropertyController.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/ProductPropertyController.java
100755 → 100644
| 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; | ||
| 3 | import org.springframework.web.bind.annotation.*; | 4 | import org.springframework.web.bind.annotation.*; |
| 4 | import javax.annotation.Resource; | 5 | import javax.annotation.Resource; |
| 5 | import org.springframework.validation.annotation.Validated; | 6 | import org.springframework.validation.annotation.Validated; |
| 6 | import org.springframework.security.access.prepost.PreAuthorize; | 7 | import org.springframework.security.access.prepost.PreAuthorize; |
| 7 | import io.swagger.annotations.*; | 8 | import io.swagger.annotations.*; |
| 8 | 9 | ||
| 9 | -import javax.validation.constraints.*; | ||
| 10 | import javax.validation.*; | 10 | import javax.validation.*; |
| 11 | import javax.servlet.http.*; | 11 | import javax.servlet.http.*; |
| 12 | import java.util.*; | 12 | import java.util.*; |
| @@ -22,31 +22,30 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | @@ -22,31 +22,30 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 22 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | 22 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; |
| 23 | 23 | ||
| 24 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | 24 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; |
| 25 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | ||
| 26 | -import cn.iocoder.yudao.module.product.convert.property.PropertyConvert; | ||
| 27 | -import cn.iocoder.yudao.module.product.service.property.PropertyService; | 25 | +import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; |
| 26 | +import cn.iocoder.yudao.module.product.service.property.ProductPropertyService; | ||
| 28 | 27 | ||
| 29 | @Api(tags = "管理后台 - 规格名称") | 28 | @Api(tags = "管理后台 - 规格名称") |
| 30 | @RestController | 29 | @RestController |
| 31 | @RequestMapping("/product/property") | 30 | @RequestMapping("/product/property") |
| 32 | @Validated | 31 | @Validated |
| 33 | -public class PropertyController { | 32 | +public class ProductPropertyController { |
| 34 | 33 | ||
| 35 | @Resource | 34 | @Resource |
| 36 | - private PropertyService propertyService; | 35 | + private ProductPropertyService productPropertyService; |
| 37 | 36 | ||
| 38 | @PostMapping("/create") | 37 | @PostMapping("/create") |
| 39 | @ApiOperation("创建规格名称") | 38 | @ApiOperation("创建规格名称") |
| 40 | @PreAuthorize("@ss.hasPermission('product:property:create')") | 39 | @PreAuthorize("@ss.hasPermission('product:property:create')") |
| 41 | - public CommonResult<Long> createProperty(@Valid @RequestBody PropertyCreateReqVO createReqVO) { | ||
| 42 | - return success(propertyService.createProperty(createReqVO)); | 40 | + public CommonResult<Long> createProperty(@Valid @RequestBody ProductPropertyCreateReqVO createReqVO) { |
| 41 | + return success(productPropertyService.createProperty(createReqVO)); | ||
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | @PutMapping("/update") | 44 | @PutMapping("/update") |
| 46 | @ApiOperation("更新规格名称") | 45 | @ApiOperation("更新规格名称") |
| 47 | @PreAuthorize("@ss.hasPermission('product:property:update')") | 46 | @PreAuthorize("@ss.hasPermission('product:property:update')") |
| 48 | - public CommonResult<Boolean> updateProperty(@Valid @RequestBody PropertyUpdateReqVO updateReqVO) { | ||
| 49 | - propertyService.updateProperty(updateReqVO); | 47 | + public CommonResult<Boolean> updateProperty(@Valid @RequestBody ProductPropertyUpdateReqVO updateReqVO) { |
| 48 | + productPropertyService.updateProperty(updateReqVO); | ||
| 50 | return success(true); | 49 | return success(true); |
| 51 | } | 50 | } |
| 52 | 51 | ||
| @@ -55,7 +54,7 @@ public class PropertyController { | @@ -55,7 +54,7 @@ public class PropertyController { | ||
| 55 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | 54 | @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) |
| 56 | @PreAuthorize("@ss.hasPermission('product:property:delete')") | 55 | @PreAuthorize("@ss.hasPermission('product:property:delete')") |
| 57 | public CommonResult<Boolean> deleteProperty(@RequestParam("id") Long id) { | 56 | public CommonResult<Boolean> deleteProperty(@RequestParam("id") Long id) { |
| 58 | - propertyService.deleteProperty(id); | 57 | + productPropertyService.deleteProperty(id); |
| 59 | return success(true); | 58 | return success(true); |
| 60 | } | 59 | } |
| 61 | 60 | ||
| @@ -63,38 +62,38 @@ public class PropertyController { | @@ -63,38 +62,38 @@ public class PropertyController { | ||
| 63 | @ApiOperation("获得规格名称") | 62 | @ApiOperation("获得规格名称") |
| 64 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 63 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 65 | @PreAuthorize("@ss.hasPermission('product:property:query')") | 64 | @PreAuthorize("@ss.hasPermission('product:property:query')") |
| 66 | - public CommonResult<PropertyRespVO> getProperty(@RequestParam("id") Long id) { | ||
| 67 | - PropertyDO property = propertyService.getProperty(id); | ||
| 68 | - return success(PropertyConvert.INSTANCE.convert(property)); | 65 | + public CommonResult<ProductPropertyRespVO> getProperty(@RequestParam("id") Long id) { |
| 66 | + ProductPropertyDO property = productPropertyService.getProperty(id); | ||
| 67 | + return success(ProductPropertyConvert.INSTANCE.convert(property)); | ||
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | @GetMapping("/list") | 70 | @GetMapping("/list") |
| 72 | @ApiOperation("获得规格名称列表") | 71 | @ApiOperation("获得规格名称列表") |
| 73 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | 72 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 74 | @PreAuthorize("@ss.hasPermission('product:property:query')") | 73 | @PreAuthorize("@ss.hasPermission('product:property:query')") |
| 75 | - public CommonResult<List<PropertyRespVO>> getPropertyList(@RequestParam("ids") Collection<Long> ids) { | ||
| 76 | - List<PropertyDO> list = propertyService.getPropertyList(ids); | ||
| 77 | - return success(PropertyConvert.INSTANCE.convertList(list)); | 74 | + public CommonResult<List<ProductPropertyRespVO>> getPropertyList(@RequestParam("ids") Collection<Long> ids) { |
| 75 | + List<ProductPropertyDO> list = productPropertyService.getPropertyList(ids); | ||
| 76 | + return success(ProductPropertyConvert.INSTANCE.convertList(list)); | ||
| 78 | } | 77 | } |
| 79 | 78 | ||
| 80 | @GetMapping("/page") | 79 | @GetMapping("/page") |
| 81 | @ApiOperation("获得规格名称分页") | 80 | @ApiOperation("获得规格名称分页") |
| 82 | @PreAuthorize("@ss.hasPermission('product:property:query')") | 81 | @PreAuthorize("@ss.hasPermission('product:property:query')") |
| 83 | - public CommonResult<PageResult<PropertyRespVO>> getPropertyPage(@Valid PropertyPageReqVO pageVO) { | ||
| 84 | - PageResult<PropertyDO> pageResult = propertyService.getPropertyPage(pageVO); | ||
| 85 | - return success(PropertyConvert.INSTANCE.convertPage(pageResult)); | 82 | + public CommonResult<PageResult<ProductPropertyRespVO>> getPropertyPage(@Valid ProductPropertyPageReqVO pageVO) { |
| 83 | + PageResult<ProductPropertyDO> pageResult = productPropertyService.getPropertyPage(pageVO); | ||
| 84 | + return success(ProductPropertyConvert.INSTANCE.convertPage(pageResult)); | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | @GetMapping("/export-excel") | 87 | @GetMapping("/export-excel") |
| 89 | @ApiOperation("导出规格名称 Excel") | 88 | @ApiOperation("导出规格名称 Excel") |
| 90 | @PreAuthorize("@ss.hasPermission('product:property:export')") | 89 | @PreAuthorize("@ss.hasPermission('product:property:export')") |
| 91 | @OperateLog(type = EXPORT) | 90 | @OperateLog(type = EXPORT) |
| 92 | - public void exportPropertyExcel(@Valid PropertyExportReqVO exportReqVO, | 91 | + public void exportPropertyExcel(@Valid ProductPropertyExportReqVO exportReqVO, |
| 93 | HttpServletResponse response) throws IOException { | 92 | HttpServletResponse response) throws IOException { |
| 94 | - List<PropertyDO> list = propertyService.getPropertyList(exportReqVO); | 93 | + List<ProductPropertyDO> list = productPropertyService.getPropertyList(exportReqVO); |
| 95 | // 导出 Excel | 94 | // 导出 Excel |
| 96 | - List<PropertyExcelVO> datas = PropertyConvert.INSTANCE.convertList02(list); | ||
| 97 | - ExcelUtils.write(response, "规格名称.xls", "数据", PropertyExcelVO.class, datas); | 95 | + List<ProductPropertyExcelVO> datas = ProductPropertyConvert.INSTANCE.convertList02(list); |
| 96 | + ExcelUtils.write(response, "规格名称.xls", "数据", ProductPropertyExcelVO.class, datas); | ||
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | } | 99 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyBaseVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyBaseVO.java
100755 → 100644
| @@ -10,7 +10,7 @@ import javax.validation.constraints.*; | @@ -10,7 +10,7 @@ import javax.validation.constraints.*; | ||
| 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 10 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 11 | */ | 11 | */ |
| 12 | @Data | 12 | @Data |
| 13 | -public class PropertyBaseVO { | 13 | +public class ProductPropertyBaseVO { |
| 14 | 14 | ||
| 15 | @ApiModelProperty(value = "规格名称") | 15 | @ApiModelProperty(value = "规格名称") |
| 16 | private String name; | 16 | private String name; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyCreateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyCreateReqVO.java
100755 → 100644
| 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| 6 | -import javax.validation.constraints.*; | ||
| 7 | 5 | ||
| 8 | @ApiModel("管理后台 - 规格名称创建 Request VO") | 6 | @ApiModel("管理后台 - 规格名称创建 Request VO") |
| 9 | @Data | 7 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 8 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 9 | @ToString(callSuper = true) |
| 12 | -public class PropertyCreateReqVO extends PropertyBaseVO { | 10 | +public class ProductPropertyCreateReqVO extends ProductPropertyBaseVO { |
| 13 | 11 | ||
| 14 | } | 12 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyExcelVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExcelVO.java
100755 → 100644
| @@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | @@ -12,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | ||
| 12 | * @author 芋道源码 | 12 | * @author 芋道源码 |
| 13 | */ | 13 | */ |
| 14 | @Data | 14 | @Data |
| 15 | -public class PropertyExcelVO { | 15 | +public class ProductPropertyExcelVO { |
| 16 | 16 | ||
| 17 | @ExcelProperty("主键") | 17 | @ExcelProperty("主键") |
| 18 | private Long id; | 18 | private Long id; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyExportReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyExportReqVO.java
100755 → 100644
| @@ -10,7 +10,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -10,7 +10,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 10 | 10 | ||
| 11 | @ApiModel(value = "管理后台 - 规格名称 Excel 导出 Request VO", description = "参数和 PropertyPageReqVO 是一致的") | 11 | @ApiModel(value = "管理后台 - 规格名称 Excel 导出 Request VO", description = "参数和 PropertyPageReqVO 是一致的") |
| 12 | @Data | 12 | @Data |
| 13 | -public class PropertyExportReqVO { | 13 | +public class ProductPropertyExportReqVO { |
| 14 | 14 | ||
| 15 | @ApiModelProperty(value = "规格名称") | 15 | @ApiModelProperty(value = "规格名称") |
| 16 | private String name; | 16 | private String name; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyPageReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyPageReqVO.java
100755 → 100644
| @@ -12,7 +12,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -12,7 +12,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 12 | @Data | 12 | @Data |
| 13 | @EqualsAndHashCode(callSuper = true) | 13 | @EqualsAndHashCode(callSuper = true) |
| 14 | @ToString(callSuper = true) | 14 | @ToString(callSuper = true) |
| 15 | -public class PropertyPageReqVO extends PageParam { | 15 | +public class ProductPropertyPageReqVO extends PageParam { |
| 16 | 16 | ||
| 17 | @ApiModelProperty(value = "规格名称") | 17 | @ApiModelProperty(value = "规格名称") |
| 18 | private String name; | 18 | private String name; |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyRespVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyRespVO.java
100755 → 100644
| 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.module.product.controller.admin.propertyvalue.vo.PropertyValueRespVO; | ||
| 3 | import lombok.*; | 4 | import lombok.*; |
| 4 | import java.util.*; | 5 | import java.util.*; |
| 5 | import io.swagger.annotations.*; | 6 | import io.swagger.annotations.*; |
| @@ -8,7 +9,7 @@ import io.swagger.annotations.*; | @@ -8,7 +9,7 @@ import io.swagger.annotations.*; | ||
| 8 | @Data | 9 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 11 | @ToString(callSuper = true) |
| 11 | -public class PropertyRespVO extends PropertyBaseVO { | 12 | +public class ProductPropertyRespVO extends ProductPropertyBaseVO { |
| 12 | 13 | ||
| 13 | @ApiModelProperty(value = "主键", required = true) | 14 | @ApiModelProperty(value = "主键", required = true) |
| 14 | private Long id; | 15 | private Long id; |
| @@ -16,4 +17,6 @@ public class PropertyRespVO extends PropertyBaseVO { | @@ -16,4 +17,6 @@ public class PropertyRespVO extends PropertyBaseVO { | ||
| 16 | @ApiModelProperty(value = "创建时间") | 17 | @ApiModelProperty(value = "创建时间") |
| 17 | private Date createTime; | 18 | private Date createTime; |
| 18 | 19 | ||
| 20 | + private List<PropertyValueRespVO> propertyValueRespVOList; | ||
| 21 | + | ||
| 19 | } | 22 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/PropertyUpdateReqVO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/ProductPropertyUpdateReqVO.java
100755 → 100644
| 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; | 1 | package cn.iocoder.yudao.module.product.controller.admin.property.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| 6 | import javax.validation.constraints.*; | 5 | import javax.validation.constraints.*; |
| 7 | 6 | ||
| @@ -9,7 +8,7 @@ import javax.validation.constraints.*; | @@ -9,7 +8,7 @@ import javax.validation.constraints.*; | ||
| 9 | @Data | 8 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 12 | -public class PropertyUpdateReqVO extends PropertyBaseVO { | 11 | +public class ProductPropertyUpdateReqVO extends ProductPropertyBaseVO { |
| 13 | 12 | ||
| 14 | @ApiModelProperty(value = "主键", required = true) | 13 | @ApiModelProperty(value = "主键", required = true) |
| 15 | @NotNull(message = "主键不能为空") | 14 | @NotNull(message = "主键不能为空") |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/PropertyConvert.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/convert/property/ProductPropertyConvert.java
100755 → 100644
| @@ -4,10 +4,10 @@ import java.util.*; | @@ -4,10 +4,10 @@ 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.dal.dataobject.property.ProductPropertyDO; | ||
| 7 | import org.mapstruct.Mapper; | 8 | import org.mapstruct.Mapper; |
| 8 | import org.mapstruct.factory.Mappers; | 9 | import org.mapstruct.factory.Mappers; |
| 9 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | 10 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; |
| 10 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | ||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 规格名称 Convert | 13 | * 规格名称 Convert |
| @@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | @@ -15,20 +15,20 @@ import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | ||
| 15 | * @author 芋道源码 | 15 | * @author 芋道源码 |
| 16 | */ | 16 | */ |
| 17 | @Mapper | 17 | @Mapper |
| 18 | -public interface PropertyConvert { | 18 | +public interface ProductPropertyConvert { |
| 19 | 19 | ||
| 20 | - PropertyConvert INSTANCE = Mappers.getMapper(PropertyConvert.class); | 20 | + ProductPropertyConvert INSTANCE = Mappers.getMapper(ProductPropertyConvert.class); |
| 21 | 21 | ||
| 22 | - PropertyDO convert(PropertyCreateReqVO bean); | 22 | + ProductPropertyDO convert(ProductPropertyCreateReqVO bean); |
| 23 | 23 | ||
| 24 | - PropertyDO convert(PropertyUpdateReqVO bean); | 24 | + ProductPropertyDO convert(ProductPropertyUpdateReqVO bean); |
| 25 | 25 | ||
| 26 | - PropertyRespVO convert(PropertyDO bean); | 26 | + ProductPropertyRespVO convert(ProductPropertyDO bean); |
| 27 | 27 | ||
| 28 | - List<PropertyRespVO> convertList(List<PropertyDO> list); | 28 | + List<ProductPropertyRespVO> convertList(List<ProductPropertyDO> list); |
| 29 | 29 | ||
| 30 | - PageResult<PropertyRespVO> convertPage(PageResult<PropertyDO> page); | 30 | + PageResult<ProductPropertyRespVO> convertPage(PageResult<ProductPropertyDO> page); |
| 31 | 31 | ||
| 32 | - List<PropertyExcelVO> convertList02(List<PropertyDO> list); | 32 | + List<ProductPropertyExcelVO> convertList02(List<ProductPropertyDO> list); |
| 33 | 33 | ||
| 34 | } | 34 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/PropertyDO.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/property/ProductPropertyDO.java
100755 → 100644
| @@ -21,7 +21,7 @@ import lombok.*; | @@ -21,7 +21,7 @@ import lombok.*; | ||
| 21 | @Builder | 21 | @Builder |
| 22 | @NoArgsConstructor | 22 | @NoArgsConstructor |
| 23 | @AllArgsConstructor | 23 | @AllArgsConstructor |
| 24 | -public class PropertyDO extends BaseDO { | 24 | +public class ProductPropertyDO extends BaseDO { |
| 25 | 25 | ||
| 26 | /** | 26 | /** |
| 27 | * 主键 | 27 | * 主键 |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/propertyvalue/PropertyValueDO.java
| 1 | package cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue; | 1 | package cn.iocoder.yudao.module.product.dal.dataobject.propertyvalue; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | 4 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 5 | import com.baomidou.mybatisplus.annotation.KeySequence; | 5 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| 6 | import com.baomidou.mybatisplus.annotation.TableId; | 6 | import com.baomidou.mybatisplus.annotation.TableId; |
| 7 | import com.baomidou.mybatisplus.annotation.TableName; | 7 | import com.baomidou.mybatisplus.annotation.TableName; |
| @@ -31,7 +31,7 @@ public class PropertyValueDO extends BaseDO { | @@ -31,7 +31,7 @@ public class PropertyValueDO extends BaseDO { | ||
| 31 | /** | 31 | /** |
| 32 | * 规格键 id | 32 | * 规格键 id |
| 33 | * | 33 | * |
| 34 | - * TODO @franky:加个 关联 {@link PropertyDO#getId()} ,这样就能更好的知道 | 34 | + * TODO @franky:加个 关联 {@link ProductPropertyDO#getId()} ,这样就能更好的知道 |
| 35 | */ | 35 | */ |
| 36 | private Long propertyId; | 36 | private Long propertyId; |
| 37 | /** | 37 | /** |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/ProductPropertyMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.product.dal.mysql.property; | ||
| 2 | + | ||
| 3 | +import java.util.*; | ||
| 4 | + | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 8 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | ||
| 9 | +import org.apache.ibatis.annotations.Mapper; | ||
| 10 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 规格名称 Mapper | ||
| 14 | + * | ||
| 15 | + * @author 芋道源码 | ||
| 16 | + */ | ||
| 17 | +@Mapper | ||
| 18 | +public interface ProductPropertyMapper extends BaseMapperX<ProductPropertyDO> { | ||
| 19 | + | ||
| 20 | + default PageResult<ProductPropertyDO> selectPage(ProductPropertyPageReqVO reqVO) { | ||
| 21 | + return selectPage(reqVO, new LambdaQueryWrapperX<ProductPropertyDO>() | ||
| 22 | + .likeIfPresent(ProductPropertyDO::getName, reqVO.getName()) | ||
| 23 | + .eqIfPresent(ProductPropertyDO::getStatus, reqVO.getStatus()) | ||
| 24 | + .betweenIfPresent(ProductPropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 25 | + .orderByDesc(ProductPropertyDO::getId)); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + default List<ProductPropertyDO> selectList(ProductPropertyExportReqVO reqVO) { | ||
| 29 | + return selectList(new LambdaQueryWrapperX<ProductPropertyDO>() | ||
| 30 | + .likeIfPresent(ProductPropertyDO::getName, reqVO.getName()) | ||
| 31 | + .eqIfPresent(ProductPropertyDO::getStatus, reqVO.getStatus()) | ||
| 32 | + .betweenIfPresent(ProductPropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 33 | + .orderByDesc(ProductPropertyDO::getId)); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | +} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/property/PropertyMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.product.dal.mysql.property; | ||
| 2 | - | ||
| 3 | -import java.util.*; | ||
| 4 | - | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 8 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | ||
| 9 | -import org.apache.ibatis.annotations.Mapper; | ||
| 10 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 规格名称 Mapper | ||
| 14 | - * | ||
| 15 | - * @author 芋道源码 | ||
| 16 | - */ | ||
| 17 | -@Mapper | ||
| 18 | -public interface PropertyMapper extends BaseMapperX<PropertyDO> { | ||
| 19 | - | ||
| 20 | - default PageResult<PropertyDO> selectPage(PropertyPageReqVO reqVO) { | ||
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<PropertyDO>() | ||
| 22 | - .likeIfPresent(PropertyDO::getName, reqVO.getName()) | ||
| 23 | - .eqIfPresent(PropertyDO::getStatus, reqVO.getStatus()) | ||
| 24 | - .betweenIfPresent(PropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 25 | - .orderByDesc(PropertyDO::getId)); | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - default List<PropertyDO> selectList(PropertyExportReqVO reqVO) { | ||
| 29 | - return selectList(new LambdaQueryWrapperX<PropertyDO>() | ||
| 30 | - .likeIfPresent(PropertyDO::getName, reqVO.getName()) | ||
| 31 | - .eqIfPresent(PropertyDO::getStatus, reqVO.getStatus()) | ||
| 32 | - .betweenIfPresent(PropertyDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | ||
| 33 | - .orderByDesc(PropertyDO::getId)); | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | -} |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/PropertyService.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyService.java
100755 → 100644
| @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.product.service.property; | @@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.product.service.property; | ||
| 3 | import java.util.*; | 3 | import java.util.*; |
| 4 | import javax.validation.*; | 4 | import javax.validation.*; |
| 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; | 5 | import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; |
| 6 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | 6 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; |
| 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| @@ -11,7 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -11,7 +11,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 11 | * | 11 | * |
| 12 | * @author 芋道源码 | 12 | * @author 芋道源码 |
| 13 | */ | 13 | */ |
| 14 | -public interface PropertyService { | 14 | +public interface ProductPropertyService { |
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| 17 | * 创建规格名称 | 17 | * 创建规格名称 |
| @@ -19,14 +19,14 @@ public interface PropertyService { | @@ -19,14 +19,14 @@ public interface PropertyService { | ||
| 19 | * @param createReqVO 创建信息 | 19 | * @param createReqVO 创建信息 |
| 20 | * @return 编号 | 20 | * @return 编号 |
| 21 | */ | 21 | */ |
| 22 | - Long createProperty(@Valid PropertyCreateReqVO createReqVO); | 22 | + Long createProperty(@Valid ProductPropertyCreateReqVO createReqVO); |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | * 更新规格名称 | 25 | * 更新规格名称 |
| 26 | * | 26 | * |
| 27 | * @param updateReqVO 更新信息 | 27 | * @param updateReqVO 更新信息 |
| 28 | */ | 28 | */ |
| 29 | - void updateProperty(@Valid PropertyUpdateReqVO updateReqVO); | 29 | + void updateProperty(@Valid ProductPropertyUpdateReqVO updateReqVO); |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * 删除规格名称 | 32 | * 删除规格名称 |
| @@ -41,7 +41,7 @@ public interface PropertyService { | @@ -41,7 +41,7 @@ public interface PropertyService { | ||
| 41 | * @param id 编号 | 41 | * @param id 编号 |
| 42 | * @return 规格名称 | 42 | * @return 规格名称 |
| 43 | */ | 43 | */ |
| 44 | - PropertyDO getProperty(Long id); | 44 | + ProductPropertyDO getProperty(Long id); |
| 45 | 45 | ||
| 46 | /** | 46 | /** |
| 47 | * 获得规格名称列表 | 47 | * 获得规格名称列表 |
| @@ -49,7 +49,7 @@ public interface PropertyService { | @@ -49,7 +49,7 @@ public interface PropertyService { | ||
| 49 | * @param ids 编号 | 49 | * @param ids 编号 |
| 50 | * @return 规格名称列表 | 50 | * @return 规格名称列表 |
| 51 | */ | 51 | */ |
| 52 | - List<PropertyDO> getPropertyList(Collection<Long> ids); | 52 | + List<ProductPropertyDO> getPropertyList(Collection<Long> ids); |
| 53 | 53 | ||
| 54 | /** | 54 | /** |
| 55 | * 获得规格名称分页 | 55 | * 获得规格名称分页 |
| @@ -57,7 +57,7 @@ public interface PropertyService { | @@ -57,7 +57,7 @@ public interface PropertyService { | ||
| 57 | * @param pageReqVO 分页查询 | 57 | * @param pageReqVO 分页查询 |
| 58 | * @return 规格名称分页 | 58 | * @return 规格名称分页 |
| 59 | */ | 59 | */ |
| 60 | - PageResult<PropertyDO> getPropertyPage(PropertyPageReqVO pageReqVO); | 60 | + PageResult<ProductPropertyDO> getPropertyPage(ProductPropertyPageReqVO pageReqVO); |
| 61 | 61 | ||
| 62 | /** | 62 | /** |
| 63 | * 获得规格名称列表, 用于 Excel 导出 | 63 | * 获得规格名称列表, 用于 Excel 导出 |
| @@ -65,6 +65,6 @@ public interface PropertyService { | @@ -65,6 +65,6 @@ public interface PropertyService { | ||
| 65 | * @param exportReqVO 查询条件 | 65 | * @param exportReqVO 查询条件 |
| 66 | * @return 规格名称列表 | 66 | * @return 规格名称列表 |
| 67 | */ | 67 | */ |
| 68 | - List<PropertyDO> getPropertyList(PropertyExportReqVO exportReqVO); | 68 | + List<ProductPropertyDO> getPropertyList(ProductPropertyExportReqVO exportReqVO); |
| 69 | 69 | ||
| 70 | } | 70 | } |
yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/PropertyServiceImpl.java renamed to yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/service/property/ProductPropertyServiceImpl.java
100755 → 100644
| 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.PropertyCreateReqVO; | ||
| 5 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.PropertyExportReqVO; | ||
| 6 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.PropertyPageReqVO; | ||
| 7 | -import cn.iocoder.yudao.module.product.controller.admin.property.vo.PropertyUpdateReqVO; | ||
| 8 | -import cn.iocoder.yudao.module.product.convert.property.PropertyConvert; | ||
| 9 | -import cn.iocoder.yudao.module.product.dal.dataobject.property.PropertyDO; | ||
| 10 | -import cn.iocoder.yudao.module.product.dal.mysql.property.PropertyMapper; | 4 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.*; |
| 5 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyCreateReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.product.controller.admin.property.vo.ProductPropertyUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.product.convert.property.ProductPropertyConvert; | ||
| 8 | +import cn.iocoder.yudao.module.product.dal.dataobject.property.ProductPropertyDO; | ||
| 9 | +import cn.iocoder.yudao.module.product.dal.mysql.property.ProductPropertyMapper; | ||
| 11 | import org.springframework.stereotype.Service; | 10 | import org.springframework.stereotype.Service; |
| 12 | import org.springframework.validation.annotation.Validated; | 11 | import org.springframework.validation.annotation.Validated; |
| 13 | 12 | ||
| @@ -25,27 +24,27 @@ import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_ | @@ -25,27 +24,27 @@ import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.PROPERTY_ | ||
| 25 | */ | 24 | */ |
| 26 | @Service | 25 | @Service |
| 27 | @Validated | 26 | @Validated |
| 28 | -public class PropertyServiceImpl implements PropertyService { | 27 | +public class ProductPropertyServiceImpl implements ProductPropertyService { |
| 29 | 28 | ||
| 30 | @Resource | 29 | @Resource |
| 31 | - private PropertyMapper propertyMapper; | 30 | + private ProductPropertyMapper productPropertyMapper; |
| 32 | 31 | ||
| 33 | @Override | 32 | @Override |
| 34 | - public Long createProperty(PropertyCreateReqVO createReqVO) { | 33 | + public Long createProperty(ProductPropertyCreateReqVO createReqVO) { |
| 35 | // 插入 | 34 | // 插入 |
| 36 | - PropertyDO property = PropertyConvert.INSTANCE.convert(createReqVO); | ||
| 37 | - propertyMapper.insert(property); | 35 | + ProductPropertyDO property = ProductPropertyConvert.INSTANCE.convert(createReqVO); |
| 36 | + productPropertyMapper.insert(property); | ||
| 38 | // 返回 | 37 | // 返回 |
| 39 | return property.getId(); | 38 | return property.getId(); |
| 40 | } | 39 | } |
| 41 | 40 | ||
| 42 | @Override | 41 | @Override |
| 43 | - public void updateProperty(PropertyUpdateReqVO updateReqVO) { | 42 | + public void updateProperty(ProductPropertyUpdateReqVO updateReqVO) { |
| 44 | // 校验存在 | 43 | // 校验存在 |
| 45 | this.validatePropertyExists(updateReqVO.getId()); | 44 | this.validatePropertyExists(updateReqVO.getId()); |
| 46 | // 更新 | 45 | // 更新 |
| 47 | - PropertyDO updateObj = PropertyConvert.INSTANCE.convert(updateReqVO); | ||
| 48 | - propertyMapper.updateById(updateObj); | 46 | + ProductPropertyDO updateObj = ProductPropertyConvert.INSTANCE.convert(updateReqVO); |
| 47 | + productPropertyMapper.updateById(updateObj); | ||
| 49 | } | 48 | } |
| 50 | 49 | ||
| 51 | @Override | 50 | @Override |
| @@ -53,33 +52,33 @@ public class PropertyServiceImpl implements PropertyService { | @@ -53,33 +52,33 @@ public class PropertyServiceImpl implements PropertyService { | ||
| 53 | // 校验存在 | 52 | // 校验存在 |
| 54 | this.validatePropertyExists(id); | 53 | this.validatePropertyExists(id); |
| 55 | // 删除 | 54 | // 删除 |
| 56 | - propertyMapper.deleteById(id); | 55 | + productPropertyMapper.deleteById(id); |
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | private void validatePropertyExists(Long id) { | 58 | private void validatePropertyExists(Long id) { |
| 60 | - if (propertyMapper.selectById(id) == null) { | 59 | + if (productPropertyMapper.selectById(id) == null) { |
| 61 | throw exception(PROPERTY_NOT_EXISTS); | 60 | throw exception(PROPERTY_NOT_EXISTS); |
| 62 | } | 61 | } |
| 63 | } | 62 | } |
| 64 | 63 | ||
| 65 | @Override | 64 | @Override |
| 66 | - public PropertyDO getProperty(Long id) { | ||
| 67 | - return propertyMapper.selectById(id); | 65 | + public ProductPropertyDO getProperty(Long id) { |
| 66 | + return productPropertyMapper.selectById(id); | ||
| 68 | } | 67 | } |
| 69 | 68 | ||
| 70 | @Override | 69 | @Override |
| 71 | - public List<PropertyDO> getPropertyList(Collection<Long> ids) { | ||
| 72 | - return propertyMapper.selectBatchIds(ids); | 70 | + public List<ProductPropertyDO> getPropertyList(Collection<Long> ids) { |
| 71 | + return productPropertyMapper.selectBatchIds(ids); | ||
| 73 | } | 72 | } |
| 74 | 73 | ||
| 75 | @Override | 74 | @Override |
| 76 | - public PageResult<PropertyDO> getPropertyPage(PropertyPageReqVO pageReqVO) { | ||
| 77 | - return propertyMapper.selectPage(pageReqVO); | 75 | + public PageResult<ProductPropertyDO> getPropertyPage(ProductPropertyPageReqVO pageReqVO) { |
| 76 | + return productPropertyMapper.selectPage(pageReqVO); | ||
| 78 | } | 77 | } |
| 79 | 78 | ||
| 80 | @Override | 79 | @Override |
| 81 | - public List<PropertyDO> getPropertyList(PropertyExportReqVO exportReqVO) { | ||
| 82 | - return propertyMapper.selectList(exportReqVO); | 80 | + public List<ProductPropertyDO> getPropertyList(ProductPropertyExportReqVO exportReqVO) { |
| 81 | + return productPropertyMapper.selectList(exportReqVO); | ||
| 83 | } | 82 | } |
| 84 | 83 | ||
| 85 | } | 84 | } |