Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jiwei-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
马天浩
jiwei-api
Commits
d369b083
Commit
d369b083
authored
Jul 22, 2020
by
fanyl@watone.com.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口测试
parent
08d37a0a
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
484 additions
and
32 deletions
+484
-32
RequestController.java
...a/com/mth/requestsecret/controller/RequestController.java
+331
-32
SeventeenVO.java
...java/com/mth/requestsecret/controller/vo/SeventeenVO.java
+32
-0
SourceParamVO.java
...va/com/mth/requestsecret/controller/vo/SourceParamVO.java
+26
-0
TwentyVO.java
...in/java/com/mth/requestsecret/controller/vo/TwentyVO.java
+26
-0
RestTemlateService.java
...ava/com/mth/requestsecret/service/RestTemlateService.java
+69
-0
No files found.
src/main/java/com/mth/requestsecret/controller/RequestController.java
View file @
d369b083
This diff is collapsed.
Click to expand it.
src/main/java/com/mth/requestsecret/controller/vo/SeventeenVO.java
0 → 100644
View file @
d369b083
package
com
.
mth
.
requestsecret
.
controller
.
vo
;
import
lombok.Data
;
/**
* @author fyl
* @version v1.0
* @desc
* @date 2020-07-16 10:05
* @jdk 1.8
*/
@Data
public
class
SeventeenVO
{
//主事项编码
private
String
powerMatters
;
//请求人身份证/同一社会信用代码
private
String
idCard
;
//号牌号码
private
String
carNo
;
//请求人姓名/企业名称
private
String
userName
;
//请求部门名称
private
String
Organization
;
//办件流水号
private
String
projectId
;
//子事项编码:如无子项编码则填主项编码
private
String
subPowerMatters
;
private
String
additional
;
//号牌种类
private
String
hpzl
;
private
String
organizationId
;
}
\ No newline at end of file
src/main/java/com/mth/requestsecret/controller/vo/SourceParamVO.java
0 → 100644
View file @
d369b083
package
com
.
mth
.
requestsecret
.
controller
.
vo
;
import
lombok.Data
;
/**
* @author fyl
* @version v1.0
* @desc
* @date 2020-07-15 16:28
* @jdk 1.8
*/
@Data
public
class
SourceParamVO
{
private
String
userName
;
private
String
idCard
;
private
String
organization
;
private
String
organizationId
;
private
String
additional
;
//被执行人性质(自然人或者组织)
private
String
executorNature
;
//名称
private
String
orgName
;
//统一社会信用代码
private
String
uscCode
;
}
\ No newline at end of file
src/main/java/com/mth/requestsecret/controller/vo/TwentyVO.java
0 → 100644
View file @
d369b083
package
com
.
mth
.
requestsecret
.
controller
.
vo
;
import
lombok.Data
;
/**
* @author fyl
* @version v1.0
* @desc
* @date 2020-07-17 9:40
* @jdk 1.8
*/
@Data
public
class
TwentyVO
{
//不动产权字号
private
String
bdcqzh
;
//行政区编码(必传)
private
String
xzqbm
;
//权利人证件号(必传)
private
String
zjh
;
//权利人(必传)
private
String
qlr
;
//不动产坐落
private
String
zl
;
private
String
additional
;
}
\ No newline at end of file
src/main/java/com/mth/requestsecret/service/RestTemlateService.java
0 → 100644
View file @
d369b083
package
com
.
mth
.
requestsecret
.
service
;
import
com.mth.requestsecret.scheduler.RequestSecretSchedulerTask
;
import
com.mth.requestsecret.util.DSLUtils
;
import
com.mth.requestsecret.util.MD5Utils
;
import
lombok.extern.java.Log
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.*
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.Date
;
import
java.util.Map
;
/**
* @author fyl
* @version v1.0
* @desc
* @date 2020-07-16 15:00
* @jdk 1.8
*/
@Component
@Slf4j
public
class
RestTemlateService
{
@Autowired
private
RestTemplate
restTemplate
;
@Value
(
"${DATA_API_ADDRESS}"
)
private
String
pathUrl
;
@Value
(
"${app.key}"
)
private
String
appKey
;
public
ResponseEntity
<
String
>
commonSendRequest
(
MultiValueMap
<
String
,
Object
>
paramMap
,
final
String
apiMethod
)
{
// 请求url拼接api签名和公共参数
StringBuilder
url
=
new
StringBuilder
()
.
append
(
pathUrl
)
.
append
(
"/interface/public/service/risen-api/"
)
.
append
(
apiMethod
);
// 请求时间
String
requestTime
=
DSLUtils
.
dateToLong
(
new
Date
())
+
""
;
// 签名字符串
String
signStr
=
appKey
+
RequestSecretSchedulerTask
.
requestSecret
+
requestTime
;
// 组装请求参数
paramMap
.
add
(
"appKey"
,
appKey
);
paramMap
.
add
(
"sign"
,
MD5Utils
.
encoderByMd5
(
signStr
));
paramMap
.
add
(
"requestTime"
,
requestTime
);
// 日志记录
log
.
info
(
"纪委api:{}"
,
apiMethod
);
log
.
info
(
"api url:{}"
,
url
);
log
.
info
(
"api params:{}"
,
paramMap
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
setContentType
(
MediaType
.
APPLICATION_FORM_URLENCODED
);
// 发送请求
HttpEntity
<
MultiValueMap
<
String
,
Object
>>
request
=
new
HttpEntity
<>(
paramMap
,
headers
);
ResponseEntity
<
String
>
responseEntity
;
responseEntity
=
restTemplate
.
exchange
(
url
.
toString
(),
HttpMethod
.
POST
,
request
,
String
.
class
);
log
.
info
(
"api response:{}"
,
responseEntity
);
return
responseEntity
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment