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 80bd661b
authored
Oct 14, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]渠道添加
1 parent
b0222d60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantCommonController.java
src/main/java/cn/com/glsx/merchants/response/ChannelResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantCommonService.java
src/main/java/cn/com/glsx/merchants/controller/MerchantCommonController.java
View file @
80bd661
...
...
@@ -6,6 +6,7 @@ import cn.com.glsx.merchants.request.DefaultRequest;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.response.AccountTypeResponse
;
import
cn.com.glsx.merchants.response.CarbrandResponse
;
import
cn.com.glsx.merchants.response.ChannelResponse
;
import
cn.com.glsx.merchants.service.MerchantCommonService
;
import
com.rop.AbstractRopRequest
;
import
com.rop.annotation.NeedInSessionType
;
...
...
@@ -49,4 +50,21 @@ public class MerchantCommonController {
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
/**
* 获取车辆品牌树
*
* @param abstractRopRequest
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.merchantCommon.findAllChannel"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"获取渠道列表"
)
public
RopResponse
<
List
<
ChannelResponse
>>
findAllChannel
(
AbstractRopRequest
abstractRopRequest
)
{
try
{
return
RopResponse
.
success
(
merchantCommonService
.
findAllChannel
());
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantCommonController__invoke__findAllChannel__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/response/ChannelResponse.java
0 → 100644
View file @
80bd661
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ChannelResponse
implements
Serializable
{
private
int
id
;
private
String
channelName
;
private
String
channelUrl
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/service/MerchantCommonService.java
View file @
80bd661
package
cn
.
com
.
glsx
.
merchants
.
service
;
import
cn.com.glsx.framework.core.beans.rpc.RpcResponse
;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.response.MerchantChannelResponse
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.response.CarbrandResponse
;
import
cn.com.glsx.merchants.response.ChannelResponse
;
import
cn.com.glsx.merchants.response.MerchantTreeRopResponse
;
import
com.glsx.biz.common.base.entity.Carbrand
;
import
com.glsx.biz.common.base.service.CarbrandService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -21,6 +28,9 @@ public class MerchantCommonService {
@Autowired
private
CarbrandService
carbrandService
;
@Autowired
private
MerchantRemote
merchantRemote
;
public
List
<
CarbrandResponse
>
getCarbrandTree
()
{
List
<
Carbrand
>
parentCarbrandList
=
carbrandService
.
getParentCarbrandList
();
List
<
Carbrand
>
allList
=
carbrandService
.
getAllList
();
...
...
@@ -39,4 +49,12 @@ public class MerchantCommonService {
}).
collect
(
Collectors
.
toList
());
return
collect
;
}
public
List
<
ChannelResponse
>
findAllChannel
()
{
RpcResponse
<
List
<
MerchantChannelResponse
>>
allChannel
=
merchantRemote
.
findAllChannel
();
if
(
allChannel
.
isSuccess
())
{
return
ConvertResponse
.
convertList
(
allChannel
.
getResult
(),
ChannelResponse
.
class
);
}
throw
new
RpcServiceException
(
allChannel
.
getException
().
getErrId
(),
allChannel
.
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