From 234acc6577d9f302ba76e8824d317c6369dffbed Mon Sep 17 00:00:00 2001 From: akulikov Date: Mon, 29 May 2023 09:31:42 +0300 Subject: [PATCH] . --- .../src/main/java/service/GatewayService.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/clearing-parent/gateway-api/src/main/java/service/GatewayService.java b/clearing-parent/gateway-api/src/main/java/service/GatewayService.java index f1a8abb11..596c41e7e 100644 --- a/clearing-parent/gateway-api/src/main/java/service/GatewayService.java +++ b/clearing-parent/gateway-api/src/main/java/service/GatewayService.java @@ -46,12 +46,37 @@ public class GatewayService extends QueueConsumer implements InitializingBean { } public RequestInfoUpdate requestOnDemandCompany(BaseRequest userRequest) { + log.debug("LOCM task received"); + RequestInfoUpdate requestInfoUpdate = userRoleVerification.validateRoleAndGetResult(userRequest); + if (requestInfoUpdate != null) return requestInfoUpdate; + + String url = formingInboundUrl(inboundServerSettings.getPathLOCM()); + String response = restTemplate.getForObject(url, String.class); + + log.debug("LOCM task complete, response: {}", response); return null; } public RequestInfoUpdate requestOnDemandSecurity(BaseRequest userRequest) { + log.debug("LOSC task received"); + RequestInfoUpdate requestInfoUpdate = userRoleVerification.validateRoleAndGetResult(userRequest); + if (requestInfoUpdate != null) return requestInfoUpdate; + + String url = formingInboundUrl(inboundServerSettings.getPathLOSC()); + String response = restTemplate.getForObject(url, String.class); + + log.debug("LOSC task complete, response: {}", response); return null; } + + private String formingInboundUrl(String path) { + return "%s://%s:%s/%s".formatted( + inboundServerSettings.getEnableSsl() ? "https" : "http", + inboundServerSettings.getHost(), + inboundServerSettings.getPort(), + path + ); + } }