Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
scrm
/
rop-merchant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7c7068e6
authored
Jul 28, 2021
by
licy
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加根据产品id查询菜单功能树接口
1 parent
aab66068
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
4 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantProductController.java
src/main/java/cn/com/glsx/merchants/request/product/ProductSearchByIdRequest.java
src/main/java/cn/com/glsx/merchants/response/MerchantProTreeRopResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantProductService.java
src/main/java/cn/com/glsx/merchants/controller/MerchantProductController.java
View file @
7c7068e
...
@@ -2,10 +2,8 @@ package cn.com.glsx.merchants.controller;
...
@@ -2,10 +2,8 @@ package cn.com.glsx.merchants.controller;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.merchants.request.product.ProductDeleteRequest
;
import
cn.com.glsx.merchants.request.product.*
;
import
cn.com.glsx.merchants.request.product.ProductSaveRequest
;
import
cn.com.glsx.merchants.response.MerchantProTreeRopResponse
;
import
cn.com.glsx.merchants.request.product.ProductSearchRequest
;
import
cn.com.glsx.merchants.request.product.ProductUpdateRequest
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.service.MerchantProductService
;
import
cn.com.glsx.merchants.service.MerchantProductService
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
...
@@ -87,4 +85,22 @@ public class MerchantProductController {
...
@@ -87,4 +85,22 @@ public class MerchantProductController {
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
/**
* 根据产品id查询菜单功能树
*
* @param productSearchByIdRequest
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.product.findProductById"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"根据产品id查询菜单功能树"
)
public
RopResponse
<
List
<
MerchantProTreeRopResponse
>>
findMenuFunByProductId
(
ProductSearchByIdRequest
productSearchByIdRequest
){
try
{
List
<
MerchantProTreeRopResponse
>
merchantProductResponseList
=
merchantProductService
.
findMenuFunByProductId
(
productSearchByIdRequest
);
return
RopResponse
.
success
(
merchantProductResponseList
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantProductController__invoke__findProductById__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
}
src/main/java/cn/com/glsx/merchants/request/product/ProductSearchByIdRequest.java
0 → 100644
View file @
7c7068e
package
cn
.
com
.
glsx
.
merchants
.
request
.
product
;
import
com.rop.AbstractRopRequest
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @author Lichongyuan
* @Description: 根据产品id查询菜单功能树
* @date 2021/7/28 14:20
*/
@Data
public
class
ProductSearchByIdRequest
extends
AbstractRopRequest
implements
Serializable
{
/**
* 产品id
*/
@ApiModelProperty
(
notes
=
"产品id"
,
required
=
true
)
@NotNull
private
List
<
Integer
>
productId
;
}
src/main/java/cn/com/glsx/merchants/response/MerchantProTreeRopResponse.java
0 → 100644
View file @
7c7068e
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
cn.com.glsx.merchants.model.response.MerchantProTreeResponse
;
import
io.swagger.annotations.Api
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author Lichongyuan
* @Description:
* @date 2021/7/28 14:50
*/
@Data
@Api
(
"菜单功能树"
)
public
class
MerchantProTreeRopResponse
{
private
Integer
id
;
private
String
labal
;
private
String
value
;
private
String
logo
;
private
List
<
MerchantProTreeResponse
>
children
;
}
src/main/java/cn/com/glsx/merchants/service/MerchantProductService.java
View file @
7c7068e
...
@@ -6,11 +6,14 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
...
@@ -6,11 +6,14 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.request.MerchantProductRequest
;
import
cn.com.glsx.merchants.model.request.MerchantProductRequest
;
import
cn.com.glsx.merchants.model.response.MerchantProTreeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.model.response.MerchantProductResponse
;
import
cn.com.glsx.merchants.remote.MerchantProductRemote
;
import
cn.com.glsx.merchants.remote.MerchantProductRemote
;
import
cn.com.glsx.merchants.request.product.ProductSaveRequest
;
import
cn.com.glsx.merchants.request.product.ProductSaveRequest
;
import
cn.com.glsx.merchants.request.product.ProductSearchByIdRequest
;
import
cn.com.glsx.merchants.request.product.ProductSearchRequest
;
import
cn.com.glsx.merchants.request.product.ProductSearchRequest
;
import
cn.com.glsx.merchants.request.product.ProductUpdateRequest
;
import
cn.com.glsx.merchants.request.product.ProductUpdateRequest
;
import
cn.com.glsx.merchants.response.MerchantProTreeRopResponse
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.response.ProductResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -62,4 +65,13 @@ public class MerchantProductService {
...
@@ -62,4 +65,13 @@ public class MerchantProductService {
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
getMessage
());
}
}
}
}
public
List
<
MerchantProTreeRopResponse
>
findMenuFunByProductId
(
ProductSearchByIdRequest
productSearchByIdRequest
)
{
RpcResponse
<
List
<
MerchantProTreeResponse
>>
mListRpcResponseRemote
=
merchantProductRemote
.
findMenuFunByProductIdRemote
(
productSearchByIdRequest
.
getProductId
());
if
(
mListRpcResponseRemote
.
isSuccess
()){
return
ConvertResponse
.
convertList
(
mListRpcResponseRemote
.
getResult
(),
MerchantProTreeRopResponse
.
class
);
}
throw
new
RpcServiceException
(
mListRpcResponseRemote
.
getException
().
getErrId
(),
mListRpcResponseRemote
.
getMessage
());
}
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment