GITZYY преди 1 седмица
родител
ревизия
137c268699

+ 4 - 3
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/api/ApiGatewayService.java

@@ -43,10 +43,11 @@ public class ApiGatewayService {
      */
   public   SingleResponse invoke(ApiInvokeParamCmd apiInvokeParamCmd){
     try {
-       if (EgRouteTypeEnum.CHECK_INTO.getCode().equals(apiInvokeParamCmd.getRoute())){
            Map<String, EndpointRouteService> collect = endpointRouteServices.stream().collect(Collectors.toMap(EndpointRouteService::getRoute, EndpointRouteService -> EndpointRouteService));
-         return   collect.get(apiInvokeParamCmd.getRoute()).apiEndPoint(apiInvokeParamCmd);
-       }
+           if (!collect.containsKey(apiInvokeParamCmd.getRoute())){
+               return SingleResponse.buildFailure(BusinessServiceEnums.FAIL.getCode(), BusinessServiceEnums.FAIL.getMessage());
+           }
+           return   collect.get(apiInvokeParamCmd.getRoute()).apiEndPoint(apiInvokeParamCmd);
     }catch (Exception e){
       log.error("网关错误",e.getMessage());
     }

+ 0 - 2
egress-gateway-service-app/src/main/java/com/hrsk/cloud/eg/app/route/impl/CheckIntoCmd.java

@@ -38,9 +38,7 @@ public class CheckIntoCmd implements EndpointRouteService {
     public SingleResponse apiEndPoint(ApiInvokeParamCmd apiInvokeParamCmd) {
         CheckIntoParamCmd checkIntoParamCmd = JSONObject.parseObject(apiInvokeParamCmd.getParam().toString(), CheckIntoParamCmd.class);
         EgLoanApiConfigInfoDo loanApiConfigInfo = egApiService.getLoanApiConfigInfo(checkIntoParamCmd.getPlan().getApiId());
-//        EgLoanApiConfigInfoCmd configCmd = BeanCopyUtils.copy(loanApiConfigInfo, EgLoanApiConfigInfoCmd.class);
         Map<String, CheckCmdExe> collect = checkCmdExeList.stream().collect(Collectors.toMap(CheckCmdExe::getMode, CheckCmdExe -> CheckCmdExe));
-
         return   collect.get(loanApiConfigInfo.getIntegrationMode()).route(checkIntoParamCmd);
     }