From a621be0062e4cf43b0787e0c383c37e3d547f5cd Mon Sep 17 00:00:00 2001 From: daekuk Date: Fri, 26 Sep 2025 17:08:06 +0900 Subject: [PATCH] =?UTF-8?q?APIInterface=20Detail=20UI=20SyncAsync=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 --- .../apim/apiInterfaceManDetail.jsp | 331 ++++++++++++------ .../transaction/apim/ApiInterfaceService.java | 44 ++- .../transaction/apim/ui/ApiInterfaceUI.java | 5 + 3 files changed, 277 insertions(+), 103 deletions(-) diff --git a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp index 9701b31..1e402a2 100644 --- a/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp +++ b/WebContent/jsp/onl/transaction/apim/apiInterfaceManDetail.jsp @@ -101,16 +101,31 @@ standardMessageItems: [], inboundResponseStandardMessageItems: [], fromResponseAdapter: '', + toResponseAdapter: '', inboundResponseHttpMethod: '', inboundResponseRestPath: '', - syncAsyncType: 'sync' + outboundResponseHttpMethod: '', + outboundResponseRestPath: '', + syncAsyncType: 'sync', + wordType: '1', + requestType:'S' }, // 컴퓨티드 프로퍼티 get showInboundResponse() { return this.apiInterface.syncAsyncType === 'asyncSync'; }, + + // 컴퓨티드 프로퍼티 + get showOutboundResponse() { + return this.apiInterface.syncAsyncType === 'syncAsync'; + }, })); + + // 요청/응답 disable 처리. + Alpine.store('formState', { + isReqResDisabled: false + }); }); // Alpine 컴포넌트 접근을 위한 유틸리티 함수 @@ -136,6 +151,7 @@ new makeOptions("ADPTRBZWKGROUPNAME","ADPTRBZWKGROUPDESC").setObj($("select[name=fromAdapter]")).setFormat(codeName3OptionFormat).setNoValueInclude(true).setAttr('std','ADPTRMSGPTRNCD').setData(json.fromList).rendering(); new makeOptions("ADPTRBZWKGROUPNAME","ADPTRBZWKGROUPDESC").setObj($("select[name=fromResponseAdapter]")).setFormat(codeName3OptionFormat).setNoValueInclude(true).setData(json.toList).rendering(); new makeOptions("ADPTRBZWKGROUPNAME","ADPTRBZWKGROUPDESC").setObj($("select[name=toAdapter]")).setFormat(codeName3OptionFormat).setNoValueInclude(true).setData(json.toList).rendering(); + new makeOptions("ADPTRBZWKGROUPNAME","ADPTRBZWKGROUPDESC").setObj($("select[name=toResponseAdapter]")).setFormat(codeName3OptionFormat).setNoValueInclude(true).setData(json.fromList).rendering(); //if(key == "") setSearchable(selectName); // 콤보에 searchable 설정 if (typeof callback === 'function') { @@ -196,27 +212,33 @@ // 어댑터 설정 정보 객체에 인바운드 응답 관련 설정 추가 const adapterConfig = { - inbound: { - ioType: 'inbound', - methodSelectId: '#inboundHttpMethod', - restPathInputId: '#inboundRestPath', - adapterUrlId: '#fromAdapterUrl', - }, - outbound: { - ioType: 'outbound', - methodSelectId: '#outboundHttpMethod', - restPathInputId: '#outboundRestPath', - adapterUrlId: '#toAdapterUrl', - standardOptionsId: '#standardOutboundOptions', - commonFieldId: '#commonFieldPart' - }, - inboundResponse: { - methodSelectId: '#inboundResponseHttpMethod', - restPathInputId: '#inboundResponseRestPath', - adapterUrlId: '#fromResponseAdapterUrl', - standardOptionsId: '#inboundResponseRestPart', - commonFieldId: '#inboundResponseCommonFieldPart' - } + inbound: { + ioType: 'inbound', + methodSelectId: '#inboundHttpMethod', + restPathInputId: '#inboundRestPath', + adapterUrlId: '#fromAdapterUrl', + }, + outbound: { + ioType: 'outbound', + methodSelectId: '#outboundHttpMethod', + restPathInputId: '#outboundRestPath', + adapterUrlId: '#toAdapterUrl', + standardOptionsId: '#standardOutboundOptions', + commonFieldId: '#commonFieldPart' + }, + inboundResponse: { + methodSelectId: '#inboundResponseHttpMethod', + restPathInputId: '#inboundResponseRestPath', + adapterUrlId: '#fromResponseAdapterUrl', + standardOptionsId: '#inboundResponseRestPart', + commonFieldId: '#inboundResponseCommonFieldPart' + }, + outboundResponse: { + methodSelectId: '#outboundResponseHttpMethod', + restPathInputId: '#outboundResponseRestPath', + adapterUrlId: '#toResponseAdapterUrl', + standardOptionsId: '#outboundResponseRestPart' + } }; // 어댑터 선택 변경 시 호출되는 함수 수정 @@ -373,9 +395,13 @@ $("select[name=authType]" ).val(data["authType"]); } $("select[name=fromResponseAdapter]" ).val(data["fromResponseAdapter"]);//fromResponseAdapter + + $("select[name=toResponseAdapter]" ).val(data["toResponseAdapter"]);//toResponseAdapter + $('#inboundHttpMethod').val(data.inboundHttpMethod); $('#outboundHttpMethod').val(data.outboundHttpMethod); $('#inboundResponseHttpMethod').val(data.inboundResponseHttpMethod); + $('#outboundResponseHttpMethod').val(data.outboundResponseHttpMethod); $('#svcLogLvelNo').val(data.svcLogLvelNo); if(data['inboundRequestLayout']!=null && data['outboundRequestLayout']!=null){ @@ -420,6 +446,12 @@ const inOutType = data['eaiSvcName'].slice(-1); $('#inOutType').val(inOutType); + $("input[name=btnRadioReqRes][value='" + sendRecvType + "']").prop("checked", true); + Alpine.store('formState').isReqResDisabled = true; + $("input[name=btnRadioInOut][value='" + inOutType + "']").prop("checked", true); + $("input[name=btnRadioInOut]").prop("disabled", true); + + $('#eaiBzwkDstcd').attr("readonly", "readonly"); $('#eaiSvcName').attr("readonly", "readonly"); $('#sendRecvType').attr("readonly", "readonly"); @@ -439,6 +471,7 @@ $('#cloneOrgInterfaceIdDesc').text(eaiSvcName); $("#fromResponseAdapter").change(); + $("#toResponseAdapter").change(); }, error:function(e){ alert(e.responseText); @@ -1057,6 +1090,14 @@ } }); + $("#toResponseAdapter").change(function() { + const alpineData = getApiInterface(); + if (alpineData.syncAsyncType === 'syncAsync') { + const adapterGroupName = $(this).val(); + adapterSelectChange('outboundResponse', adapterGroupName); + } + }); + $('#outboundRestPath').on('input', function() { checkTagVariableUrl(); }); @@ -1283,10 +1324,10 @@
- + - +
@@ -1303,47 +1344,81 @@
-
+
INTERFACE TYPE
+

-
- - +
+ + + + + + + + + + + +
+
+
+
+
+ + - - + + +
+
+
+
+
+ + - - -
+ + +
+
-
+
TRANSACTION OPTIONS
@@ -1408,21 +1483,37 @@
-
+
- - - -
+
+ + + +
+
+
+
+ + + +
+
@@ -1528,34 +1619,34 @@
-
-
- OUTBOUND ROUTING -
-
-
- - -
-
- - -
-
+
+
+ OUTBOUND ROUTING +
+
+
+ + +
+
+ + +
+
-
-
-
-
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+ + +
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 7bd2011..9629911 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 @@ -216,6 +216,20 @@ public class ApiInterfaceService extends OnlBaseService { apiInterfaceUI.setInboundResponseStandardMessageItems(convertMapToStdMessageItems(restOption.getStandardCommonFields())); } } + + if("syncAsync".equals(apiInterfaceUI.getSyncAsyncType()) && serviceMessageEntityList != null && serviceMessageEntityList.size() > 1){ + ServiceMessageEntity extraServiceMessageEntity = serviceMessageEntityList.get(1); + apiInterfaceUI.setToResponseAdapter(extraServiceMessageEntity.getPsvsysadptrbzwkgroupname()); + String restOptionStr = extraServiceMessageEntity.getRestoption(); + + if(StringUtils.isNotBlank(restOptionStr)) { + ObjectMapper mapper = new ObjectMapper(); + RestOption restOption = mapper.readValue(restOptionStr, RestOption.class); + + apiInterfaceUI.setOutboundResponseHttpMethod(restOption.getMethod()); + apiInterfaceUI.setOutboundResponseRestPath(restOption.getExtraPath()); + } + } apiInterfaceUI.setTransformYn(transformYn); apiInterfaceUI.setErrTransformYn(errTransformYn); // 추가 @@ -430,8 +444,8 @@ public class ApiInterfaceService extends OnlBaseService { public void setServiceMessageRoutingInfo(ApiInterfaceUI vo, EAIMessageEntity eaiMessageEntity, List serviceMessageEntityList) throws Exception { // 기본 요청 ServiceMessageEntity 설정 ServiceMessageEntity requestEntity = serviceMessageEntityList.get(0); - - if ("async".equals(vo.getSyncAsyncType())) { + + if ("async".equals(vo.getSyncAsyncType()) || "syncAsync".equals(vo.getSyncAsyncType())) { requestEntity.setPsvintfacdsticname("ASYN"); } @@ -462,6 +476,32 @@ public class ApiInterfaceService extends OnlBaseService { setRouteInfo(vo, vo.getInboundResponseHttpMethod(), vo.getInboundResponseRestPath(), vo.getFromResponseAdapter(), responseEntity, vo.getInboundResponseStandardMessageItems()); } + + // syncAsync 타입인 경우 응답용 ServiceMessageEntity 추가 처리 + if ("syncAsync".equals(vo.getSyncAsyncType())) { + ServiceMessageEntity responseEntity; + + // ServiceMessageEntity가 없으면 새로 생성 + if (serviceMessageEntityList.size() < 2) { + responseEntity = new ServiceMessageEntity(); + responseEntity.setId(new ServiceMessageEntityId(vo.getEaiSvcName(), 2)); + responseEntity.setEaimessage(eaiMessageEntity); + serviceMessageEntityList.add(responseEntity); + } else { + responseEntity = serviceMessageEntityList.get(1); + } + + // ServiceMessageEntity 설정 + responseEntity.setPsvsysadptrbzwkgroupname(vo.getToResponseAdapter()); + responseEntity.setPsvintfacdsticname("ASYN"); + + // REST 정보 설정 + AdapterGroupUI responseAdapter = adapterService.selectDetail(vo.getToResponseAdapter()); + String responseRoutName = getOutboundProcessorName(responseAdapter); + responseEntity.setOutbndroutname(responseRoutName); + + setRouteInfo(vo, vo.getOutboundResponseHttpMethod(), vo.getOutboundResponseRestPath(), vo.getToResponseAdapter(), responseEntity, vo.getStandardMessageItems()); + } } public static List convertMapToStdMessageItems(Map standardCommonFields) { diff --git a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java index 7763e62..82ee29f 100644 --- a/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java +++ b/src/main/java/com/eactive/eai/rms/onl/transaction/apim/ui/ApiInterfaceUI.java @@ -54,6 +54,11 @@ public class ApiInterfaceUI { private String inboundResponseHttpMethod; private String inboundResponseRestPath; private String fromResponseAdapter; + + //SYNC-ASYNC 용 + private String outboundResponseHttpMethod; + private String outboundResponseRestPath; + private String toResponseAdapter; private String inboundErrResponseLayout; private String errResponseTransform;