From 98b78339abf91d2431eaa1a3bf48c574409779da Mon Sep 17 00:00:00 2001 From: tanghc Date: Wed, 7 Jul 2021 10:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=AD=98=E6=94=BE=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java | 4 ++-- .../result/{BizContentHandler.java => BizResultHandler.java} | 4 ++-- .../gatewaycommon/gateway/result/GatewayResultExecutor.java | 4 ++-- .../gitee/sop/gatewaycommon/result/BaseExecutorAdapter.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/{BizContentHandler.java => BizResultHandler.java} (90%) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java index bc5d21ef..ec4aec46 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ApiConfig.java @@ -1,6 +1,6 @@ package com.gitee.sop.gatewaycommon.bean; -import com.gitee.sop.gatewaycommon.gateway.result.BizContentHandler; +import com.gitee.sop.gatewaycommon.gateway.result.BizResultHandler; import com.gitee.sop.gatewaycommon.gateway.result.GatewayResultExecutor; import com.gitee.sop.gatewaycommon.interceptor.RouteInterceptor; import com.gitee.sop.gatewaycommon.limit.DefaultLimitManager; @@ -147,7 +147,7 @@ public class ApiConfig { /** * 业务返回参数处理 */ - private BizContentHandler bizContentHandler = (serviceData, serviceObj, apiParam, request) -> { + private BizResultHandler bizResultHandler = (serviceData, serviceObj, apiParam, request) -> { serviceData.putAll(serviceObj); }; diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/BizContentHandler.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/BizResultHandler.java similarity index 90% rename from sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/BizContentHandler.java rename to sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/BizResultHandler.java index 2ef05d80..655772dd 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/BizContentHandler.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/BizResultHandler.java @@ -7,10 +7,10 @@ import org.springframework.web.server.ServerWebExchange; import java.util.Map; /** - * 处理业务数据 + * 处理业务返回数据 * @author thc */ -public interface BizContentHandler { +public interface BizResultHandler { /** * 处理业务参数 diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java index e45f2b75..9cc03e80 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java @@ -96,7 +96,7 @@ public class GatewayResultExecutor extends BaseExecutorAdapter serviceData, JSONObject serviceObj, ApiParam apiParam, ServerWebExchange request) { - ApiConfig.getInstance().getBizContentHandler().handle(serviceData, serviceObj, apiParam, request); + protected void handleBizResult(Map serviceData, JSONObject serviceObj, ApiParam apiParam, ServerWebExchange request) { + ApiConfig.getInstance().getBizResultHandler().handle(serviceData, serviceObj, apiParam, request); } } 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 0e48ce57..3b04524b 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 @@ -179,11 +179,11 @@ public abstract class BaseExecutorAdapter implements ResultExecutor serviceData.put(GATEWAY_CODE_NAME, errorMeta.getCode()); serviceData.put(GATEWAY_MSG_NAME, errorMeta.getError(getLocale(request)).getMsg()); JSONObject serviceObj = JSON.parseObject(serviceResult, Feature.OrderedField); - this.handleBizContent(serviceData, serviceObj, apiParam, request); + this.handleBizResult(serviceData, serviceObj, apiParam, request); return serviceData; } - protected abstract void handleBizContent(Map serviceData, JSONObject serviceObj, ApiParam apiParam, T request); + protected abstract void handleBizResult(Map serviceData, JSONObject serviceObj, ApiParam apiParam, T request); /**