|
@@ -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());
|
|
|
}
|