Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
b5b102d1
提交
b5b102d1
authored
10月 07, 2021
作者:
zhuyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ProductBrand改造
上级
a01d66a3
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
198 行增加
和
11 行删除
+198
-11
ProductBrandController.http
...agementweb/controller/product/ProductBrandController.http
+21
-0
ProductBrandManager.java
...ll/managementweb/manager/product/ProductBrandManager.java
+10
-11
ProductBrandFeign.java
...oder/mall/productservice/rpc/brand/ProductBrandFeign.java
+69
-0
ProductBrandController.java
...all/productservice/controller/ProductBrandController.java
+98
-0
没有找到文件。
management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductBrandController.http
0 → 100644
浏览文件 @
b5b102d1
### /product-attr/page 成功(全部)
GET http://127.0.0.1:18083/management-api/product-attr/key/page?pageNo=1&pageSize=10
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer yudaoyuanma
###
POST http://127.0.0.1:18083/management-api/product-brand/create
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer yudaoyuanma
name=光明牌&description=光明牌电灯泡&status=1
###
GET http://127.0.0.1:18083/management-api/product-brand/get?productBrandId=3
Content-Type: application/x-www-form-urlencoded
Authorization: Bearer yudaoyuanma
###
\ No newline at end of file
management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductBrandManager.java
浏览文件 @
b5b102d1
...
@@ -7,9 +7,9 @@ import cn.iocoder.mall.managementweb.controller.product.vo.brand.ProductBrandPag
...
@@ -7,9 +7,9 @@ import cn.iocoder.mall.managementweb.controller.product.vo.brand.ProductBrandPag
import
cn.iocoder.mall.managementweb.controller.product.vo.brand.ProductBrandRespVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.brand.ProductBrandRespVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.brand.ProductBrandUpdateReqVO
;
import
cn.iocoder.mall.managementweb.controller.product.vo.brand.ProductBrandUpdateReqVO
;
import
cn.iocoder.mall.managementweb.convert.product.ProductBrandConvert
;
import
cn.iocoder.mall.managementweb.convert.product.ProductBrandConvert
;
import
cn.iocoder.mall.productservice.rpc.brand.ProductBrand
Rpc
;
import
cn.iocoder.mall.productservice.rpc.brand.ProductBrand
Feign
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandRespDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandRespDTO
;
import
org.
apache.dubbo.config.annotation.Reference
;
import
org.
springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -20,9 +20,8 @@ import java.util.List;
...
@@ -20,9 +20,8 @@ import java.util.List;
@Service
@Service
public
class
ProductBrandManager
{
public
class
ProductBrandManager
{
@Reference
(
version
=
"${dubbo.consumer.ProductBrandRpc.version}"
)
@Autowired
private
ProductBrandRpc
productBrandRpc
;
ProductBrandFeign
productBrandFeign
;
/**
/**
* 创建商品品牌
* 创建商品品牌
*
*
...
@@ -30,7 +29,7 @@ public class ProductBrandManager {
...
@@ -30,7 +29,7 @@ public class ProductBrandManager {
* @return 商品品牌
* @return 商品品牌
*/
*/
public
Integer
createProductBrand
(
ProductBrandCreateReqVO
createVO
)
{
public
Integer
createProductBrand
(
ProductBrandCreateReqVO
createVO
)
{
CommonResult
<
Integer
>
createProductBrandResult
=
productBrand
Rpc
.
createProductBrand
(
ProductBrandConvert
.
INSTANCE
.
convert
(
createVO
));
CommonResult
<
Integer
>
createProductBrandResult
=
productBrand
Feign
.
createProductBrand
(
ProductBrandConvert
.
INSTANCE
.
convert
(
createVO
));
createProductBrandResult
.
checkError
();
createProductBrandResult
.
checkError
();
return
createProductBrandResult
.
getData
();
return
createProductBrandResult
.
getData
();
}
}
...
@@ -41,7 +40,7 @@ public class ProductBrandManager {
...
@@ -41,7 +40,7 @@ public class ProductBrandManager {
* @param updateVO 更新商品品牌 VO
* @param updateVO 更新商品品牌 VO
*/
*/
public
void
updateProductBrand
(
ProductBrandUpdateReqVO
updateVO
)
{
public
void
updateProductBrand
(
ProductBrandUpdateReqVO
updateVO
)
{
CommonResult
<
Boolean
>
updateProductBrandResult
=
productBrand
Rpc
.
updateProductBrand
(
ProductBrandConvert
.
INSTANCE
.
convert
(
updateVO
));
CommonResult
<
Boolean
>
updateProductBrandResult
=
productBrand
Feign
.
updateProductBrand
(
ProductBrandConvert
.
INSTANCE
.
convert
(
updateVO
));
updateProductBrandResult
.
checkError
();
updateProductBrandResult
.
checkError
();
}
}
...
@@ -51,7 +50,7 @@ public class ProductBrandManager {
...
@@ -51,7 +50,7 @@ public class ProductBrandManager {
* @param productBrandId 商品品牌编号
* @param productBrandId 商品品牌编号
*/
*/
public
void
deleteProductBrand
(
Integer
productBrandId
)
{
public
void
deleteProductBrand
(
Integer
productBrandId
)
{
CommonResult
<
Boolean
>
deleteProductBrandResult
=
productBrand
Rpc
.
deleteProductBrand
(
productBrandId
);
CommonResult
<
Boolean
>
deleteProductBrandResult
=
productBrand
Feign
.
deleteProductBrand
(
productBrandId
);
deleteProductBrandResult
.
checkError
();
deleteProductBrandResult
.
checkError
();
}
}
...
@@ -62,7 +61,7 @@ public class ProductBrandManager {
...
@@ -62,7 +61,7 @@ public class ProductBrandManager {
* @return 商品品牌
* @return 商品品牌
*/
*/
public
ProductBrandRespVO
getProductBrand
(
Integer
productBrandId
)
{
public
ProductBrandRespVO
getProductBrand
(
Integer
productBrandId
)
{
CommonResult
<
ProductBrandRespDTO
>
getProductBrandResult
=
productBrand
Rpc
.
getProductBrand
(
productBrandId
);
CommonResult
<
ProductBrandRespDTO
>
getProductBrandResult
=
productBrand
Feign
.
getProductBrand
(
productBrandId
);
getProductBrandResult
.
checkError
();
getProductBrandResult
.
checkError
();
return
ProductBrandConvert
.
INSTANCE
.
convert
(
getProductBrandResult
.
getData
());
return
ProductBrandConvert
.
INSTANCE
.
convert
(
getProductBrandResult
.
getData
());
}
}
...
@@ -74,7 +73,7 @@ public class ProductBrandManager {
...
@@ -74,7 +73,7 @@ public class ProductBrandManager {
* @return 商品品牌列表
* @return 商品品牌列表
*/
*/
public
List
<
ProductBrandRespVO
>
listProductBrands
(
List
<
Integer
>
productBrandIds
)
{
public
List
<
ProductBrandRespVO
>
listProductBrands
(
List
<
Integer
>
productBrandIds
)
{
CommonResult
<
List
<
ProductBrandRespDTO
>>
listProductBrandResult
=
productBrand
Rpc
.
listProductBrands
(
productBrandIds
);
CommonResult
<
List
<
ProductBrandRespDTO
>>
listProductBrandResult
=
productBrand
Feign
.
listProductBrands
(
productBrandIds
);
listProductBrandResult
.
checkError
();
listProductBrandResult
.
checkError
();
return
ProductBrandConvert
.
INSTANCE
.
convertList
(
listProductBrandResult
.
getData
());
return
ProductBrandConvert
.
INSTANCE
.
convertList
(
listProductBrandResult
.
getData
());
}
}
...
@@ -86,7 +85,7 @@ public class ProductBrandManager {
...
@@ -86,7 +85,7 @@ public class ProductBrandManager {
* @return 商品品牌分页结果
* @return 商品品牌分页结果
*/
*/
public
PageResult
<
ProductBrandRespVO
>
pageProductBrand
(
ProductBrandPageReqVO
pageVO
)
{
public
PageResult
<
ProductBrandRespVO
>
pageProductBrand
(
ProductBrandPageReqVO
pageVO
)
{
CommonResult
<
PageResult
<
ProductBrandRespDTO
>>
pageProductBrandResult
=
productBrand
Rpc
.
pageProductBrand
(
ProductBrandConvert
.
INSTANCE
.
convert
(
pageVO
));
CommonResult
<
PageResult
<
ProductBrandRespDTO
>>
pageProductBrandResult
=
productBrand
Feign
.
pageProductBrand
(
ProductBrandConvert
.
INSTANCE
.
convert
(
pageVO
));
pageProductBrandResult
.
checkError
();
pageProductBrandResult
.
checkError
();
return
ProductBrandConvert
.
INSTANCE
.
convertPage
(
pageProductBrandResult
.
getData
());
return
ProductBrandConvert
.
INSTANCE
.
convertPage
(
pageProductBrandResult
.
getData
());
}
}
...
...
product-service-project/product-service-api/src/main/java/cn/iocoder/mall/productservice/rpc/brand/ProductBrandFeign.java
0 → 100644
浏览文件 @
b5b102d1
package
cn
.
iocoder
.
mall
.
productservice
.
rpc
.
brand
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandCreateReqDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandPageReqDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandRespDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandUpdateReqDTO
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
@FeignClient
(
value
=
"product-service"
)
public
interface
ProductBrandFeign
{
/**
* 创建商品品牌
*
* @param createDTO 创建商品品牌 DTO
* @return 商品品牌编号
*/
@PostMapping
(
"/product/brand/createProductBrand"
)
CommonResult
<
Integer
>
createProductBrand
(
@RequestBody
ProductBrandCreateReqDTO
createDTO
);
/**
* 更新商品品牌
*
* @param updateDTO 更新商品品牌 DTO
*/
@PostMapping
(
"/product/brand/updateProductBrand"
)
CommonResult
<
Boolean
>
updateProductBrand
(
@RequestBody
ProductBrandUpdateReqDTO
updateDTO
);
/**
* 删除商品品牌
*
* @param productBrandId 商品品牌编号
*/
@GetMapping
(
"/product/brand/deleteProductBrand"
)
CommonResult
<
Boolean
>
deleteProductBrand
(
@RequestParam
(
"productBrandId"
)
Integer
productBrandId
);
/**
* 获得商品品牌
*
* @param productBrandId 商品品牌编号
* @return 商品品牌
*/
@GetMapping
(
"/product/brand/getProductBrand"
)
CommonResult
<
ProductBrandRespDTO
>
getProductBrand
(
@RequestParam
(
"productBrandId"
)
Integer
productBrandId
);
/**
* 获得商品品牌列表
*
* @param productBrandIds 商品品牌编号列表
* @return 商品品牌列表
*/
@GetMapping
(
"/product/brand/listProductBrands"
)
CommonResult
<
List
<
ProductBrandRespDTO
>>
listProductBrands
(
@RequestParam
(
"productBrandIds"
)
List
<
Integer
>
productBrandIds
);
/**
* 获得商品品牌分页
*
* @param pageDTO 商品品牌分页查询
* @return 商品品牌分页结果
*/
@PostMapping
(
"/product/brand/pageProductBrand"
)
CommonResult
<
PageResult
<
ProductBrandRespDTO
>>
pageProductBrand
(
@RequestBody
ProductBrandPageReqDTO
pageDTO
);
}
product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductBrandController.java
0 → 100644
浏览文件 @
b5b102d1
package
cn
.
iocoder
.
mall
.
productservice
.
controller
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.PageResult
;
import
cn.iocoder.mall.productservice.manager.brand.ProductBrandManager
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandCreateReqDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandPageReqDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandRespDTO
;
import
cn.iocoder.mall.productservice.rpc.brand.dto.ProductBrandUpdateReqDTO
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
/**
* Title:
* Description:
*
* @author zhuyang
* @version 1.0 2021/10/7
*/
@RestController
@RequestMapping
(
"/product/brand"
)
@Api
(
"商品品牌"
)
public
class
ProductBrandController
{
@Autowired
private
ProductBrandManager
productBrandManager
;
/**
* 创建商品品牌
*
* @param createDTO 创建商品品牌 DTO
* @return 商品品牌编号
*/
@PostMapping
(
"createProductBrand"
)
CommonResult
<
Integer
>
createProductBrand
(
@RequestBody
ProductBrandCreateReqDTO
createDTO
){
return
success
(
productBrandManager
.
createProductBrand
(
createDTO
));
}
/**
* 更新商品品牌
*
* @param updateDTO 更新商品品牌 DTO
*/
@PostMapping
(
"updateProductBrand"
)
CommonResult
<
Boolean
>
updateProductBrand
(
@RequestBody
ProductBrandUpdateReqDTO
updateDTO
){
productBrandManager
.
updateProductBrand
(
updateDTO
);
return
success
(
true
);
}
/**
* 删除商品品牌
*
* @param productBrandId 商品品牌编号
*/
@GetMapping
(
"deleteProductBrand"
)
CommonResult
<
Boolean
>
deleteProductBrand
(
@RequestParam
(
"productBrandId"
)
Integer
productBrandId
){
productBrandManager
.
deleteProductBrand
(
productBrandId
);
return
success
(
true
);
}
/**
* 获得商品品牌
*
* @param productBrandId 商品品牌编号
* @return 商品品牌
*/
@GetMapping
(
"getProductBrand"
)
CommonResult
<
ProductBrandRespDTO
>
getProductBrand
(
@RequestParam
(
"productBrandId"
)
Integer
productBrandId
){
return
success
(
productBrandManager
.
getProductBrand
(
productBrandId
));
}
/**
* 获得商品品牌列表
*
* @param productBrandIds 商品品牌编号列表
* @return 商品品牌列表
*/
@GetMapping
(
"listProductBrands"
)
CommonResult
<
List
<
ProductBrandRespDTO
>>
listProductBrands
(
@RequestParam
(
"productBrandIds"
)
List
<
Integer
>
productBrandIds
){
return
success
(
productBrandManager
.
listProductBrands
(
productBrandIds
));
}
/**
* 获得商品品牌分页
*
* @param pageDTO 商品品牌分页查询
* @return 商品品牌分页结果
*/
@PostMapping
(
"pageProductBrand"
)
CommonResult
<
PageResult
<
ProductBrandRespDTO
>>
pageProductBrand
(
@RequestBody
ProductBrandPageReqDTO
pageDTO
){
return
success
(
productBrandManager
.
pageProductBrand
(
pageDTO
));
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论