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 2df7f531
authored
Sep 22, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]新增商户接口
1 parent
4c890cdb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
src/main/java/cn/com/glsx/merchants/controller/OpenController.java
src/main/java/cn/com/glsx/merchants/request/file/FileSaveRequest.java
src/main/java/cn/com/glsx/merchants/service/OpenService.java
src/main/java/cn/com/glsx/merchants/controller/OpenController.java
View file @
2df7f53
...
...
@@ -2,6 +2,8 @@ package cn.com.glsx.merchants.controller;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.framework.rop.response.RopResponse
;
import
cn.com.glsx.merchants.request.merchant.MerchantSaveOpenRequest
;
import
cn.com.glsx.merchants.request.merchant.MerchantSaveRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantRequest
;
import
cn.com.glsx.merchants.request.user.OpenUserRequest
;
...
...
@@ -130,4 +132,23 @@ public class OpenController {
}
}
/**
* 保存商户信息接口(对外)
*
* @param merchantSaveRequest 入参
* @return
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.open.saveMerchant"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"保存商户信息接口(对外)"
)
public
RopResponse
<
Integer
>
saveMerchant
(
MerchantSaveOpenRequest
merchantSaveRequest
)
{
try
{
Integer
merchant
=
openService
.
saveMerchant
(
merchantSaveRequest
);
return
RopResponse
.
success
(
merchant
);
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======OpenController__invoke__saveMerchant__exception:{}"
,
e
.
getMessage
());
return
RopResponse
.
error
(
e
.
getErrId
(),
e
.
getMessage
());
}
}
}
src/main/java/cn/com/glsx/merchants/request/file/FileSaveRequest.java
View file @
2df7f53
...
...
@@ -18,12 +18,12 @@ public class FileSaveRequest extends DefaultRequest implements Serializable {
/**
* 图片路径
*/
@ApiModelProperty
(
notes
=
"图片路径"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"图片路径"
)
private
String
fileUrl
;
/**
* 图片名称
*/
@ApiModelProperty
(
notes
=
"图片名称"
,
required
=
true
)
@ApiModelProperty
(
notes
=
"图片名称"
)
private
String
fileName
;
}
src/main/java/cn/com/glsx/merchants/service/OpenService.java
View file @
2df7f53
...
...
@@ -5,13 +5,17 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import
cn.com.glsx.framework.core.exception.RpcServiceException
;
import
cn.com.glsx.merchants.convert.ConvertRequest
;
import
cn.com.glsx.merchants.convert.ConvertResponse
;
import
cn.com.glsx.merchants.model.request.MerchantFileRequest
;
import
cn.com.glsx.merchants.model.request.MerchantOpenRequest
;
import
cn.com.glsx.merchants.model.request.MerchantRequest
;
import
cn.com.glsx.merchants.model.request.MerchantUserRequest
;
import
cn.com.glsx.merchants.model.response.AccountTypeTreeResponse
;
import
cn.com.glsx.merchants.model.response.MerchantResponse
;
import
cn.com.glsx.merchants.model.response.MerchantUserResponse
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
cn.com.glsx.merchants.remote.MerchantUserRemote
;
import
cn.com.glsx.merchants.request.merchant.MerchantSaveOpenRequest
;
import
cn.com.glsx.merchants.request.merchant.MerchantSaveRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantPageRequest
;
import
cn.com.glsx.merchants.request.merchant.OpenMerchantRequest
;
import
cn.com.glsx.merchants.request.user.OpenUserRequest
;
...
...
@@ -19,6 +23,8 @@ import cn.com.glsx.merchants.response.AccountTypeTreeRopResponse;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
import
cn.com.glsx.merchants.response.OpenUserResponse
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -103,4 +109,12 @@ public class OpenService {
throw
new
RpcServiceException
(
menuFunPermission
.
getException
().
getErrId
(),
menuFunPermission
.
getMessage
());
}
public
Integer
saveMerchant
(
MerchantSaveOpenRequest
merchantSaveRequest
)
{
RpcResponse
<
Integer
>
booleanRpcResponse
=
merchantRemote
.
saveMerchantRemote
(
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
()));
if
(
booleanRpcResponse
.
isSuccess
())
{
return
booleanRpcResponse
.
getResult
();
}
throw
new
RpcServiceException
(
booleanRpcResponse
.
getException
().
getErrId
(),
booleanRpcResponse
.
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