From 052858642e5842d2b13f9bd9fa37f5a6d7cdf208 Mon Sep 17 00:00:00 2001 From: daekuk Date: Mon, 5 Jan 2026 18:23:05 +0900 Subject: [PATCH] =?UTF-8?q?-=20=EC=A0=84=EB=AC=B8=EB=B3=80=ED=99=98=20?= =?UTF-8?q?=ED=95=9C=EC=AA=BD=EB=A7=8C=20=EC=A1=B4=EC=9E=AC=20=ED=95=A0=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=EC=97=90=EB=8F=84=20=EB=B3=B5=EC=A0=9C=20?= =?UTF-8?q?=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transaction/apim/ApiInterfaceService.java | 51 ++++++++++++++++--- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java index c3c521a..4fecc3f 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ApiInterfaceService.java @@ -1180,17 +1180,54 @@ public class ApiInterfaceService extends OnlBaseService { apiInterfaceUI.setInboundRestPath(newInboundRestPath); if ("Y".equals(apiInterfaceUI.getTransformYn())) { - apiInterfaceUI.setInboundRequestLayout(changeToTargetLayoutUI(layoutManService.getLayoutUiToExport(apiInterfaceUI.getInboundRequestLayout()), newBizCd, newApiInterfaceId)); - apiInterfaceUI.setOutboundRequestLayout(changeToTargetLayoutUI(layoutManService.getLayoutUiToExport(apiInterfaceUI.getOutboundRequestLayout()), newBizCd, newApiInterfaceId)); - apiInterfaceUI.setOutboundResponseLayout(changeToTargetLayoutUI(layoutManService.getLayoutUiToExport(apiInterfaceUI.getOutboundResponseLayout()), newBizCd, newApiInterfaceId)); - apiInterfaceUI.setInboundResponseLayout(changeToTargetLayoutUI(layoutManService.getLayoutUiToExport(apiInterfaceUI.getInboundResponseLayout()), newBizCd, newApiInterfaceId)); - - apiInterfaceUI.setRequestTransform(changeToTargetTransformUI(transform2Service.getTransformUiToExport(apiInterfaceUI.getRequestTransform()), newBizCd, newApiInterfaceId, apiInterfaceUI.getInboundRequestLayout(), apiInterfaceUI.getOutboundRequestLayout())); - apiInterfaceUI.setResponseTransform(changeToTargetTransformUI(transform2Service.getTransformUiToExport(apiInterfaceUI.getResponseTransform()), newBizCd, newApiInterfaceId, apiInterfaceUI.getOutboundResponseLayout(), apiInterfaceUI.getInboundResponseLayout())); + + String newInReq = processLayoutIfExist(apiInterfaceUI.getInboundRequestLayout(), newBizCd, newApiInterfaceId); + String newOutReq = processLayoutIfExist(apiInterfaceUI.getOutboundRequestLayout(), newBizCd, newApiInterfaceId); + String newOutRes = processLayoutIfExist(apiInterfaceUI.getOutboundResponseLayout(), newBizCd, newApiInterfaceId); + String newInRes = processLayoutIfExist(apiInterfaceUI.getInboundResponseLayout(), newBizCd, newApiInterfaceId); + + apiInterfaceUI.setInboundRequestLayout(newInReq); + apiInterfaceUI.setOutboundRequestLayout(newOutReq); + apiInterfaceUI.setOutboundResponseLayout(newOutRes); + apiInterfaceUI.setInboundResponseLayout(newInRes); + + if (newInReq != null && newOutReq != null) { + apiInterfaceUI.setRequestTransform( + changeToTargetTransformUI( + transform2Service.getTransformUiToExport(apiInterfaceUI.getRequestTransform()), + newBizCd, newApiInterfaceId, newInReq, newOutReq + ) + ); + } + + if (newOutRes != null && newInRes != null) { + apiInterfaceUI.setResponseTransform( + changeToTargetTransformUI( + transform2Service.getTransformUiToExport(apiInterfaceUI.getResponseTransform()), + newBizCd, newApiInterfaceId, newOutRes, newInRes + ) + ); + } + } importApiInterfaceUi(apiInterfaceUI, importDupliCheck); return apiInterfaceUI; } + + /* + * 복제시 레이아웃 정보가 있는 경우에만 변환 로직을 수행 + */ + private String processLayoutIfExist(String layoutId, String newBizCd, String newApiInterfaceId) { + + if (layoutId == null || layoutId.isEmpty()) { + return null; + } + + LayoutUI layoutEntity = layoutManService.getLayoutUiToExport(layoutId); + + return changeToTargetLayoutUI(layoutEntity, newBizCd, newApiInterfaceId); + + } }