pull/1/head
tanghc 5 years ago
parent c240a6337a
commit 1ab8e22885
  1. 5
      sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/result/ZuulResultExecutor.java
  2. 6
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/SpringMvcServiceConfiguration.java

@ -25,13 +25,12 @@ public class ZuulResultExecutor extends BaseExecutorAdapter<RequestContext, Stri
@Override @Override
public int getResponseStatus(RequestContext requestContext) { public int getResponseStatus(RequestContext requestContext) {
List<Pair<String, String>> bizHeaders = requestContext.getZuulResponseHeaders(); List<Pair<String, String>> bizHeaders = requestContext.getZuulResponseHeaders();
int status = bizHeaders.stream()
return bizHeaders.stream()
.filter(header -> SopConstants.X_SERVICE_ERROR_CODE.equals(header.first())) .filter(header -> SopConstants.X_SERVICE_ERROR_CODE.equals(header.first()))
.map(header -> Integer.valueOf(header.second())) .map(header -> Integer.valueOf(header.second()))
.findFirst() .findFirst()
.orElse(requestContext.getResponseStatusCode()); .orElse(requestContext.getResponseStatusCode());
return status;
} }
@Override @Override

@ -43,12 +43,6 @@ public class SpringMvcServiceConfiguration {
return new GlobalExceptionHandler(); return new GlobalExceptionHandler();
} }
@Bean
@ConditionalOnMissingBean
ErrorController errorController() {
return new ErrorController();
}
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
ServiceRouteController serviceRouteInfoHandler() { ServiceRouteController serviceRouteInfoHandler() {

Loading…
Cancel
Save