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 15c1b0f2
authored
Aug 04, 2021
by
zhouhb
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]代码修改
1 parent
cb43574b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
20 deletions
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSaveRequest.java
src/main/java/cn/com/glsx/merchants/response/MerchantRopResponse.java
src/main/java/cn/com/glsx/merchants/response/StaffResponse.java
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
src/test/java/cn/com/glsx/merchants/controller/BaseControllerTest.java
src/test/java/cn/com/glsx/merchants/controller/StaffControllerTest.java
src/main/java/cn/com/glsx/merchants/request/merchant/MerchantSaveRequest.java
View file @
15c1b0f
...
...
@@ -167,7 +167,7 @@ public class MerchantSaveRequest extends DefaultRequest implements Serializable
* 文件数据
*/
@ApiModelProperty
(
notes
=
"文件数据"
,
required
=
true
)
private
List
<
FileSaveRequest
>
merchantFiles
;
private
String
merchantFiles
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/response/MerchantRopResponse.java
View file @
15c1b0f
...
...
@@ -21,6 +21,21 @@ public class MerchantRopResponse {
@ApiModelProperty
(
name
=
"id"
,
notes
=
"商户名称"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
private
String
merchantName
;
/**
* 营业范围
*/
@ApiModelProperty
(
name
=
"businessScope"
,
notes
=
"营业范围"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
private
String
businessScope
;
/**
* 品牌
*/
@ApiModelProperty
(
name
=
"merchantBrand"
,
notes
=
"品牌"
,
dataType
=
"String"
,
required
=
true
,
example
=
"1"
,
value
=
"商户id"
)
private
String
merchantBrand
;
/**
* 商户简称
*/
...
...
src/main/java/cn/com/glsx/merchants/response/StaffResponse.java
View file @
15c1b0f
package
cn
.
com
.
glsx
.
merchants
.
response
;
import
cn.com.glsx.merchants.model.response.MerchantFileResponse
;
import
cn.com.glsx.merchants.model.response.MerchantUserResponse
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -114,10 +116,10 @@ public class StaffResponse implements Serializable {
/**
* 文件
*/
private
FileResponse
merchantFileResponse
;
private
Merchant
FileResponse
merchantFileResponse
;
/**
* 账号
*/
private
MerchantUserR
opR
esponse
merchantUserResponse
;
private
MerchantUserResponse
merchantUserResponse
;
}
\ No newline at end of file
src/main/java/cn/com/glsx/merchants/service/MerchantService.java
View file @
15c1b0f
...
...
@@ -14,6 +14,7 @@ import cn.com.glsx.merchants.request.file.FileSaveRequest;
import
cn.com.glsx.merchants.request.merchant.*
;
import
cn.com.glsx.merchants.response.*
;
import
cn.com.glsx.merchants.util.Pagination
;
import
com.alibaba.fastjson.JSONObject
;
import
com.glsx.plat.common.annotation.SysLog
;
import
com.glsx.plat.common.enums.OperateType
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -51,8 +52,8 @@ public class MerchantService {
private
MerchantRequest
converMerchant
(
MerchantSaveRequest
merchantSaveRequest
)
{
MerchantRequest
merchantRequest
=
ConvertRequest
.
convertRequest
(
merchantSaveRequest
,
new
MerchantRequest
());
List
<
FileSaveRequest
>
merchantFiles
=
merchantSaveRequest
.
getMerchantFiles
();
merchantRequest
.
setMerchantFiles
(
ConvertRequest
.
convertListRequest
(
merchantFiles
,
MerchantFileRequest
.
class
));
String
merchantFiles
=
merchantSaveRequest
.
getMerchantFiles
();
merchantRequest
.
setMerchantFiles
(
JSONObject
.
parseArray
(
merchantFiles
,
MerchantFileRequest
.
class
));
return
merchantRequest
;
}
...
...
src/test/java/cn/com/glsx/merchants/controller/BaseControllerTest.java
View file @
15c1b0f
...
...
@@ -84,14 +84,13 @@ public class BaseControllerTest {
}
}
String
sign
=
RopUtils
.
sign
(
params
.
toSingleValueMap
(),
secret
);
params
.
add
(
"sign"
,
sign
);
RestTemplate
rest
=
new
RestTemplate
();
RopUriTemplateHandler
uriTemplateHandler
=
new
RopUriTemplateHandler
(
url
);
uriTemplateHandler
.
setDefaultUriVariables
(
params
.
toSingleValueMap
());
rest
.
setUriTemplateHandler
(
uriTemplateHandler
);
url
=
url
+
"?"
+
getUrlParamsByMap
(
params
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
"TGT"
,
"
67d3ef25-2da5-4e2d-bbd8-79cb9d10150f
"
);
headers
.
add
(
"TGT"
,
"
1aaf2f5b-bbdf-42b3-83bb-fd3992f0e7e7
"
);
String
s
=
rest
.
postForObject
(
url
,
new
HttpEntity
<
String
>(
headers
),
String
.
class
);
return
s
;
}
...
...
@@ -151,7 +150,6 @@ public class BaseControllerTest {
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>(
16
);
params
.
add
(
"appKey"
,
appKey
);
params
.
add
(
"format"
,
"json"
);
params
.
add
(
"locale"
,
"zh_CN"
);
return
params
;
}
...
...
src/test/java/cn/com/glsx/merchants/controller/StaffControllerTest.java
View file @
15c1b0f
...
...
@@ -3,33 +3,38 @@ package cn.com.glsx.merchants.controller;/**
* @date 2021/7/28
*/
import
com.alibaba.fastjson.JSONObject
;
import
org.junit.Test
;
import
org.springframework.util.LinkedMultiValueMap
;
import
org.springframework.util.MultiValueMap
;
import
javax.xml.crypto.Data
;
/**
* @author zhouhaibao
* @version 1.0
* @description: TODO
* @date 2021/7/28 15:59
*/
public
class
StaffControllerTest
extends
BaseControllerTest
{
public
class
StaffControllerTest
extends
BaseControllerTest
{
@Test
public
void
testGetExample
()
throws
Exception
{
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<
String
,
String
>(
4
);
params
.
add
(
"v"
,
"1.0.0"
);
params
.
add
(
"method"
,
"cn.com.glsx.merchants.staff.saveStaff"
);
params
.
add
(
"name"
,
"alvin"
);
params
.
add
(
"staffName"
,
"贤心"
);
params
.
add
(
"staffJob"
,
"jkl"
);
params
.
add
(
"password"
,
"3"
);
params
.
add
(
"visibleInferiorMer"
,
"1"
);
params
.
add
(
"staffPhone"
,
"18873336682"
);
params
.
add
(
"merchantId"
,
"31"
);
params
.
add
(
"staffEmail"
,
"952643348@qq.com"
);
params
.
add
(
"roleIds[0]"
,
"342"
);
params
.
add
(
"merchantFileRequest.fileUrl"
,
"http://jhjhjhhj"
);
params
.
add
(
"merchantFileRequest.fileName"
,
"dfdfddssd"
);
System
.
out
.
println
(
getByHeader
(
params
));
params
.
add
(
"staffName"
,
"贤心"
);
params
.
add
(
"staffJob"
,
"jkl"
);
params
.
add
(
"password"
,
"3"
);
params
.
add
(
"visibleInferiorMer"
,
"1"
);
params
.
add
(
"staffPhone"
,
"18873336682"
);
params
.
add
(
"merchantId"
,
"31"
);
params
.
add
(
"staffEmail"
,
"952643348@qq.com"
);
params
.
add
(
"roleIds[0]"
,
"342"
);
MultiValueMap
<
String
,
String
>
newa
=
new
LinkedMultiValueMap
<
String
,
String
>(
4
);
newa
.
add
(
"fileUrl"
,
"http://jhjhjhhj"
);
newa
.
add
(
"fileName"
,
"dfdfddssd"
);
params
.
add
(
"merchantFileRequest"
,
JSONObject
.
toJSONString
(
newa
));
System
.
out
.
println
(
post
(
params
));
}
}
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