From 8109f91aa23d0831fd10286f2028f5d41acfcf16 Mon Sep 17 00:00:00 2001 From: eastargh Date: Tue, 9 Jun 2026 09:51:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=A0=EB=9F=89=EC=A0=9C=EC=96=B4=20?= =?UTF-8?q?=ED=98=84=ED=99=A9=20=EB=AA=A8=EB=8B=88=ED=84=B0=EB=A7=81=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inflow/inflowAdapterControlManDetail.jsp | 579 +++++++++++++---- .../inflow/inflowClientControlManDetail.jsp | 602 ++++++++++++++---- .../inflowInterfaceControlManDetail.jsp | 579 +++++++++++++---- .../InflowAdapterControlManController.java | 8 + .../InflowClientControlManController.java | 8 + .../inflow/InflowControlManService.java | 75 +++ .../InflowInterfaceControlManController.java | 8 + 7 files changed, 1464 insertions(+), 395 deletions(-) diff --git a/WebContent/jsp/onl/admin/inflow/inflowAdapterControlManDetail.jsp b/WebContent/jsp/onl/admin/inflow/inflowAdapterControlManDetail.jsp index 6aed70c..305470a 100644 --- a/WebContent/jsp/onl/admin/inflow/inflowAdapterControlManDetail.jsp +++ b/WebContent/jsp/onl/admin/inflow/inflowAdapterControlManDetail.jsp @@ -16,173 +16,486 @@ - - -
-
- -
-
-
- - - -<%-- " alt="" id="btn_delete" level="W" status="DETAIL"/> --%> -<%-- " alt="" id="btn_modify" level="W" status="DETAIL,NEW" /> --%> -<%-- " alt="" id="btn_previous" level="R" status="DETAIL,NEW"/> --%> -
-
<%= localeMessage.getString("infAdpConMan.title") %><%= localeMessage.getString("infAdpConMan.title") %>
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
<%= localeMessage.getString("infAdpConMan.adaNm") %>
<%= localeMessage.getString("infAdpConMan.adaDes") %>
<%= localeMessage.getString("infAdpConMan.thrPerSecond") %>
<%= localeMessage.getString("infAdpConMan.thr") %>
<%= localeMessage.getString("infAdpConMan.thrTimeUnit") %> -
-
<%= localeMessage.getString("infAdpConMan.useYn") %> -
-
-
- -
-
- - + +
+
+ +
+
+
+ + + +
+
+
<%= localeMessage.getString("infAdpConMan.title") %><%= localeMessage.getString("infAdpConMan.title") %>
+ +
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + +
<%= localeMessage.getString("infAdpConMan.adaNm") %>
<%= localeMessage.getString("infAdpConMan.adaDes") %>
<%= localeMessage.getString("infAdpConMan.useYn") %> + +
+ + + + + + + + + + + + + + + + + +
+ <%= localeMessage.getString("infAdpConMan.thrPerSecond") %> + help_outline + 1초 단위의 순간 트래픽 제한입니다. 매 초마다 설정한 건수만큼 토큰이 리필되며, 초과 시 요청이 거부됩니다. + + +
+ + req/sec +
+
+ <%= localeMessage.getString("infAdpConMan.thr") %> + help_outline + 장시간 누적 트래픽 제한입니다. 시간단위를 선택하면 해당 주기마다 토큰이 리필됩니다. + + +
+ + + requests +
+
+
+
+ + +
+
+
+ 마지막 갱신: - + +
+ + + + +
+
+ hourglass_empty + 버킷 현황을 조회하려면 새로고침 버튼을 클릭하세요 +
+
+
+
+ +
+
+ + diff --git a/WebContent/jsp/onl/admin/inflow/inflowClientControlManDetail.jsp b/WebContent/jsp/onl/admin/inflow/inflowClientControlManDetail.jsp index 2bac2cd..0846a98 100644 --- a/WebContent/jsp/onl/admin/inflow/inflowClientControlManDetail.jsp +++ b/WebContent/jsp/onl/admin/inflow/inflowClientControlManDetail.jsp @@ -16,170 +16,514 @@ - - -
-
- -
-
-
- - - -
-
클라이언트 유량제어 클라이언트 유량제어
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
클라이언트 ID
클라이언트명
<%= localeMessage.getString("infAdpConMan.thrPerSecond") %>
<%= localeMessage.getString("infAdpConMan.thr") %>
<%= localeMessage.getString("infAdpConMan.thrTimeUnit") %> -
-
<%= localeMessage.getString("infAdpConMan.useYn") %> -
-
-
- -
-
- - + +
+
+ +
+
+
+ + + +
+
+
클라이언트 유량제어클라이언트 유량제어
+ +
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + +
클라이언트 ID
클라이언트명
<%= localeMessage.getString("infAdpConMan.useYn") %> + +
+ + + + + + + + + + + + + + + + + +
+ <%= localeMessage.getString("infAdpConMan.thrPerSecond") %> + help_outline + 1초 단위의 순간 트래픽 제한입니다. 매 초마다 설정한 건수만큼 토큰이 리필되며, 초과 시 요청이 거부됩니다. + + +
+ + req/sec +
+
+ <%= localeMessage.getString("infAdpConMan.thr") %> + help_outline + 장시간 누적 트래픽 제한입니다. 시간단위를 선택하면 해당 주기마다 토큰이 리필됩니다. + + +
+ + + requests +
+
+
+
+ + +
+
+
+ 마지막 갱신: - + +
+ + + + +
+
+ hourglass_empty + 버킷 현황을 조회하려면 새로고침 버튼을 클릭하세요 +
+
+
+
+ +
+
+ + diff --git a/WebContent/jsp/onl/admin/inflow/inflowInterfaceControlManDetail.jsp b/WebContent/jsp/onl/admin/inflow/inflowInterfaceControlManDetail.jsp index 03a2aa6..62fa1d1 100644 --- a/WebContent/jsp/onl/admin/inflow/inflowInterfaceControlManDetail.jsp +++ b/WebContent/jsp/onl/admin/inflow/inflowInterfaceControlManDetail.jsp @@ -16,173 +16,486 @@ - - -
-
- -
-
-
- - - -<%-- " alt="" id="btn_delete" level="W" status="DETAIL"/> --%> -<%-- " alt="" id="btn_modify" level="W" status="DETAIL,NEW" /> --%> -<%-- " alt="" id="btn_previous" level="R" status="DETAIL,NEW"/> --%> -
-
<%= localeMessage.getString("infIfConMan.title") %><%= localeMessage.getString("infIfConMan.title") %>
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
<%= localeMessage.getString("infIfConMan.ifNm") %>
<%= localeMessage.getString("infIfConMan.ifDesc") %>
<%= localeMessage.getString("infAdpConMan.thrPerSecond") %>
<%= localeMessage.getString("infAdpConMan.thr") %>
<%= localeMessage.getString("infAdpConMan.thrTimeUnit") %> -
-
<%= localeMessage.getString("infAdpConMan.useYn") %> -
-
-
- -
-
- - + +
+
+ +
+
+
+ + + +
+
+
<%= localeMessage.getString("infIfConMan.title") %><%= localeMessage.getString("infIfConMan.title") %>
+ +
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + +
<%= localeMessage.getString("infIfConMan.ifNm") %>
<%= localeMessage.getString("infIfConMan.ifDesc") %>
<%= localeMessage.getString("infAdpConMan.useYn") %> + +
+ + + + + + + + + + + + + + + + + +
+ <%= localeMessage.getString("infAdpConMan.thrPerSecond") %> + help_outline + 1초 단위의 순간 트래픽 제한입니다. 매 초마다 설정한 건수만큼 토큰이 리필되며, 초과 시 요청이 거부됩니다. + + +
+ + req/sec +
+
+ <%= localeMessage.getString("infAdpConMan.thr") %> + help_outline + 장시간 누적 트래픽 제한입니다. 시간단위를 선택하면 해당 주기마다 토큰이 리필됩니다. + + +
+ + + requests +
+
+
+
+ + +
+
+
+ 마지막 갱신: - + +
+ + + + +
+
+ hourglass_empty + 버킷 현황을 조회하려면 새로고침 버튼을 클릭하세요 +
+
+
+
+ +
+
+ + diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowAdapterControlManController.java b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowAdapterControlManController.java index 37cbe36..ceba2e5 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowAdapterControlManController.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowAdapterControlManController.java @@ -85,4 +85,12 @@ public class InflowAdapterControlManController extends OnlBaseAnnotationControll return new ModelAndView("jsonView", resultMap); } + @RequestMapping(value = "/onl/admin/inflow/inflowAdapterControlMan.json", params = "cmd=LIST_BUCKET_STATUS") + public ModelAndView getBucketStatus(HttpServletRequest request, HttpServletResponse response) { + List> statusList = service.getAdapterBucketStatus(); + Map resultMap = new HashMap<>(); + resultMap.put("servers", statusList); + return new ModelAndView("jsonView", resultMap); + } + } \ No newline at end of file diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowClientControlManController.java b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowClientControlManController.java index a384d01..9f08629 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowClientControlManController.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowClientControlManController.java @@ -83,4 +83,12 @@ public class InflowClientControlManController extends OnlBaseAnnotationControlle return new ModelAndView("jsonView", resultMap); } + @RequestMapping(value = "/onl/admin/inflow/inflowClientControlMan.json", params = "cmd=LIST_BUCKET_STATUS") + public ModelAndView getBucketStatus(HttpServletRequest request, HttpServletResponse response) { + List> statusList = service.getClientBucketStatus(); + Map resultMap = new HashMap<>(); + resultMap.put("servers", statusList); + return new ModelAndView("jsonView", resultMap); + } + } \ No newline at end of file diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowControlManService.java b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowControlManService.java index c5c6d19..7d55e59 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowControlManService.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowControlManService.java @@ -1,12 +1,21 @@ package com.eactive.eai.rms.onl.manage.inflow.inflow; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.Optional; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; import com.eactive.eai.data.entity.onl.inflow.InflowControl; import com.eactive.eai.data.entity.onl.inflow.InflowControlId; @@ -14,10 +23,13 @@ import com.eactive.eai.rms.common.base.BaseService; import com.eactive.eai.rms.common.combo.ComboService; import com.eactive.eai.rms.data.entity.onl.inflow.InflowControlService; import com.eactive.eai.rms.data.entity.onl.inflow.InflowControlServiceDto; +import com.eactive.eai.rms.onl.common.service.EaiServerInfoService; @Service public class InflowControlManService extends BaseService { + private static final Logger logger = LoggerFactory.getLogger(InflowControlManService.class); + private static final String ADAPTER_TYPE_INFLOW = "01"; private static final String INTERFACE_TYPE_INFLOW = "02"; private static final String CLIENT_TYPE_INFLOW = "03"; @@ -32,6 +44,11 @@ public class InflowControlManService extends BaseService { @Autowired private InflowControlManMapper mapper; + @Autowired + private EaiServerInfoService eaiServerInfoService; + + private RestTemplate restTemplate = new RestTemplate(); + // 어댑터 유량제어 public Page selectAdapterList(Pageable pageable, String searchName) { Page dtoList = service.findAllForAdapter(pageable, searchName); @@ -123,6 +140,64 @@ public class InflowControlManService extends BaseService { InflowControlId id = toId(CLIENT_TYPE_INFLOW, name); service.findById(id).ifPresent(service::delete); } + + @SuppressWarnings("unchecked") + public List> getClientBucketStatus() { + return getBucketStatus("client", "클라이언트가 로드되지 않음", "클라이언트 버킷 상태 조회 실패"); + } + + @SuppressWarnings("unchecked") + public List> getAdapterBucketStatus() { + return getBucketStatus("adapter", "어댑터가 로드되지 않음", "어댑터 버킷 상태 조회 실패"); + } + + @SuppressWarnings("unchecked") + public List> getInterfaceBucketStatus() { + return getBucketStatus("interface", "인터페이스가 로드되지 않음", "인터페이스 버킷 상태 조회 실패"); + } + + @SuppressWarnings("unchecked") + private List> getBucketStatus(String type, String noDataMessage, String logPrefix) { + List> result = new ArrayList<>(); + List> serverList = eaiServerInfoService.getEaiServerIpList(); + + for (Map server : serverList) { + String serverName = server.get("EAISVRINSTNM"); + String serverIp = server.get("EAISVRIP"); + String serverPort = server.get("WEBSERVERPORT"); + + if (StringUtils.isEmpty(serverPort)) { + serverPort = server.get("EAISVRLSNPORT"); + } + + Map serverStatus = new HashMap<>(); + serverStatus.put("serverName", serverName); + serverStatus.put("serverIp", serverIp); + serverStatus.put("serverPort", serverPort); + + try { + String url = String.format("http://%s:%s/manage/inflow/%s/bucket-status", + serverIp, serverPort, type); + ResponseEntity response = restTemplate.getForEntity(url, Map.class); + + if (response.getBody() != null && Boolean.TRUE.equals(response.getBody().get("success"))) { + serverStatus.put("status", "online"); + serverStatus.put("data", response.getBody().get("data")); + } else { + serverStatus.put("status", "no_data"); + serverStatus.put("message", noDataMessage); + } + } catch (Exception e) { + logger.warn("{} - server: {}, error: {}", logPrefix, serverName, e.getMessage()); + serverStatus.put("status", "offline"); + serverStatus.put("message", "서버 연결 실패"); + } + + result.add(serverStatus); + } + + return result; + } private InflowControlId toId(InflowControlManUI ui) { diff --git a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowInterfaceControlManController.java b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowInterfaceControlManController.java index e2eef98..69cdcc4 100644 --- a/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowInterfaceControlManController.java +++ b/src/main/java/com/eactive/eai/rms/onl/manage/inflow/inflow/InflowInterfaceControlManController.java @@ -83,4 +83,12 @@ public class InflowInterfaceControlManController extends OnlBaseAnnotationContro return new ModelAndView("jsonView", resultMap); } + @RequestMapping(value = "/onl/admin/inflow/inflowInterfaceControlMan.json", params = "cmd=LIST_BUCKET_STATUS") + public ModelAndView getBucketStatus(HttpServletRequest request, HttpServletResponse response) { + List> statusList = service.getInterfaceBucketStatus(); + Map resultMap = new HashMap<>(); + resultMap.put("servers", statusList); + return new ModelAndView("jsonView", resultMap); + } + } \ No newline at end of file