Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
2b845968
提交
2b845968
authored
7月 25, 2020
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品分类的迁移,完成并测试
上级
b1313bf5
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
36 行增加
和
27 行删除
+36
-27
DubboProviderRouterTagFilter.java
.../mall/dubbo/core/filter/DubboProviderRouterTagFilter.java
+1
-0
ProducctCategoryController.http
...entweb/controller/product/ProducctCategoryController.http
+7
-0
ProductCategoryController.java
...mentweb/controller/product/ProductCategoryController.java
+15
-5
ProductCategoryRespVO.java
...controller/product/vo/category/ProductCategoryRespVO.java
+4
-0
ProductCategoryTreeNodeRespVO.java
...er/product/vo/category/ProductCategoryTreeNodeRespVO.java
+3
-0
ProductCategoryListQueryReqDTO.java
...vice/rpc/category/dto/ProductCategoryListQueryReqDTO.java
+3
-1
application-dev.yaml
...oduct-service-app/src/main/resources/application-dev.yaml
+1
-1
application-local.yaml
...uct-service-app/src/main/resources/application-local.yaml
+1
-1
application.yaml
...t/product-service-app/src/main/resources/application.yaml
+1
-19
没有找到文件。
common/mall-spring-boot-starter-dubbo/src/main/java/cn/iocoder/mall/dubbo/core/filter/DubboProviderRouterTagFilter.java
浏览文件 @
2b845968
...
@@ -11,6 +11,7 @@ import org.apache.dubbo.rpc.cluster.router.tag.TagRouter;
...
@@ -11,6 +11,7 @@ import org.apache.dubbo.rpc.cluster.router.tag.TagRouter;
/**
/**
* 基于 Dubbo 标签路由规则(http://dubbo.apache.org/zh-cn/docs/user/demos/routing-rule.html),实现如下功能:
* 基于 Dubbo 标签路由规则(http://dubbo.apache.org/zh-cn/docs/user/demos/routing-rule.html),实现如下功能:
* 1. 本地开发调试时,在带有 Dubbo Tag 的情况下,优先调用指定 Tag 的服务提供者。这样,我们可以将本地启动的服务提供者打上相应的 Tag,即可优先调用本地;
* 1. 本地开发调试时,在带有 Dubbo Tag 的情况下,优先调用指定 Tag 的服务提供者。这样,我们可以将本地启动的服务提供者打上相应的 Tag,即可优先调用本地;
* 并且,前端在调用开发环境上的 Dubbo 服务时,因为不带有 Dubbo Tag,所以不会调用到后端开发本地启动的 Dubbo 服务提供者;
* 2. TODO 优化点:蓝绿发布、灰度发布
* 2. TODO 优化点:蓝绿发布、灰度发布
*
*
* 实现逻辑为:
* 实现逻辑为:
...
...
management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProducctCategoryController.http
0 → 100644
浏览文件 @
2b845968
### /product-category/tree 成功
GET {{baseUrl}}/product-category/tree
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer {{accessToken}}
dubbo-tag: {{dubboTag}}
###
management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductCategoryController.java
浏览文件 @
2b845968
...
@@ -2,19 +2,19 @@ package cn.iocoder.mall.managementweb.controller.product;
...
@@ -2,19 +2,19 @@ package cn.iocoder.mall.managementweb.controller.product;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.managementweb.controller.product.vo.category.ProductCategoryCreateReqVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.category.ProductCategoryCreateReqVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.category.ProductCategoryTreeNodeRespVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.category.ProductCategoryUpdateReqVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.category.ProductCategoryUpdateReqVO
;
import
cn.iocoder.mall.managementweb.manager.product.ProductCategoryManager
;
import
cn.iocoder.mall.managementweb.manager.product.ProductCategoryManager
;
import
cn.iocoder.security.annotations.RequiresPermissions
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.Valid
;
import
javax.validation.Valid
;
import
java.util.List
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
...
@@ -22,7 +22,7 @@ import static cn.iocoder.common.framework.vo.CommonResult.success;
...
@@ -22,7 +22,7 @@ import static cn.iocoder.common.framework.vo.CommonResult.success;
* 商品分类 Controller
* 商品分类 Controller
*/
*/
@RestController
@RestController
@RequestMapping
(
"/product
_
category"
)
@RequestMapping
(
"/product
-
category"
)
@Api
(
tags
=
"商品分类"
)
@Api
(
tags
=
"商品分类"
)
@Validated
@Validated
public
class
ProductCategoryController
{
public
class
ProductCategoryController
{
...
@@ -32,12 +32,14 @@ public class ProductCategoryController {
...
@@ -32,12 +32,14 @@ public class ProductCategoryController {
@PostMapping
(
"/create"
)
@PostMapping
(
"/create"
)
@ApiOperation
(
"创建商品分类"
)
@ApiOperation
(
"创建商品分类"
)
@RequiresPermissions
(
"product:category:create"
)
public
CommonResult
<
Integer
>
createProductCategory
(
@Valid
ProductCategoryCreateReqVO
createVO
)
{
public
CommonResult
<
Integer
>
createProductCategory
(
@Valid
ProductCategoryCreateReqVO
createVO
)
{
return
success
(
productCategoryManager
.
createProductCategory
(
createVO
));
return
success
(
productCategoryManager
.
createProductCategory
(
createVO
));
}
}
@PostMapping
(
"/update"
)
@PostMapping
(
"/update"
)
@ApiOperation
(
"更新商品分类"
)
@ApiOperation
(
"更新商品分类"
)
@RequiresPermissions
(
"product:category:update"
)
public
CommonResult
<
Boolean
>
updateProductCategory
(
@Valid
ProductCategoryUpdateReqVO
updateVO
)
{
public
CommonResult
<
Boolean
>
updateProductCategory
(
@Valid
ProductCategoryUpdateReqVO
updateVO
)
{
productCategoryManager
.
updateProductCategory
(
updateVO
);
productCategoryManager
.
updateProductCategory
(
updateVO
);
return
success
(
true
);
return
success
(
true
);
...
@@ -45,10 +47,18 @@ public class ProductCategoryController {
...
@@ -45,10 +47,18 @@ public class ProductCategoryController {
@PostMapping
(
"/delete"
)
@PostMapping
(
"/delete"
)
@ApiOperation
(
"删除商品分类"
)
@ApiOperation
(
"删除商品分类"
)
@RequiresPermissions
(
"product:category:delete"
)
@ApiImplicitParam
(
name
=
"productCategoryId"
,
value
=
"商品分类编号"
,
required
=
true
)
@ApiImplicitParam
(
name
=
"productCategoryId"
,
value
=
"商品分类编号"
,
required
=
true
)
public
CommonResult
<
Boolean
>
deleteProductCategory
(
@RequestParam
(
"productCategoryId"
)
Integer
productCategoryId
)
{
public
CommonResult
<
Boolean
>
deleteProductCategory
(
@RequestParam
(
"productCategoryId"
)
Integer
productCategoryId
)
{
productCategoryManager
.
deleteProductCategory
(
productCategoryId
);
productCategoryManager
.
deleteProductCategory
(
productCategoryId
);
return
success
(
true
);
return
success
(
true
);
}
}
@GetMapping
(
"/tree"
)
@ApiOperation
(
"获得资源树"
)
@RequiresPermissions
(
"product:category:tree"
)
public
CommonResult
<
List
<
ProductCategoryTreeNodeRespVO
>>
treeProductCategory
()
{
return
success
(
productCategoryManager
.
treeProductCategory
());
}
}
}
management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/vo/category/ProductCategoryRespVO.java
浏览文件 @
2b845968
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
@ApiModel
(
"商品分类 Response VO"
)
@ApiModel
(
"商品分类 Response VO"
)
@Data
@Data
public
class
ProductCategoryRespVO
{
public
class
ProductCategoryRespVO
{
...
@@ -22,5 +24,7 @@ public class ProductCategoryRespVO {
...
@@ -22,5 +24,7 @@ public class ProductCategoryRespVO {
private
Integer
sort
;
private
Integer
sort
;
@ApiModelProperty
(
value
=
"状态"
,
required
=
true
,
example
=
"1"
,
notes
=
"见 CommonStatusEnum 枚举"
)
@ApiModelProperty
(
value
=
"状态"
,
required
=
true
,
example
=
"1"
,
notes
=
"见 CommonStatusEnum 枚举"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
)
private
Date
createTime
;
}
}
management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/vo/category/ProductCategoryTreeNodeRespVO.java
浏览文件 @
2b845968
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
...
@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
@ApiModel
(
"商品分类 Response VO"
)
@ApiModel
(
"商品分类 Response VO"
)
...
@@ -24,6 +25,8 @@ public class ProductCategoryTreeNodeRespVO {
...
@@ -24,6 +25,8 @@ public class ProductCategoryTreeNodeRespVO {
private
Integer
sort
;
private
Integer
sort
;
@ApiModelProperty
(
value
=
"状态"
,
required
=
true
,
example
=
"1"
,
notes
=
"见 CommonStatusEnum 枚举"
)
@ApiModelProperty
(
value
=
"状态"
,
required
=
true
,
example
=
"1"
,
notes
=
"见 CommonStatusEnum 枚举"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
)
private
Date
createTime
;
/**
/**
* 子节点
* 子节点
...
...
product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/category/dto/ProductCategoryListQueryReqDTO.java
浏览文件 @
2b845968
...
@@ -3,12 +3,14 @@ package cn.iocoder.mall.productservice.rpc.category.dto;
...
@@ -3,12 +3,14 @@ package cn.iocoder.mall.productservice.rpc.category.dto;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
/**
* 商品分类列表查询 DTO
* 商品分类列表查询 DTO
*/
*/
@Data
@Data
@Accessors
(
chain
=
true
)
@Accessors
(
chain
=
true
)
public
class
ProductCategoryListQueryReqDTO
{
public
class
ProductCategoryListQueryReqDTO
implements
Serializable
{
/**
/**
* 父编号
* 父编号
...
...
product-service-project/product-service-app/src/main/resources/application-dev.yaml
浏览文件 @
2b845968
spring
:
spring
:
# 数据源配置项
# 数据源配置项
datasource
:
datasource
:
url
:
jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_
system
?useSSL=false&useUnicode=true&characterEncoding=UTF-8
url
:
jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_
product
?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
username
:
root
username
:
root
password
:
3WLiVUBEwTbvAfsh
password
:
3WLiVUBEwTbvAfsh
...
...
product-service-project/product-service-app/src/main/resources/application-local.yaml
浏览文件 @
2b845968
spring
:
spring
:
# 数据源配置项
# 数据源配置项
datasource
:
datasource
:
url
:
jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_
system
?useSSL=false&useUnicode=true&characterEncoding=UTF-8
url
:
jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_
product
?useSSL=false&useUnicode=true&characterEncoding=UTF-8
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
username
:
root
username
:
root
password
:
3WLiVUBEwTbvAfsh
password
:
3WLiVUBEwTbvAfsh
...
...
product-service-project/product-service-app/src/main/resources/application.yaml
浏览文件 @
2b845968
...
@@ -34,25 +34,7 @@ dubbo:
...
@@ -34,25 +34,7 @@ dubbo:
provider
:
provider
:
filter
:
-exception
filter
:
-exception
validation
:
true
# 开启 Provider 参数校验
validation
:
true
# 开启 Provider 参数校验
OAuth2Rpc
:
ProductCategoryRpc
:
version
:
1.0.0
AdminRpc
:
version
:
1.0.0
ResourceRpc
:
version
:
1.0.0
RoleRpc
:
version
:
1.0.0
PermissionRpc
:
version
:
1.0.0
DepartmentRpc
:
version
:
1.0.0
DataDictRpc
:
version
:
1.0.0
ProductExceptionLogRpc
:
version
:
1.0.0
ProductAccessLogRpc
:
version
:
1.0.0
ErrorCodeRpc
:
version
:
1.0.0
version
:
1.0.0
# Dubbo 服务消费者的配置
# Dubbo 服务消费者的配置
consumer
:
consumer
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论