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