forked from YunaiV/yudao-cloud
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
YunaiV
committed
Jul 30, 2020
1 parent
d88da82
commit 981b3d8
Showing
59 changed files
with
745 additions
and
989 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>common</artifactId> | ||
<groupId>cn.iocoder.mall</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>mall-spring-boot-starter-rocketmq</artifactId> | ||
|
||
<dependencies> | ||
<!-- MQ 相关 --> | ||
<dependency> | ||
<groupId>org.apache.rocketmq</groupId> | ||
<artifactId>rocketmq-spring-boot-starter</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...oduct-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/ProductSkuRpc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cn.iocoder.mall.productservice.rpc.sku; | ||
|
||
import cn.iocoder.common.framework.vo.CommonResult; | ||
import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; | ||
import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 商品 SKU Rpc 接口 | ||
*/ | ||
public interface ProductSkuRpc { | ||
|
||
/** | ||
* 获得商品 SKU | ||
* | ||
* @param productSkuId 商品 SKU 编号 | ||
* @return 商品 SKU | ||
*/ | ||
CommonResult<ProductSkuRespDTO> getProductSku(Integer productSkuId); | ||
|
||
/** | ||
* 获得商品 SKU 列表 | ||
* | ||
* @param queryReqDTO 商品 SKU 列表的查询请求 DTO | ||
* @return 商品 SKU 列表 | ||
*/ | ||
CommonResult<List<ProductSkuRespDTO>> listProductSkus(ProductSkuListQueryReqDTO queryReqDTO); | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...i/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuListQueryReqDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package cn.iocoder.mall.productservice.rpc.sku.dto; | ||
|
||
import lombok.Data; | ||
import lombok.experimental.Accessors; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* 商品 SKU 列表查询 DTO | ||
*/ | ||
@Data | ||
@Accessors(chain = true) | ||
public class ProductSkuListQueryReqDTO implements Serializable { | ||
|
||
/** | ||
* 商品 SKU 编号 | ||
*/ | ||
private Integer productSkuId; | ||
/** | ||
* 商品 SPU 编号 | ||
*/ | ||
private Integer productSpuId; | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
...rvice-api/src/main/java/cn/iocoder/mall/productservice/rpc/sku/dto/ProductSkuRespDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package cn.iocoder.mall.productservice.rpc.sku.dto; | ||
|
||
import lombok.Data; | ||
import lombok.experimental.Accessors; | ||
|
||
import java.io.Serializable; | ||
import java.util.Date; | ||
import java.util.List; | ||
|
||
/** | ||
* 商品 SKU Response DTO | ||
*/ | ||
@Data | ||
@Accessors(chain = true) | ||
public class ProductSkuRespDTO implements Serializable { | ||
|
||
/** | ||
* sku 编号 | ||
*/ | ||
private Integer id; | ||
/** | ||
* 商品编号 | ||
*/ | ||
private Integer spuId; | ||
/** | ||
* 状态 | ||
*/ | ||
private Integer status; | ||
/** | ||
* 图片地址 | ||
*/ | ||
private String picUrl; | ||
/** | ||
* 规格值编号数组 | ||
*/ | ||
private List<Integer> attrValueIds; | ||
/** | ||
* 价格,单位:分 | ||
*/ | ||
private Integer price; | ||
/** | ||
* 库存数量 | ||
*/ | ||
private Integer quantity; | ||
/** | ||
* 创建时间 | ||
*/ | ||
private Date createTime; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...uct-service-app/src/main/java/cn/iocoder/mall/productservice/config/AopConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package cn.iocoder.mall.productservice.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.EnableAspectJAutoProxy; | ||
|
||
/** | ||
* Spring Aop 配置类 | ||
*/ | ||
@Configuration | ||
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true) | ||
public class AopConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...al/mysql/dataobject/spu/ProductSkuDO.java → ...al/mysql/dataobject/sku/ProductSkuDO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...rvice-app/src/main/java/cn/iocoder/mall/productservice/manager/sku/ProductSkuManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package cn.iocoder.mall.productservice.manager.sku; | ||
|
||
import cn.iocoder.mall.productservice.convert.sku.ProductSkuConvert; | ||
import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuListQueryReqDTO; | ||
import cn.iocoder.mall.productservice.rpc.sku.dto.ProductSkuRespDTO; | ||
import cn.iocoder.mall.productservice.service.sku.ProductSkuService; | ||
import cn.iocoder.mall.productservice.service.sku.bo.ProductSkuBO; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 商品 SKU Manager | ||
*/ | ||
@Service | ||
public class ProductSkuManager { | ||
|
||
@Autowired | ||
private ProductSkuService productSkuService; | ||
|
||
/** | ||
* 获得商品 SKU | ||
* | ||
* @param productSkuId 商品 SKU编号 | ||
* @return 商品 SKU | ||
*/ | ||
public ProductSkuRespDTO getProductSku(Integer productSkuId) { | ||
ProductSkuBO productSkuBO = productSkuService.getProductSku(productSkuId); | ||
return ProductSkuConvert.INSTANCE.convert(productSkuBO); | ||
} | ||
|
||
/** | ||
* 获得商品 SKU 列表 | ||
* | ||
* @param queryReqDTO 商品 SKU 列表的查询请求 DTO | ||
* @return 商品 SKU列表 | ||
*/ | ||
public List<ProductSkuRespDTO> listProductSkus(ProductSkuListQueryReqDTO queryReqDTO) { | ||
List<ProductSkuBO> productSkuBOs = productSkuService.listProductSkus( | ||
ProductSkuConvert.INSTANCE.convert(queryReqDTO)); | ||
return ProductSkuConvert.INSTANCE.convertList03(productSkuBOs); | ||
} | ||
|
||
} |
Oops, something went wrong.