From d1eecb4ee7bba6dd8cf7e106d7ec54a7c8a10157 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Tue, 11 Aug 2026 19:14:28 +0900 Subject: [PATCH] =?UTF-8?q?v1=20API=20=EC=8A=A4=ED=8E=99=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=85=B8=EC=B6=9C=20=EC=84=A4=EC=A0=95=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20-=20PortalProperty=20=EA=B8=B0=EB=B0=98=20=EB=85=B8?= =?UTF-8?q?=EC=B6=9C=20=EC=97=AC=EB=B6=80=20=EC=A0=9C=EC=96=B4=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80=20-=20JSP=20=EB=B7=B0=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=EC=97=90=20apiSpecV1Enabled=20=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../apim/apiInterfaceManDetail.jsp | 6 +++-- .../apim/ApiInterfaceController.java | 27 +++++++++++++++++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp index 8da7778..2c3e6f3 100644 --- a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp +++ b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp @@ -1608,8 +1608,10 @@ - - + <%-- v1: 기존 API 스펙 (모달). PTL_PROPERTY(Portal / djb.apispec.v1.enabled) 로 노출 제어. --%> + + + diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceController.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceController.java index 0f21a97..763fe2f 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceController.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceController.java @@ -1,5 +1,6 @@ package com.eactive.eai.rms.onl.transaction.apim; +import com.eactive.apim.portal.portalproperty.service.PortalPropertyService; import com.eactive.eai.agent.command.Command; import com.eactive.eai.agent.command.CommonCommand; import com.eactive.eai.rms.common.base.OnlBaseAnnotationController; @@ -24,6 +25,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -41,13 +43,19 @@ public class ApiInterfaceController extends OnlBaseAnnotationController { public static final Log logger = LogFactory.getLog(ApiInterfaceController.class); + // v1 "API 스펙"(모달) 버튼 노출 여부. PTL_PROPERTY 그룹 'Portal'. 미설정 시 true(현행 노출 유지)로 생성. + private static final String API_SPEC_V1_ENABLED_KEY = "djb.apispec.v1.enabled"; + private final ApiInterfaceService service; private final ClientEntityService clientEntityService; + private final PortalPropertyService portalPropertyService; @Autowired - public ApiInterfaceController(ApiInterfaceService service, ClientEntityService clientEntityService) { + public ApiInterfaceController(ApiInterfaceService service, ClientEntityService clientEntityService, + PortalPropertyService portalPropertyService) { this.service = service; this.clientEntityService = clientEntityService; + this.portalPropertyService = portalPropertyService; } @GetMapping(value = "/onl/transaction/apim/apiInterfaceMan.view") @@ -55,10 +63,25 @@ public class ApiInterfaceController extends OnlBaseAnnotationController { } @GetMapping(value = "/onl/transaction/apim/apiInterfaceMan.view", params = "cmd=DETAIL") - public String viewDetail() { + public String viewDetail(Model model) { + model.addAttribute("apiSpecV1Enabled", resolveApiSpecV1Enabled()); return "/onl/transaction/apim/apiInterfaceManDetail"; } + /** v1 API 스펙 버튼 노출 여부 조회(레거시 Y/N 값도 허용). 미설정/파싱불가 시 true. */ + private boolean resolveApiSpecV1Enabled() { + String v = portalPropertyService.getOrCreateProperty("Portal", API_SPEC_V1_ENABLED_KEY, "true", + "API 인터페이스 상세의 v1 'API 스펙'(모달) 버튼 노출 여부(true/false)"); + if (v == null) { + return true; + } + String s = v.trim(); + if (s.equalsIgnoreCase("false") || s.equalsIgnoreCase("N")) { + return false; + } + return true; + } + @PostMapping(value= "/onl/transaction/apim/apiInterfaceMan.json", params = "cmd=LIST") public ResponseEntity> selectList(EAIMessageUISearch eaiMessageUISearch, @RequestParam(value = "sortName", required = false, defaultValue = "lastModifiedDate") String sortname,