Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
QA
holmes
Commits
bfcf7496
Commit
bfcf7496
authored
Aug 12, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增多订单白名单mock
parent
668dd4c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
RuleEngineInterceptor.java
.../java/cn/qg/holmes/interceptor/RuleEngineInterceptor.java
+19
-0
No files found.
src/main/java/cn/qg/holmes/interceptor/RuleEngineInterceptor.java
View file @
bfcf7496
...
@@ -31,6 +31,9 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
...
@@ -31,6 +31,9 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
@Value
(
"${early.settle.channel}"
)
@Value
(
"${early.settle.channel}"
)
private
String
earlySettleChannel
;
private
String
earlySettleChannel
;
@Value
(
"${xyqb.isInWhiteList}"
)
private
String
xyqbIsInWhiteList
;
public
Map
<
String
,
Object
>
convertParameterMap
(
Map
<
String
,
String
[]>
parameterMap
)
{
public
Map
<
String
,
Object
>
convertParameterMap
(
Map
<
String
,
String
[]>
parameterMap
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
Map
.
Entry
<
String
,
String
[]>
entry:
parameterMap
.
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
[]>
entry:
parameterMap
.
entrySet
())
{
...
@@ -64,6 +67,22 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
...
@@ -64,6 +67,22 @@ public class RuleEngineInterceptor implements HandlerInterceptor {
InterceptorUtils
.
constructResponse
(
response
,
JSON
.
toJSONString
(
responseMap
),
"application/json; charset=utf-8"
);
InterceptorUtils
.
constructResponse
(
response
,
JSON
.
toJSONString
(
responseMap
),
"application/json; charset=utf-8"
);
return
false
;
return
false
;
}
}
// 多订单白名单mock
if
(
uri
.
equals
(
"/ex/isInWhiteList"
))
{
Map
<
String
,
Object
>
whiteListResult
=
new
HashMap
<>();
if
(
xyqbIsInWhiteList
.
equals
(
"true"
))
{
whiteListResult
.
put
(
"code"
,
0
);
whiteListResult
.
put
(
"businessCode"
,
"0000"
);
whiteListResult
.
put
(
"msg"
,
"命中"
);
}
else
if
(
xyqbIsInWhiteList
.
equals
(
"false"
))
{
whiteListResult
.
put
(
"code"
,
0
);
whiteListResult
.
put
(
"businessCode"
,
"0001"
);
whiteListResult
.
put
(
"msg"
,
"未命中"
);
}
whiteListResult
.
put
(
"body"
,
null
);
InterceptorUtils
.
constructResponse
(
response
,
JSON
.
toJSONString
(
whiteListResult
),
"application/json; charset=utf-8"
);
return
false
;
}
log
.
info
(
"{}的mock响应为:{}"
,
uri
,
mockData
);
log
.
info
(
"{}的mock响应为:{}"
,
uri
,
mockData
);
InterceptorUtils
.
constructResponse
(
response
,
mockData
,
"application/json; charset=utf-8"
);
InterceptorUtils
.
constructResponse
(
response
,
mockData
,
"application/json; charset=utf-8"
);
return
false
;
return
false
;
...
...
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