升级spring-cloud到H版本
This commit is contained in:
@@ -13,9 +13,9 @@
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>8</java.version>
|
||||
<spring-cloud-alibaba-dependencies.version>2.1.2.RELEASE</spring-cloud-alibaba-dependencies.version>
|
||||
<spring-boot-dependencies.version>2.1.14.RELEASE</spring-boot-dependencies.version>
|
||||
<spring-cloud-dependencies.version>Greenwich.SR6</spring-cloud-dependencies.version>
|
||||
<spring-cloud-alibaba-dependencies.version>2.2.1.RELEASE</spring-cloud-alibaba-dependencies.version>
|
||||
<spring-boot-dependencies.version>2.2.8.RELEASE</spring-boot-dependencies.version>
|
||||
<spring-cloud-dependencies.version>Hoxton.SR6</spring-cloud-dependencies.version>
|
||||
<commons-collections4.version>4.4</commons-collections4.version>
|
||||
<fastjson.version>1.2.70</fastjson.version>
|
||||
<swagger.version>2.9.2</swagger.version>
|
||||
@@ -36,7 +36,7 @@
|
||||
<qiniu-java-sdk>7.2.28</qiniu-java-sdk>
|
||||
<easypoi.version>4.1.3</easypoi.version>
|
||||
<poi.version>4.1.1</poi.version>
|
||||
<spring-boot-admin.version>2.1.6</spring-boot-admin.version>
|
||||
<spring-boot-admin.version>2.2.3</spring-boot-admin.version>
|
||||
<velocity.version>1.7</velocity.version>
|
||||
<commons-configuration2.version>2.7</commons-configuration2.version>
|
||||
<txlcn.version>5.0.2.RELEASE</txlcn.version>
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ public class IndexServiceImpl implements IIndexService {
|
||||
List<Map<String, String>> listOfIndicesFromEs = null;
|
||||
if (response != null) {
|
||||
String rawBody = EntityUtils.toString(response.getEntity());
|
||||
TypeReference<List<HashMap<String, String>>> typeRef = new TypeReference<List<HashMap<String, String>>>() {};
|
||||
TypeReference<List<Map<String, String>>> typeRef = new TypeReference<List<Map<String, String>>>() {};
|
||||
listOfIndicesFromEs = mapper.readValue(rawBody, typeRef);
|
||||
}
|
||||
return PageResult.<Map<String, String>>builder().data(listOfIndicesFromEs).code(0).build();
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ public class SentinelAutoConfigure {
|
||||
@ConditionalOnClass(HttpServletRequest.class)
|
||||
public static class WebmvcHandler {
|
||||
@Bean
|
||||
public BlockExceptionHandler blockExceptionHandler() {
|
||||
public BlockExceptionHandler webmvcBlockExceptionHandler() {
|
||||
return (request, response, e) -> {
|
||||
response.setStatus(429);
|
||||
Result result = Result.failed(e.getMessage());
|
||||
@@ -48,11 +48,11 @@ public class SentinelAutoConfigure {
|
||||
@ConditionalOnClass(ServerResponse.class)
|
||||
public static class WebfluxHandler {
|
||||
@Bean
|
||||
public BlockRequestHandler blockRequestHandler() {
|
||||
public BlockRequestHandler webfluxBlockExceptionHandler() {
|
||||
return (exchange, t) ->
|
||||
ServerResponse.status(HttpStatus.TOO_MANY_REQUESTS)
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(BodyInserters.fromObject(Result.failed(t.getMessage())));
|
||||
.body(BodyInserters.fromValue(Result.failed(t.getMessage())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ public class JsonErrorWebExceptionHandler extends DefaultErrorWebExceptionHandle
|
||||
* @param errorAttributes
|
||||
*/
|
||||
@Override
|
||||
protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
protected int getHttpStatus(Map<String, Object> errorAttributes) {
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR.value();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user