Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-api
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 b0f0b8b5
authored
Mar 23, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
移动feign配置到nacos上
1 parent
cd9cebb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
src/main/java/com/glsx/api/exception/GlobalExceptionHandler.java
src/main/resources/application.properties
src/main/java/com/glsx/api/exception/GlobalExceptionHandler.java
View file @
b0f0b8b
...
@@ -77,8 +77,13 @@ public class GlobalExceptionHandler {
...
@@ -77,8 +77,13 @@ public class GlobalExceptionHandler {
@ExceptionHandler
({
FeignException
.
class
})
@ExceptionHandler
({
FeignException
.
class
})
public
R
handleFeignException
(
FeignException
e
)
{
public
R
handleFeignException
(
FeignException
e
)
{
log
.
error
(
"!!!! 远程服务错误"
,
e
);
log
.
error
(
"!!!! 远程服务错误"
,
e
);
JSONObject
respObj
=
JSON
.
parseObject
(
e
.
contentUTF8
());
String
respMessage
;
String
respMessage
=
respObj
.
getString
(
"message"
);
if
(
StringUtils
.
isNotBlank
(
e
.
contentUTF8
()))
{
JSONObject
respObj
=
JSON
.
parseObject
(
e
.
contentUTF8
());
respMessage
=
respObj
.
getString
(
"message"
);
}
else
{
respMessage
=
""
;
}
int
code
=
ResultEnum
.
REMOTE_SERVICE_ERROR
.
getCode
();
int
code
=
ResultEnum
.
REMOTE_SERVICE_ERROR
.
getCode
();
String
message
=
StringUtils
.
isBlank
(
respMessage
)
String
message
=
StringUtils
.
isBlank
(
respMessage
)
?
ResultEnum
.
REMOTE_SERVICE_ERROR
.
getMessage
()
:
respMessage
;
?
ResultEnum
.
REMOTE_SERVICE_ERROR
.
getMessage
()
:
respMessage
;
...
...
src/main/resources/application.properties
View file @
b0f0b8b
...
@@ -15,9 +15,6 @@ logging.level.org.springframework.boot.autoconfigure=off
...
@@ -15,9 +15,6 @@ logging.level.org.springframework.boot.autoconfigure=off
logging.level.com.glsx.api
=
DEBUG
logging.level.com.glsx.api
=
DEBUG
logging.path
=
/data/java_log/jetty/smartService/chejia-smart-api
logging.path
=
/data/java_log/jetty/smartService/chejia-smart-api
feign.server.name
=
chejia-smart-service
feign.server.url
=
http://localhost:8209/smartService
dubbo.registry.address
=
zookeeper://192.168.1.36:2181?init.timeout=60000
dubbo.registry.address
=
zookeeper://192.168.1.36:2181?init.timeout=60000
dubbo.registry.timeout
=
10000
dubbo.registry.timeout
=
10000
...
...
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