Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
dfd25c15
提交
dfd25c15
authored
8月 04, 2020
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改 search 服务的 dev dubbo 配置
完成 product 详情 rest 接口
上级
11b2f67e
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
74 行增加
和
62 行删除
+74
-62
MQStreamConfiguration.java
...ocoder/mall/product/biz/config/MQStreamConfiguration.java
+0
-10
UsersProductSkuDetailVO.java
...product/application/vo/users/UsersProductSkuDetailVO.java
+0
-29
ProductSpuDetailRespDTO.java
...l/productservice/rpc/spu/dto/ProductSpuDetailRespDTO.java
+0
-3
application-dev.yaml
...earch-service-app/src/main/resources/application-dev.yaml
+2
-1
ProductSpuController.java
...mall/shopweb/controller/product/ProductSpuController.java
+8
-0
ProductAttrKeyValueRespVO.java
...controller/product/vo/attr/ProductAttrKeyValueRespVO.java
+9
-9
ProductSpuDetailRespVO.java
...controller/product/vo/product/ProductSpuDetailRespVO.java
+33
-9
ProductSpuRespVO.java
...opweb/controller/product/vo/product/ProductSpuRespVO.java
+1
-1
ProductSpuConvert.java
...coder/mall/shopweb/convert/product/ProductSpuConvert.java
+4
-0
ProductSpuManager.java
...coder/mall/shopweb/manager/product/ProductSpuManager.java
+15
-0
application.yml
shop-web-app/src/main/resources/application.yml
+2
-0
没有找到文件。
moved/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/config/MQStreamConfiguration.java
deleted
100644 → 0
浏览文件 @
11b2f67e
package
cn
.
iocoder
.
mall
.
product
.
biz
.
config
;
import
cn.iocoder.mall.product.biz.message.MQStreamProducer
;
import
org.springframework.cloud.stream.annotation.EnableBinding
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@EnableBinding
(
MQStreamProducer
.
class
)
public
class
MQStreamConfiguration
{
}
moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/users/UsersProductSkuDetailVO.java
deleted
100644 → 0
浏览文件 @
11b2f67e
package
cn
.
iocoder
.
mall
.
product
.
application
.
vo
.
users
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
/**
* 商品 Sku 明细 BO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
UsersProductSkuDetailVO
{
@ApiModelProperty
(
value
=
"sku 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"SPU 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
spuId
;
@ApiModelProperty
(
value
=
"图片地址"
,
required
=
true
,
example
=
"http://www.iocoder.cn"
)
private
String
picURL
;
@ApiModelProperty
(
value
=
"规格值数组"
,
required
=
true
)
private
List
<
UsersProductAttrAndValuePairVO
>
attrs
;
@ApiModelProperty
(
value
=
"价格,单位:分"
,
required
=
true
,
example
=
"100"
)
private
Integer
price
;
@ApiModelProperty
(
value
=
"库存数量"
,
required
=
true
,
example
=
"100"
)
private
Integer
quantity
;
}
product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/spu/dto/ProductSpuDetailRespDTO.java
浏览文件 @
dfd25c15
...
...
@@ -76,9 +76,6 @@ public class ProductSpuDetailRespDTO implements Serializable {
@Accessors
(
chain
=
true
)
public
static
class
Sku
implements
Serializable
{
/**
* sku 编号
*/
private
Integer
id
;
/**
* 商品编号
...
...
search-service-project/search-service-app/src/main/resources/application-dev.yaml
浏览文件 @
dfd25c15
...
...
@@ -11,4 +11,5 @@ spring:
dubbo
:
# Dubbo 注册中心
registry
:
address
:
spring-cloud://400-infra.server.iocoder.cn:8848
# 指定 Dubbo 服务注册中心的地址
# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址
address
:
nacos://400-infra.server.iocoder.cn:8848?namespace=dev
# 指定 Dubbo 服务注册中心的地址
shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/ProductSpuController.java
浏览文件 @
dfd25c15
...
...
@@ -2,6 +2,7 @@ package cn.iocoder.mall.shopweb.controller.product;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRespVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO
;
...
...
@@ -41,4 +42,11 @@ public class ProductSpuController {
return
success
(
productSpuManager
.
getProductSpuSearchCondition
(
keyword
));
}
@GetMapping
(
"/get_detail"
)
@ApiOperation
(
"获得商品 SPU 的明细,包括 SKU 等等信息"
)
@ApiImplicitParam
(
name
=
"id"
,
required
=
true
,
value
=
"商品 SPU 编号"
,
example
=
"1024"
)
public
CommonResult
<
ProductSpuDetailRespVO
>
getProductSpuDetail
(
@RequestParam
(
"id"
)
Integer
id
)
{
return
success
(
productSpuManager
.
getProductSpuDetail
(
id
));
}
}
moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/users/UsersProductAttrAndValuePair
VO.java
→
shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/attr/ProductAttrKeyValueResp
VO.java
浏览文件 @
dfd25c15
package
cn
.
iocoder
.
mall
.
product
.
application
.
vo
.
users
;
package
cn
.
iocoder
.
mall
.
shopweb
.
controller
.
product
.
vo
.
attr
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@ApiModel
(
value
=
"商品规格
属性和值对
VO"
)
@ApiModel
(
value
=
"商品规格
KEY + VALUE 对的 Response
VO"
)
@Data
@Accessors
(
chain
=
true
)
public
class
UsersProductAttrAndValuePair
VO
{
public
class
ProductAttrKeyValueResp
VO
{
@ApiModelProperty
(
value
=
"规格编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
attrId
;
@ApiModelProperty
(
value
=
"规格
名
"
,
required
=
true
,
example
=
"颜色"
)
private
String
attrName
;
@ApiModelProperty
(
value
=
"规格值"
,
required
=
true
,
example
=
"10"
)
@ApiModelProperty
(
value
=
"规格
KEY
编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
attr
Key
Id
;
@ApiModelProperty
(
value
=
"规格
KEY 名字
"
,
required
=
true
,
example
=
"颜色"
)
private
String
attr
Key
Name
;
@ApiModelProperty
(
value
=
"规格
VALUE
值"
,
required
=
true
,
example
=
"10"
)
private
Integer
attrValueId
;
@ApiModelProperty
(
value
=
"规格
值名
"
,
required
=
true
,
example
=
"红色"
)
@ApiModelProperty
(
value
=
"规格
VALUE 名字
"
,
required
=
true
,
example
=
"红色"
)
private
String
attrValueName
;
}
moved/product/product-start/src/main/java/cn/iocoder/mall/product/application/vo/users/UsersProductSpuDetail
VO.java
→
shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuDetailResp
VO.java
浏览文件 @
dfd25c15
package
cn
.
iocoder
.
mall
.
product
.
application
.
vo
.
users
;
package
cn
.
iocoder
.
mall
.
shopweb
.
controller
.
product
.
vo
.
product
;
import
cn.iocoder.mall.shopweb.controller.product.vo.attr.ProductAttrKeyValueRespVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
@ApiModel
(
value
=
"商品 SPU 详细 VO"
,
description
=
"包括 SKU 信息 VO"
)
@ApiModel
(
value
=
"商品 SPU 详细
Response
VO"
,
description
=
"包括 SKU 信息 VO"
)
@Data
@Accessors
(
chain
=
true
)
public
class
UsersProductSpuDetail
VO
{
public
class
ProductSpuDetailResp
VO
{
@ApiModelProperty
(
value
=
"SPU 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
// ========== 基本信息 =========
@ApiModelProperty
(
value
=
"SPU 名字"
,
required
=
true
,
example
=
"
厮大牛逼
"
)
@ApiModelProperty
(
value
=
"SPU 名字"
,
required
=
true
,
example
=
"
芋艿
"
)
private
String
name
;
@ApiModelProperty
(
value
=
"卖点"
,
required
=
true
,
example
=
"
各种 MQ 骚操作
"
)
@ApiModelProperty
(
value
=
"卖点"
,
required
=
true
,
example
=
"
好吃好玩
"
)
private
String
sellPoint
;
@ApiModelProperty
(
value
=
"描述"
,
required
=
true
,
example
=
"
你就说强不强
"
)
@ApiModelProperty
(
value
=
"描述"
,
required
=
true
,
example
=
"
我是哈哈哈
"
)
private
String
description
;
@ApiModelProperty
(
value
=
"分类编号"
,
required
=
true
,
example
=
"
反正我是信了
"
)
@ApiModelProperty
(
value
=
"分类编号"
,
required
=
true
,
example
=
"
1
"
)
private
Integer
cid
;
@ApiModelProperty
(
value
=
"商品主图地址
的数组"
,
required
=
true
,
example
=
"http://www.iocoder.cn
"
)
@ApiModelProperty
(
value
=
"商品主图地址
"
,
required
=
true
,
example
=
"http://www.iocoder.cn/xxx.jpg"
,
notes
=
"多个之间,使用逗号分隔
"
)
private
List
<
String
>
picUrls
;
// ========== SKU =========
...
...
@@ -32,6 +34,28 @@ public class UsersProductSpuDetailVO {
/**
* SKU 数组
*/
private
List
<
UsersProductSkuDetailVO
>
skus
;
private
List
<
Sku
>
skus
;
@ApiModel
(
"商品 SKU 详细 Response VO"
)
@Data
@Accessors
(
chain
=
true
)
public
static
class
Sku
implements
Serializable
{
@ApiModelProperty
(
value
=
"sku 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"SPU 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
spuId
;
@ApiModelProperty
(
value
=
"图片地址"
,
required
=
true
,
example
=
"http://www.iocoder.cn"
)
private
String
picURL
;
/**
* 规格值数组
*/
private
List
<
ProductAttrKeyValueRespVO
>
attrs
;
@ApiModelProperty
(
value
=
"价格,单位:分"
,
required
=
true
,
example
=
"100"
)
private
Integer
price
;
@ApiModelProperty
(
value
=
"库存数量"
,
required
=
true
,
example
=
"100"
)
private
Integer
quantity
;
}
}
shop-web-app/src/main/java/cn/iocoder/mall/shopweb/controller/product/vo/product/ProductSpuRespVO.java
浏览文件 @
dfd25c15
...
...
@@ -12,7 +12,7 @@ import java.util.List;
@Accessors
(
chain
=
true
)
public
class
ProductSpuRespVO
{
@ApiModelProperty
(
value
=
"SPU 编号"
,
required
=
true
)
@ApiModelProperty
(
value
=
"SPU 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
// ========== 基本信息 =========
...
...
shop-web-app/src/main/java/cn/iocoder/mall/shopweb/convert/product/ProductSpuConvert.java
浏览文件 @
dfd25c15
...
...
@@ -4,8 +4,10 @@ import cn.iocoder.common.framework.util.StringUtils;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.common.framework.vo.SortingField
;
import
cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO
;
import
cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuDetailRespDTO
;
import
cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductPageReqDTO
;
import
cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRespVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO
;
...
...
@@ -34,4 +36,6 @@ public interface ProductSpuConvert {
List
<
ProductSpuSearchConditionRespVO
.
Category
>
convertList
(
List
<
ProductCategoryRespDTO
>
list
);
ProductSpuDetailRespVO
convert
(
ProductSpuDetailRespDTO
bean
);
}
shop-web-app/src/main/java/cn/iocoder/mall/shopweb/manager/product/ProductSpuManager.java
浏览文件 @
dfd25c15
...
...
@@ -3,13 +3,17 @@ package cn.iocoder.mall.shopweb.manager.product;
import
cn.iocoder.common.framework.util.CollectionUtils
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.mall.productservice.enums.spu.ProductSpuDetailFieldEnum
;
import
cn.iocoder.mall.productservice.rpc.category.ProductCategoryRpc
;
import
cn.iocoder.mall.productservice.rpc.category.dto.ProductCategoryRespDTO
;
import
cn.iocoder.mall.productservice.rpc.spu.ProductSpuRpc
;
import
cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuDetailRespDTO
;
import
cn.iocoder.mall.searchservice.enums.product.SearchProductConditionFieldEnum
;
import
cn.iocoder.mall.searchservice.rpc.product.SearchProductRpc
;
import
cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionReqDTO
;
import
cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductConditionRespDTO
;
import
cn.iocoder.mall.searchservice.rpc.product.dto.SearchProductRespDTO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuDetailRespVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuPageReqVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuRespVO
;
import
cn.iocoder.mall.shopweb.controller.product.vo.product.ProductSpuSearchConditionRespVO
;
...
...
@@ -18,6 +22,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -34,6 +39,9 @@ public class ProductSpuManager {
@DubboReference
(
version
=
"${dubbo.consumer.ProductCategoryRpc.version}"
)
private
ProductCategoryRpc
productCategoryRpc
;
@DubboReference
(
version
=
"${dubbo.consumer.ProductSpuRpc.version}"
)
private
ProductSpuRpc
productSpuRpc
;
public
PageResult
<
ProductSpuRespVO
>
pageProductSpu
(
ProductSpuPageReqVO
pageReqVO
)
{
CommonResult
<
PageResult
<
SearchProductRespDTO
>>
pageResult
=
searchProductRpc
.
pageSearchProduct
(
ProductSpuConvert
.
INSTANCE
.
convert
(
pageReqVO
));
...
...
@@ -60,4 +68,11 @@ public class ProductSpuManager {
return
conditionRespVO
;
}
public
ProductSpuDetailRespVO
getProductSpuDetail
(
Integer
id
)
{
CommonResult
<
ProductSpuDetailRespDTO
>
getProductSpuDetailResult
=
productSpuRpc
.
getProductSpuDetail
(
id
,
Arrays
.
asList
(
ProductSpuDetailFieldEnum
.
SKU
.
getField
(),
ProductSpuDetailFieldEnum
.
ATTR
.
getField
()));
getProductSpuDetailResult
.
checkError
();
return
ProductSpuConvert
.
INSTANCE
.
convert
(
getProductSpuDetailResult
.
getData
());
}
}
shop-web-app/src/main/resources/application.yml
浏览文件 @
dfd25c15
...
...
@@ -35,6 +35,8 @@ dubbo:
version
:
1.0.0
ProductCategoryRpc
:
version
:
1.0.0
ProductSpuRpc
:
version
:
1.0.0
SearchProductRpc
:
version
:
1.0.0
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论