Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢捷峰
discovery
Commits
9138da46
Commit
9138da46
authored
Sep 10, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构类结构
parent
ec15c596
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
86 additions
and
81 deletions
+86
-81
discovery-common/pom.xml
+5
-0
discovery-common/src/main/java/com/nepxion/discovery/common/handler/RestErrorHandler.java
+2
-2
discovery-common/src/main/java/com/nepxion/discovery/common/util/JsonUtil.java
+1
-3
discovery-common/src/main/java/com/nepxion/discovery/common/util/RestUtil.java
+44
-0
discovery-common/src/main/java/com/nepxion/discovery/common/util/UrlUtil.java
+12
-0
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/controller/ServiceController.java
+18
-38
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/controller/ServiceErrorHandler.java
+0
-33
discovery-console/src/main/java/com/nepxion/discovery/console/configuration/ConsoleAutoConfiguration.java
+2
-2
discovery-console/src/main/java/com/nepxion/discovery/console/rest/AbstractRestInvoker.java
+2
-3
No files found.
discovery-common/pom.xml
View file @
9138da46
...
@@ -31,6 +31,11 @@
...
@@ -31,6 +31,11 @@
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<artifactId>
jackson-databind
</artifactId>
</dependency>
</dependency>
...
...
discovery-co
nsole/src/main/java/com/nepxion/discovery/console/handler/Console
ErrorHandler.java
→
discovery-co
mmon/src/main/java/com/nepxion/discovery/common/handler/Rest
ErrorHandler.java
View file @
9138da46
package
com
.
nepxion
.
discovery
.
co
nsole
.
handler
;
package
com
.
nepxion
.
discovery
.
co
mmon
.
handler
;
/**
/**
* <p>Title: Nepxion Discovery</p>
* <p>Title: Nepxion Discovery</p>
...
@@ -18,7 +18,7 @@ import org.springframework.web.client.DefaultResponseErrorHandler;
...
@@ -18,7 +18,7 @@ import org.springframework.web.client.DefaultResponseErrorHandler;
import
com.nepxion.discovery.common.constant.DiscoveryConstant
;
import
com.nepxion.discovery.common.constant.DiscoveryConstant
;
public
class
Console
ErrorHandler
extends
DefaultResponseErrorHandler
{
public
class
Rest
ErrorHandler
extends
DefaultResponseErrorHandler
{
private
String
cause
;
private
String
cause
;
@Override
@Override
...
...
discovery-common/src/main/java/com/nepxion/discovery/common/util/JsonUtil.java
View file @
9138da46
...
@@ -9,8 +9,6 @@ package com.nepxion.discovery.common.util;
...
@@ -9,8 +9,6 @@ package com.nepxion.discovery.common.util;
* @version 1.0
* @version 1.0
*/
*/
import
java.text.SimpleDateFormat
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
...
@@ -22,7 +20,7 @@ public class JsonUtil {
...
@@ -22,7 +20,7 @@ public class JsonUtil {
static
{
static
{
objectMapper
=
new
ObjectMapper
();
objectMapper
=
new
ObjectMapper
();
objectMapper
.
setDateFormat
(
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss.SSS"
));
//
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"));
}
}
public
static
<
T
>
String
toJson
(
T
object
)
{
public
static
<
T
>
String
toJson
(
T
object
)
{
...
...
discovery-common/src/main/java/com/nepxion/discovery/common/util/RestUtil.java
0 → 100644
View file @
9138da46
package
com
.
nepxion
.
discovery
.
common
.
util
;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.web.client.ResponseErrorHandler
;
import
org.springframework.web.client.RestTemplate
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.nepxion.discovery.common.handler.RestErrorHandler
;
public
class
RestUtil
{
public
static
<
T
>
T
fromJson
(
RestTemplate
restTemplate
,
String
result
,
TypeReference
<
T
>
typeReference
)
{
try
{
return
JsonUtil
.
fromJson
(
result
,
typeReference
);
}
catch
(
Exception
e
)
{
String
cause
=
getCause
(
restTemplate
);
if
(
StringUtils
.
isNotEmpty
(
cause
))
{
throw
new
IllegalArgumentException
(
cause
);
}
throw
e
;
}
}
public
static
String
getCause
(
RestTemplate
restTemplate
)
{
ResponseErrorHandler
responseErrorHandler
=
restTemplate
.
getErrorHandler
();
if
(
responseErrorHandler
instanceof
RestErrorHandler
)
{
RestErrorHandler
errorHandler
=
(
RestErrorHandler
)
responseErrorHandler
;
return
errorHandler
.
getCause
();
}
return
null
;
}
}
\ No newline at end of file
discovery-common/src/main/java/com/nepxion/discovery/common/util/UrlUtil.java
View file @
9138da46
...
@@ -12,6 +12,18 @@ package com.nepxion.discovery.common.util;
...
@@ -12,6 +12,18 @@ package com.nepxion.discovery.common.util;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
public
class
UrlUtil
{
public
class
UrlUtil
{
public
static
String
formatUrl
(
String
url
)
{
if
(!
url
.
startsWith
(
"http://"
))
{
url
=
"http://"
+
url
;
}
if
(!
url
.
endsWith
(
"/"
))
{
url
=
url
+
"/"
;
}
return
url
;
}
public
static
String
formatContextPath
(
String
contextPath
)
{
public
static
String
formatContextPath
(
String
contextPath
)
{
if
(
StringUtils
.
isEmpty
(
contextPath
))
{
if
(
StringUtils
.
isEmpty
(
contextPath
))
{
contextPath
=
"/"
;
contextPath
=
"/"
;
...
...
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/controller/ServiceController.java
View file @
9138da46
...
@@ -21,7 +21,8 @@ import org.springframework.web.client.RestTemplate;
...
@@ -21,7 +21,8 @@ import org.springframework.web.client.RestTemplate;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.nepxion.discovery.common.entity.ResultEntity
;
import
com.nepxion.discovery.common.entity.ResultEntity
;
import
com.nepxion.discovery.common.entity.RouterEntity
;
import
com.nepxion.discovery.common.entity.RouterEntity
;
import
com.nepxion.discovery.common.util.JsonUtil
;
import
com.nepxion.discovery.common.handler.RestErrorHandler
;
import
com.nepxion.discovery.common.util.RestUtil
;
import
com.nepxion.discovery.common.util.UrlUtil
;
import
com.nepxion.discovery.common.util.UrlUtil
;
import
com.nepxion.discovery.console.desktop.context.PropertiesContext
;
import
com.nepxion.discovery.console.desktop.context.PropertiesContext
;
import
com.nepxion.discovery.console.desktop.entity.Instance
;
import
com.nepxion.discovery.console.desktop.entity.Instance
;
...
@@ -31,7 +32,7 @@ public class ServiceController {
...
@@ -31,7 +32,7 @@ public class ServiceController {
static
{
static
{
restTemplate
=
new
RestTemplate
();
restTemplate
=
new
RestTemplate
();
restTemplate
.
setErrorHandler
(
new
Service
ErrorHandler
());
restTemplate
.
setErrorHandler
(
new
Rest
ErrorHandler
());
}
}
public
static
Map
<
String
,
List
<
Instance
>>
getInstanceMap
()
{
public
static
Map
<
String
,
List
<
Instance
>>
getInstanceMap
()
{
...
@@ -39,7 +40,7 @@ public class ServiceController {
...
@@ -39,7 +40,7 @@ public class ServiceController {
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
Map
<
String
,
List
<
Instance
>>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
Map
<
String
,
List
<
Instance
>>>()
{
});
});
}
}
...
@@ -48,7 +49,7 @@ public class ServiceController {
...
@@ -48,7 +49,7 @@ public class ServiceController {
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
List
<
String
>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
String
>>()
{
});
});
}
}
...
@@ -57,7 +58,7 @@ public class ServiceController {
...
@@ -57,7 +58,7 @@ public class ServiceController {
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
getForEntity
(
url
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
List
<
String
>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
String
>>()
{
});
});
}
}
...
@@ -66,7 +67,7 @@ public class ServiceController {
...
@@ -66,7 +67,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
routeServiceIds
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
routeServiceIds
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
RouterEntity
>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
RouterEntity
>()
{
});
});
}
}
...
@@ -81,8 +82,7 @@ public class ServiceController {
...
@@ -81,8 +82,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
).
getBody
();
if
(!
StringUtils
.
equals
(
result
,
"OK"
)
&&
!
StringUtils
.
equals
(
result
,
"NO"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
)
&&
!
StringUtils
.
equals
(
result
,
"NO"
))
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
return
result
;
return
result
;
...
@@ -94,8 +94,7 @@ public class ServiceController {
...
@@ -94,8 +94,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
if
(!
StringUtils
.
equals
(
result
,
"OK"
)
&&
!
StringUtils
.
equals
(
result
,
"NO"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
)
&&
!
StringUtils
.
equals
(
result
,
"NO"
))
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
return
result
;
return
result
;
...
@@ -119,7 +118,7 @@ public class ServiceController {
...
@@ -119,7 +118,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
});
});
}
}
...
@@ -134,8 +133,7 @@ public class ServiceController {
...
@@ -134,8 +133,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
entity
,
String
.
class
).
getBody
();
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
return
result
;
return
result
;
...
@@ -146,7 +144,7 @@ public class ServiceController {
...
@@ -146,7 +144,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
});
});
}
}
...
@@ -156,8 +154,7 @@ public class ServiceController {
...
@@ -156,8 +154,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
return
result
;
return
result
;
...
@@ -168,7 +165,7 @@ public class ServiceController {
...
@@ -168,7 +165,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
version
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
version
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
});
});
}
}
...
@@ -178,8 +175,7 @@ public class ServiceController {
...
@@ -178,8 +175,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
version
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
version
,
String
.
class
).
getBody
();
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
return
result
;
return
result
;
...
@@ -190,7 +186,7 @@ public class ServiceController {
...
@@ -190,7 +186,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
return
convert
(
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
return
RestUtil
.
fromJson
(
restTemplate
,
result
,
new
TypeReference
<
List
<
ResultEntity
>>()
{
});
});
}
}
...
@@ -200,8 +196,7 @@ public class ServiceController {
...
@@ -200,8 +196,7 @@ public class ServiceController {
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
String
result
=
restTemplate
.
postForEntity
(
url
,
null
,
String
.
class
).
getBody
();
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
return
result
;
return
result
;
...
@@ -209,11 +204,8 @@ public class ServiceController {
...
@@ -209,11 +204,8 @@ public class ServiceController {
private
static
String
getUrl
()
{
private
static
String
getUrl
()
{
String
url
=
PropertiesContext
.
getProperties
().
getString
(
"url"
);
String
url
=
PropertiesContext
.
getProperties
().
getString
(
"url"
);
if
(!
url
.
endsWith
(
"/"
))
{
url
+=
"/"
;
}
return
url
;
return
UrlUtil
.
formatUrl
(
url
)
;
}
}
private
static
String
getUrl
(
Instance
instance
)
{
private
static
String
getUrl
(
Instance
instance
)
{
...
@@ -225,15 +217,4 @@ public class ServiceController {
...
@@ -225,15 +217,4 @@ public class ServiceController {
private
static
String
getInvokeType
(
boolean
async
)
{
private
static
String
getInvokeType
(
boolean
async
)
{
return
async
?
"async"
:
"sync"
;
return
async
?
"async"
:
"sync"
;
}
}
private
static
<
T
>
T
convert
(
String
result
,
TypeReference
<
T
>
typeReference
)
{
try
{
return
JsonUtil
.
fromJson
(
result
,
typeReference
);
}
catch
(
Exception
e
)
{
ServiceErrorHandler
errorHandler
=
(
ServiceErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
errorHandler
.
getCause
();
throw
new
IllegalArgumentException
(
result
);
}
}
}
}
\ No newline at end of file
discovery-console-desktop/src/main/java/com/nepxion/discovery/console/desktop/controller/ServiceErrorHandler.java
deleted
100644 → 0
View file @
ec15c596
package
com
.
nepxion
.
discovery
.
console
.
desktop
.
controller
;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
import
java.io.IOException
;
import
java.io.InputStream
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.http.client.ClientHttpResponse
;
import
org.springframework.web.client.DefaultResponseErrorHandler
;
public
class
ServiceErrorHandler
extends
DefaultResponseErrorHandler
{
private
String
cause
;
@Override
public
void
handleError
(
ClientHttpResponse
response
)
throws
IOException
{
// 这里绝对不能关闭InputStream
InputStream
inputStream
=
response
.
getBody
();
cause
=
IOUtils
.
toString
(
inputStream
,
"UTF-8"
);
}
public
String
getCause
()
{
return
cause
;
}
}
\ No newline at end of file
discovery-console/src/main/java/com/nepxion/discovery/console/configuration/ConsoleAutoConfiguration.java
View file @
9138da46
...
@@ -16,8 +16,8 @@ import org.springframework.context.annotation.Configuration;
...
@@ -16,8 +16,8 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.web.client.RestTemplate
;
import
org.springframework.web.client.RestTemplate
;
import
com.nepxion.discovery.common.handler.RestErrorHandler
;
import
com.nepxion.discovery.console.endpoint.ConsoleEndpoint
;
import
com.nepxion.discovery.console.endpoint.ConsoleEndpoint
;
import
com.nepxion.discovery.console.handler.ConsoleErrorHandler
;
@Configuration
@Configuration
@Import
(
SwaggerConfiguration
.
class
)
@Import
(
SwaggerConfiguration
.
class
)
...
@@ -46,7 +46,7 @@ public class ConsoleAutoConfiguration {
...
@@ -46,7 +46,7 @@ public class ConsoleAutoConfiguration {
@Bean
@Bean
public
RestTemplate
consoleRestTemplate
()
{
public
RestTemplate
consoleRestTemplate
()
{
RestTemplate
restTemplate
=
new
RestTemplate
();
RestTemplate
restTemplate
=
new
RestTemplate
();
restTemplate
.
setErrorHandler
(
new
Console
ErrorHandler
());
restTemplate
.
setErrorHandler
(
new
Rest
ErrorHandler
());
return
restTemplate
;
return
restTemplate
;
}
}
...
...
discovery-console/src/main/java/com/nepxion/discovery/console/rest/AbstractRestInvoker.java
View file @
9138da46
...
@@ -24,8 +24,8 @@ import org.springframework.web.client.RestTemplate;
...
@@ -24,8 +24,8 @@ import org.springframework.web.client.RestTemplate;
import
com.nepxion.discovery.common.constant.DiscoveryConstant
;
import
com.nepxion.discovery.common.constant.DiscoveryConstant
;
import
com.nepxion.discovery.common.entity.ResultEntity
;
import
com.nepxion.discovery.common.entity.ResultEntity
;
import
com.nepxion.discovery.common.util.RestUtil
;
import
com.nepxion.discovery.common.util.UrlUtil
;
import
com.nepxion.discovery.common.util.UrlUtil
;
import
com.nepxion.discovery.console.handler.ConsoleErrorHandler
;
public
abstract
class
AbstractRestInvoker
{
public
abstract
class
AbstractRestInvoker
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AbstractRestInvoker
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AbstractRestInvoker
.
class
);
...
@@ -61,8 +61,7 @@ public abstract class AbstractRestInvoker {
...
@@ -61,8 +61,7 @@ public abstract class AbstractRestInvoker {
result
=
doRest
(
url
);
result
=
doRest
(
url
);
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
if
(!
StringUtils
.
equals
(
result
,
"OK"
))
{
ConsoleErrorHandler
errorHandler
=
(
ConsoleErrorHandler
)
restTemplate
.
getErrorHandler
();
result
=
RestUtil
.
getCause
(
restTemplate
);
result
=
errorHandler
.
getCause
();
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
result
=
e
.
getMessage
();
result
=
e
.
getMessage
();
...
...
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