Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cash-loan-flow-boss
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QG
cash-loan-flow-boss
Commits
f349304a
Commit
f349304a
authored
Jan 02, 2020
by
shangying
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sonar问题修改11
parent
db0e7263
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
EnvUtil.java
...java/cn/quantgroup/cashloanflowboss/utils/ci/EnvUtil.java
+6
-0
HttpService.java
...n/quantgroup/cashloanflowboss/utils/http/HttpService.java
+9
-18
No files found.
src/main/java/cn/quantgroup/cashloanflowboss/utils/ci/EnvUtil.java
View file @
f349304a
...
...
@@ -114,6 +114,9 @@ public class EnvUtil {
for
(
Map
.
Entry
<
Object
,
Object
>
property
:
propertySet
)
{
String
propertyKey
=
property
.
getKey
().
toString
();
String
lowerCase
=
ciEnv
.
toLowerCase
();
if
(
StringUtils
.
isBlank
(
lowerCase
)){
return
env
;
}
if
(
propertyKey
.
toLowerCase
().
contains
(
String
.
format
(
"dubbo.%s.%s."
,
siteName
.
toLowerCase
(),
lowerCase
)))
{
// �������÷���
env
=
propertyKey
.
split
(
"\\."
)[
2
];
...
...
@@ -139,6 +142,9 @@ public class EnvUtil {
for
(
Map
.
Entry
<
Object
,
Object
>
property
:
propertySet
)
{
String
propertyKey
=
property
.
getKey
().
toString
();
String
lowerCase
=
ciEnv
.
toLowerCase
();
if
(
StringUtils
.
isBlank
(
lowerCase
)){
return
env
;
}
if
(
propertyKey
.
toLowerCase
().
contains
(
String
.
format
(
"http.%s.%s."
,
siteName
.
toLowerCase
(),
lowerCase
)))
{
// �������÷���,�����ַ�������Сд
env
=
propertyKey
.
split
(
"\\."
)[
2
];
...
...
src/main/java/cn/quantgroup/cashloanflowboss/utils/http/HttpService.java
View file @
f349304a
...
...
@@ -189,19 +189,12 @@ public class HttpService {
}
else
{
result
=
doResponse
(
response
,
urlString
);
// 得到响应状态码
int
statuCode
=
response
.
getStatusLine
().
getStatusCode
();
if
(!
Objects
.
isNull
(
statuCode
)){
resultEntity
.
setStatusCode
(
statuCode
);
}
else
{
log
.
info
(
"返回的数据有问题statuCode={}"
,
statuCode
);
}
resultEntity
.
setResponseString
(
result
);
resultEntity
.
setCookies
(
cookieStore
.
getCookies
());
if
(!
Objects
.
isNull
(
response
.
getStatusLine
()))
{
resultEntity
.
setStatusCode
(
response
.
getStatusLine
().
getStatusCode
());
}
resultEntity
.
setResponseString
(
result
);
resultEntity
.
setCookies
(
cookieStore
.
getCookies
());
}
}
catch
(
MalformedURLException
e
)
{
...
...
@@ -220,15 +213,13 @@ public class HttpService {
if
(
response
!=
null
)
{
try
{
response
.
close
();
httpGet
.
abort
();
}
catch
(
IOException
e
)
{
// e.printStackTrace();
log
.
info
(
"异常信息e={}"
,
e
);
}
}
if
(!
Objects
.
isNull
(
httpGet
)){
httpGet
.
abort
();
}
}
...
...
@@ -299,16 +290,16 @@ public class HttpService {
return
resultEntity
;
}
else
{
result
=
doResponse
(
response
,
url
);
resultEntity
.
setResponseString
(
result
);
resultEntity
.
setCookies
(
cookieStore
.
getCookies
());
if
(!
Objects
.
isNull
(
response
.
getStatusLine
())
)
{
resultEntity
.
setStatusCode
(
response
.
getStatusLine
().
getStatusCode
());
}
resultEntity
.
setResponseString
(
result
);
resultEntity
.
setCookies
(
cookieStore
.
getCookies
());
}
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
// ex.printStackTrace();
log
.
info
(
"异常信息ex={}"
,
ex
);
}
return
resultEntity
;
...
...
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