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 6ba55926
authored
Oct 12, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码提交
1 parent
d5496023
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
src/main/java/cn/com/glsx/merchants/response/MerchantRopListRes.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/test/java/cn/com/glsx/merchants/controller/ExampleControllerTest.java
src/main/java/cn/com/glsx/merchants/controller/MerchantController.java
View file @
6ba5592
...
@@ -5,10 +5,7 @@ import cn.com.glsx.framework.rop.response.RopResponse;
...
@@ -5,10 +5,7 @@ import cn.com.glsx.framework.rop.response.RopResponse;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.request.accounttype.AccountTypeSearchRequest
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.request.role.RoleSearchRequest
;
import
cn.com.glsx.merchants.request.role.RoleSearchRequest
;
import
cn.com.glsx.merchants.response.AccountTypeTreeRopResponse
;
import
cn.com.glsx.merchants.response.*
;
import
cn.com.glsx.merchants.response.MerchantBaseInfoRopResponse
;
import
cn.com.glsx.merchants.response.MerchantRopResponse
;
import
cn.com.glsx.merchants.response.MerchantTreeRopResponse
;
import
cn.com.glsx.merchants.service.MerchantService
;
import
cn.com.glsx.merchants.service.MerchantService
;
import
cn.com.glsx.merchants.util.Pagination
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.rop.annotation.NeedInSessionType
;
import
com.rop.annotation.NeedInSessionType
;
...
@@ -261,9 +258,9 @@ public class MerchantController {
...
@@ -261,9 +258,9 @@ public class MerchantController {
*/
*/
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findAllMerchant"
,
needInSession
=
NeedInSessionType
.
NO
)
@ServiceMethod
(
method
=
"cn.com.glsx.merchants.menu.findAllMerchant"
,
needInSession
=
NeedInSessionType
.
NO
)
@ApiOperation
(
"查询所有商户"
)
@ApiOperation
(
"查询所有商户"
)
public
RopResponse
<
List
<
MerchantRop
Response
>>
findAllMerchant
(
MerchantFindRequest
merchantFindRequest
)
{
public
RopResponse
<
List
<
MerchantRop
ListRes
>>
findAllMerchant
(
MerchantFindRequest
merchantFindRequest
)
{
try
{
try
{
List
<
MerchantRop
Response
>
list
=
merchantService
.
findAllMerchant
(
merchantFindRequest
);
List
<
MerchantRop
ListRes
>
list
=
merchantService
.
findAllMerchant
(
merchantFindRequest
);
return
RopResponse
.
success
(
list
);
return
RopResponse
.
success
(
list
);
}
catch
(
RpcServiceException
e
)
{
}
catch
(
RpcServiceException
e
)
{
log
.
info
(
"=======MerchantMenuController__invoke__findAllMerchant__exception:{}"
,
e
.
getMessage
());
log
.
info
(
"=======MerchantMenuController__invoke__findAllMerchant__exception:{}"
,
e
.
getMessage
());
...
...
src/main/java/cn/com/glsx/merchants/response/MerchantRopListRes.java
0 → 100644
View file @
6ba5592
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/10/12 11:41
*/
public
class
MerchantRopListRes
{
@ApiModelProperty
(
name
=
"id"
,
notes
=
"商户id"
,
dataType
=
"Integer"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
private
Integer
id
;
/**
* 商户名称
*/
@ApiModelProperty
(
name
=
"id"
,
notes
=
"商户名称"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
private
String
merchantName
;
}
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
6ba5592
...
@@ -207,10 +207,10 @@ public class MerchantService {
...
@@ -207,10 +207,10 @@ public class MerchantService {
*
*
* @return
* @return
*/
*/
public
List
<
MerchantRop
Response
>
findAllMerchant
(
MerchantFindRequest
merchantFindRequest
)
{
public
List
<
MerchantRop
ListRes
>
findAllMerchant
(
MerchantFindRequest
merchantFindRequest
)
{
RpcResponse
<
List
<
MerchantResponse
>>
allMerchantRemote
=
merchantRemote
.
findAllMerchantRemote
(
ConvertRequest
.
convertRequest
(
merchantFindRequest
,
new
MerchantRequest
()));
RpcResponse
<
List
<
MerchantResponse
>>
allMerchantRemote
=
merchantRemote
.
findAllMerchantRemote
(
ConvertRequest
.
convertRequest
(
merchantFindRequest
,
new
MerchantRequest
()));
if
(
allMerchantRemote
.
isSuccess
())
{
if
(
allMerchantRemote
.
isSuccess
())
{
return
ConvertResponse
.
convertList
(
allMerchantRemote
.
getResult
(),
MerchantRop
Response
.
class
);
return
ConvertResponse
.
convertList
(
allMerchantRemote
.
getResult
(),
MerchantRop
ListRes
.
class
);
}
}
throw
new
RpcServiceException
(
allMerchantRemote
.
getException
().
getErrId
(),
allMerchantRemote
.
getMessage
());
throw
new
RpcServiceException
(
allMerchantRemote
.
getException
().
getErrId
(),
allMerchantRemote
.
getMessage
());
}
}
...
...
src/test/java/cn/com/glsx/merchants/controller/ExampleControllerTest.java
View file @
6ba5592
...
@@ -2,7 +2,10 @@ package cn.com.glsx.merchants.controller;
...
@@ -2,7 +2,10 @@ package cn.com.glsx.merchants.controller;
import
java.util.Base64
;
import
java.util.Base64
;
import
cn.com.glsx.merchants.model.request.MerchantRequest
;
import
cn.com.glsx.merchants.remote.MerchantRemote
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.core.io.ClassPathResource
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
...
@@ -19,6 +22,8 @@ import com.rop.request.UploadFile;
...
@@ -19,6 +22,8 @@ import com.rop.request.UploadFile;
* @Copyright Copyright (c) 2018
* @Copyright Copyright (c) 2018
*/
*/
public
class
ExampleControllerTest
extends
BaseControllerTest
{
public
class
ExampleControllerTest
extends
BaseControllerTest
{
@Autowired
private
MerchantRemote
merchantRemote
;
@Test
@Test
public
void
testGetExample
()
throws
Exception
{
public
void
testGetExample
()
throws
Exception
{
...
@@ -72,4 +77,12 @@ public class ExampleControllerTest extends BaseControllerTest {
...
@@ -72,4 +77,12 @@ public class ExampleControllerTest extends BaseControllerTest {
fileParams
.
add
(
"file"
,
"png@"
+
Base64
.
getEncoder
().
encodeToString
(
uploadFile
.
getContent
()));
fileParams
.
add
(
"file"
,
"png@"
+
Base64
.
getEncoder
().
encodeToString
(
uploadFile
.
getContent
()));
System
.
out
.
println
(
upload
(
params
,
fileParams
));
System
.
out
.
println
(
upload
(
params
,
fileParams
));
}
}
@Test
public
void
test
()
throws
Exception
{
MerchantRequest
merchantRequest
=
new
MerchantRequest
();
merchantRequest
.
setSource
(
"OP"
);
System
.
out
.
println
(
merchantRemote
.
findAllMerchantRemote
(
merchantRequest
));
}
}
}
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