From a92e15e88404c8d04faa2843a9b9922377bbafa7 Mon Sep 17 00:00:00 2001 From: jaewohong Date: Thu, 4 Dec 2025 13:22:35 +0900 Subject: [PATCH 1/3] =?UTF-8?q?uri=20full=20path=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiAdapterController.java | 66 ++++++++++++------- .../adapter/service/ApiAdapterService.java | 3 + 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/eactive/eai/adapter/controller/ApiAdapterController.java b/src/main/java/com/eactive/eai/adapter/controller/ApiAdapterController.java index 1c66bf1..6c36043 100644 --- a/src/main/java/com/eactive/eai/adapter/controller/ApiAdapterController.java +++ b/src/main/java/com/eactive/eai/adapter/controller/ApiAdapterController.java @@ -35,15 +35,11 @@ import com.eactive.eai.common.util.Logger; import com.eactive.eai.common.util.MessageUtil; import com.eactive.eai.common.util.UUIDGenerator; import com.eactive.eai.inbound.error.InboundErrorInfoVO; -import com.kjbank.encrypt.exchange.crypto.AES256Cipher; -import com.kjbank.encrypt.exchange.crypto.AES256GCMCipher; -import com.kjbank.encrypt.exchange.crypto.AESCipher; // jwhong import org.json.simple.JSONObject; import java.util.HashMap; import java.util.Map; -import java.sql.Timestamp; import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo; @RestController @@ -64,14 +60,27 @@ public class ApiAdapterController implements HttpAdapterServiceKey { String apiUri = servletRequest.getRequestURI(); // /api/v1/public/getUserInfo.svc apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath()); - apiUri = StringUtils.removeEnd(apiUri, "/"); - - HttpDynamicInAdapterUri adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance()); - - //Received time , jwhong - long receivedTimeMillis = System.currentTimeMillis(); - String receivedTimeStr = String.valueOf(receivedTimeMillis); - + apiUri = StringUtils.removeEnd(apiUri, "/"); + + //** jwhong TSEAIHS04의 api full path와 비교하여 adapter를 가져온다 + String methodAndUri = servletRequest.getMethod() + "|" + apiUri; + HttpDynamicInAdapterUri adptUri = null; + String adapterGrpName =""; + String apiSvcCode = ""; + try { + STDMessageDAO dao = ApplicationContextProvider.getContext().getBean(STDMessageDAO.class); + StandardMessageInfo stdInfo = dao.getSTDMsgByPath(methodAndUri); + String serviceKey = stdInfo.getBzwksvckeyname(); + int idx = serviceKey.indexOf(":"); + adapterGrpName = (idx != -1) ? serviceKey.substring(0, idx) : serviceKey; // ':' 이전 문자열 추출 + apiSvcCode = stdInfo.getEaisvcname(); + //아래 원래 Logic + adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance(), adapterGrpName); + } catch (Exception e) { + adptUri = null; + } + //*** + if (logger.isDebug()) { logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI()); } @@ -80,8 +89,11 @@ public class ApiAdapterController implements HttpAdapterServiceKey { logError(servletRequest); // throw new Exception("can not find Adapter Uri"); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("can not find Adapter Uri"); - } - + } + + //Received time , jwhong + long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함 + String receivedTimeStr = String.valueOf(receivedTimeMillis); String adapterGroupName = adptUri.getAdptGrpName(); String adapterName = adptUri.getAdptName(); @@ -102,8 +114,9 @@ public class ApiAdapterController implements HttpAdapterServiceKey { String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC"); ResponseEntity responseEntity = null; Properties transactionProp = new Properties(); - //transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeMillis); // jwhong, put api received time + // jwhong, put api received time, eaiSvcCode transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr); + transactionProp.put(API_SERVICE_CODE, apiSvcCode); try { String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp); @@ -170,18 +183,23 @@ public class ApiAdapterController implements HttpAdapterServiceKey { * @param apiUri * @return */ - private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager) throws Exception { + private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager, String adapterGrpName) throws Exception { if (StringUtils.isBlank(apiUri)) { return null; - } + } - //** jwhong TSEAIHS04의 api full path와 비교하여 adapter를 가져온다 - STDMessageDAO dao = ApplicationContextProvider.getContext().getBean(STDMessageDAO.class); - StandardMessageInfo stdInfo = dao.getSTDMsgByPath(apiUri); - String serviceKey = stdInfo.getBzwksvckeyname(); - int idx = serviceKey.indexOf(":"); - String adapterGrpName = (idx != -1) ? serviceKey.substring(0, idx) : serviceKey; // ':' 이전 문자열 추출 - //*** + //* manager 출력 + logger.warn("===== adptUriMap 상세 내용 ====="); + for (Map.Entry entry : manager.adptUriMap.entrySet()) { + HttpDynamicInAdapterUri uriObj = entry.getValue(); + logger.warn("GroupName=" + uriObj.getAdptGrpName() + + ", AdapterName=" + uriObj.getAdptName() + + ", URI=" + uriObj.getUri()); + } + logger.warn("================================"); + + + // for (int i = 0; i < 10; i++) { HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri); diff --git a/src/main/java/com/eactive/eai/adapter/service/ApiAdapterService.java b/src/main/java/com/eactive/eai/adapter/service/ApiAdapterService.java index 8a87a13..5a0df56 100644 --- a/src/main/java/com/eactive/eai/adapter/service/ApiAdapterService.java +++ b/src/main/java/com/eactive/eai/adapter/service/ApiAdapterService.java @@ -448,6 +448,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport { // end test source switch (decryptAlgorithm) { + case "AES128": case "AES128-TOSS": try { String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네?? @@ -532,6 +533,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport { String decryptedBodyMessage = ""; switch (decryptAlgorithm) { + case "AES128": case "AES128-TOSS": decryptedJsonKey = "preScreeningRequest"; break; @@ -587,6 +589,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport { // end test source switch (encryptAlgorithm) { + case "AES128": case "AES128-TOSS": try { String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네?? From 3b1adbd7b2db7739be8ea46c687b90997ad415d6 Mon Sep 17 00:00:00 2001 From: Rinjae Date: Thu, 4 Dec 2025 13:39:10 +0900 Subject: [PATCH 2/3] Edit weblogic-web.xml --- WebContent/WEB-INF/weblogic-web.xml | 36 ++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/WebContent/WEB-INF/weblogic-web.xml b/WebContent/WEB-INF/weblogic-web.xml index 3e0192a..3d4f45b 100644 --- a/WebContent/WEB-INF/weblogic-web.xml +++ b/WebContent/WEB-INF/weblogic-web.xml @@ -34,7 +34,17 @@ contextConfigLocation /WEB-INF/applicationContext.xml - + + + + default + weblogic.servlet.FileServlet + + + default + /static/* + + authserver @@ -60,17 +70,17 @@ - - - - - - - - - - - + + + RestApiDynamicInAdapter + com.eactive.eai.adapter.http.dynamic.RestApiAdapterMain + 2 + + + RestApiDynamicInAdapter + /API/* + /api/* +