From 1e54852a3e3b2ff523e0d63e6117f30240ea6513 Mon Sep 17 00:00:00 2001 From: tanghc Date: Tue, 6 Aug 2019 18:25:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A2=84=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E3=80=81=E7=81=B0=E5=BA=A6=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sop/gatewaycommon/result/BaseExecutorAdapter.java | 5 +++++ .../servercommon/mapping/ApiMappingRequestCondition.java | 8 +------- .../test/java/com/gitee/sop/sopauth/RefreshTokenTest.java | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java index 4307e7c6..cd0c58f8 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java @@ -37,6 +37,7 @@ public abstract class BaseExecutorAdapter implements ResultExecutor private static final ErrorMeta SUCCESS_META = ErrorEnum.SUCCESS.getErrorMeta(); private static final ErrorMeta ISP_UNKNOW_ERROR_META = ErrorEnum.ISP_UNKNOW_ERROR.getErrorMeta(); private static final ErrorMeta ISP_BIZ_ERROR = ErrorEnum.BIZ_ERROR.getErrorMeta(); + private static final ErrorMeta ISV_MISSING_METHOD_META = ErrorEnum.ISV_MISSING_METHOD.getErrorMeta(); public static final String GATEWAY_CODE_NAME = "code"; public static final String GATEWAY_MSG_NAME = "msg"; @@ -90,6 +91,10 @@ public abstract class BaseExecutorAdapter implements ResultExecutor responseData = JSON.parseObject(serviceResult); responseData.put(GATEWAY_CODE_NAME, ISP_BIZ_ERROR.getCode()); responseData.put(GATEWAY_MSG_NAME, ISP_BIZ_ERROR.getError().getMsg()); + } else if(responseStatus == HttpStatus.NOT_FOUND.value()) { + responseData = JSON.parseObject(serviceResult); + responseData.put(GATEWAY_CODE_NAME, ISV_MISSING_METHOD_META.getCode()); + responseData.put(GATEWAY_MSG_NAME, ISV_MISSING_METHOD_META.getError().getCode()); } else { this.storeError(request, ErrorType.UNKNOWN); // 微服务端有可能返回500错误 diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/mapping/ApiMappingRequestCondition.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/mapping/ApiMappingRequestCondition.java index e6a2739c..c64ecadf 100644 --- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/mapping/ApiMappingRequestCondition.java +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/mapping/ApiMappingRequestCondition.java @@ -63,13 +63,7 @@ public class ApiMappingRequestCondition implements RequestCondition