From 1ab8e22885628fdb31120f83f49d8afdba0807a7 Mon Sep 17 00:00:00 2001 From: tanghc Date: Fri, 30 Aug 2019 08:51:43 +0800 Subject: [PATCH] 2.0 --- .../sop/gatewaycommon/zuul/result/ZuulResultExecutor.java | 5 ++--- .../configuration/SpringMvcServiceConfiguration.java | 6 ------ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java index 526a90b0..c198d588 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java @@ -25,13 +25,12 @@ public class ZuulResultExecutor extends BaseExecutorAdapter> bizHeaders = requestContext.getZuulResponseHeaders(); - int status = bizHeaders.stream() + + return bizHeaders.stream() .filter(header -> SopConstants.X_SERVICE_ERROR_CODE.equals(header.first())) .map(header -> Integer.valueOf(header.second())) .findFirst() .orElse(requestContext.getResponseStatusCode()); - - return status; } @Override diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/SpringMvcServiceConfiguration.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/SpringMvcServiceConfiguration.java index a1258401..2f14dfd0 100644 --- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/SpringMvcServiceConfiguration.java +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/SpringMvcServiceConfiguration.java @@ -43,12 +43,6 @@ public class SpringMvcServiceConfiguration { return new GlobalExceptionHandler(); } - @Bean - @ConditionalOnMissingBean - ErrorController errorController() { - return new ErrorController(); - } - @Bean @ConditionalOnMissingBean ServiceRouteController serviceRouteInfoHandler() {