Merge remote-tracking branch 'origin/jenkins_with_weblogic' of C:/KJB_DEV/eapim-bundle/bundles/251204/eapim-online_incremental_2025-11-01.bundle into jenkins_with_weblogic

This commit is contained in:
Rinjae
2025-12-04 14:03:04 +09:00
3 changed files with 317 additions and 311 deletions
+13 -13
View File
@@ -34,7 +34,7 @@
<param-name>contextConfigLocation</param-name> <param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value> <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param> </context-param>
<!-- Weblogic 14.1.2 서블릿 설정 --> <!-- Weblogic 14.1.2 서블릿 설정 -->
<servlet> <servlet>
<servlet-name>default</servlet-name> <servlet-name>default</servlet-name>
@@ -70,17 +70,17 @@
</filter-mapping> </filter-mapping>
<!-- Dynamic REST API 어댑터 설정 --> <!-- Dynamic REST API 어댑터 설정 -->
<!-- <servlet>--> <servlet>
<!-- <description/>--> <description/>
<!-- <servlet-name>RestApiDynamicInAdapter</servlet-name>--> <servlet-name>RestApiDynamicInAdapter</servlet-name>
<!-- <servlet-class>com.eactive.eai.adapter.http.dynamic.RestApiAdapterMain</servlet-class>--> <servlet-class>com.eactive.eai.adapter.http.dynamic.RestApiAdapterMain</servlet-class>
<!-- <load-on-startup>2</load-on-startup>--> <load-on-startup>2</load-on-startup>
<!-- </servlet>--> </servlet>
<!-- <servlet-mapping>--> <servlet-mapping>
<!-- <servlet-name>RestApiDynamicInAdapter</servlet-name>--> <servlet-name>RestApiDynamicInAdapter</servlet-name>
<!-- <url-pattern>/API/*</url-pattern>--> <url-pattern>/API/*</url-pattern>
<!-- <url-pattern>/api/*</url-pattern>--> <url-pattern>/api/*</url-pattern>
<!-- </servlet-mapping>--> </servlet-mapping>
<!-- <!--
<listener> <listener>
@@ -165,4 +165,4 @@
<location>/error.jsp</location> <location>/error.jsp</location>
</error-page> </error-page>
</web-app> </web-app>
@@ -1,299 +1,302 @@
package com.eactive.eai.adapter.controller; package com.eactive.eai.adapter.controller;
import java.util.Date; import java.util.Date;
import java.util.Properties; import java.util.Properties;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.eactive.eai.adapter.AdapterGroupVO; import com.eactive.eai.adapter.AdapterGroupVO;
import com.eactive.eai.adapter.AdapterManager; import com.eactive.eai.adapter.AdapterManager;
import com.eactive.eai.adapter.AdapterPropManager; import com.eactive.eai.adapter.AdapterPropManager;
import com.eactive.eai.adapter.AdapterVO; import com.eactive.eai.adapter.AdapterVO;
import com.eactive.eai.adapter.http.HttpStatusException; import com.eactive.eai.adapter.http.HttpStatusException;
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey; import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
import com.eactive.eai.adapter.http.dynamic.HttpDynamicInAdapterManager; import com.eactive.eai.adapter.http.dynamic.HttpDynamicInAdapterManager;
import com.eactive.eai.adapter.http.dynamic.HttpDynamicInAdapterUri; import com.eactive.eai.adapter.http.dynamic.HttpDynamicInAdapterUri;
import com.eactive.eai.adapter.http.dynamic.filter.JwtAuthException; import com.eactive.eai.adapter.http.dynamic.filter.JwtAuthException;
import com.eactive.eai.adapter.service.ApiAdapterService; import com.eactive.eai.adapter.service.ApiAdapterService;
import com.eactive.eai.common.TransactionContextKeys; import com.eactive.eai.common.TransactionContextKeys;
import com.eactive.eai.common.exception.ExceptionUtil; import com.eactive.eai.common.exception.ExceptionUtil;
import com.eactive.eai.common.server.EAIServerManager; import com.eactive.eai.common.server.EAIServerManager;
import com.eactive.eai.common.stdmessage.STDMessageDAO; import com.eactive.eai.common.stdmessage.STDMessageDAO;
import com.eactive.eai.common.util.ApplicationContextProvider; import com.eactive.eai.common.util.ApplicationContextProvider;
import com.eactive.eai.common.util.DatetimeUtil; import com.eactive.eai.common.util.DatetimeUtil;
import com.eactive.eai.common.util.InboundErrorLogger; import com.eactive.eai.common.util.InboundErrorLogger;
import com.eactive.eai.common.util.Logger; import com.eactive.eai.common.util.Logger;
import com.eactive.eai.common.util.MessageUtil; import com.eactive.eai.common.util.MessageUtil;
import com.eactive.eai.common.util.UUIDGenerator; import com.eactive.eai.common.util.UUIDGenerator;
import com.eactive.eai.inbound.error.InboundErrorInfoVO; import com.eactive.eai.inbound.error.InboundErrorInfoVO;
import com.kjbank.encrypt.exchange.crypto.AES256Cipher;
import com.kjbank.encrypt.exchange.crypto.AES256GCMCipher; // jwhong
import com.kjbank.encrypt.exchange.crypto.AESCipher; import org.json.simple.JSONObject;
import java.util.HashMap;
// jwhong import java.util.Map;
import org.json.simple.JSONObject; import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
import java.util.HashMap;
import java.util.Map; @RestController
import java.sql.Timestamp; public class ApiAdapterController implements HttpAdapterServiceKey {
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo; static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
@RestController @Autowired
public class ApiAdapterController implements HttpAdapterServiceKey { ApiAdapterService service;
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
/**
@Autowired * KBANK 요구사항으로 /api/v1/oauth/token 과 같은 형태로 토큰 발급거래를 수행해야해서 예외처리함
ApiAdapterService service; * @See com.eactive.eai.authserver.config.AuthorizationServerConfig.configure(AuthorizationServerEndpointsConfigurer endpoints)
*/
/** @RequestMapping(value = {"/api/*", "/mapi/*", "/api/*/{path:^(?!.*oauth).*$}/**", "/mapi/*/{path:^(?!.*oauth).*$}/**"})
* KBANK 요구사항으로 /api/v1/oauth/token 과 같은 형태로 토큰 발급거래를 수행해야해서 예외처리함 // @RequestMapping(value = {"/api/**"})
* @See com.eactive.eai.authserver.config.AuthorizationServerConfig.configure(AuthorizationServerEndpointsConfigurer endpoints) public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception {
*/ // /ONLWeb/api/v1/public/getUserInfo.svc
@RequestMapping(value = {"/api/*", "/mapi/*", "/api/*/{path:^(?!.*oauth).*$}/**", "/mapi/*/{path:^(?!.*oauth).*$}/**"}) String apiUri = servletRequest.getRequestURI();
// @RequestMapping(value = {"/api/**"}) // /api/v1/public/getUserInfo.svc
public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception { apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath());
// /ONLWeb/api/v1/public/getUserInfo.svc apiUri = StringUtils.removeEnd(apiUri, "/");
String apiUri = servletRequest.getRequestURI();
// /api/v1/public/getUserInfo.svc //** jwhong TSEAIHS04의 api full path와 비교하여 adapter를 가져온다
apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath()); String methodAndUri = servletRequest.getMethod() + "|" + apiUri;
apiUri = StringUtils.removeEnd(apiUri, "/"); HttpDynamicInAdapterUri adptUri = null;
String adapterGrpName ="";
HttpDynamicInAdapterUri adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance()); String apiSvcCode = "";
try {
//Received time , jwhong STDMessageDAO dao = ApplicationContextProvider.getContext().getBean(STDMessageDAO.class);
long receivedTimeMillis = System.currentTimeMillis(); StandardMessageInfo stdInfo = dao.getSTDMsgByPath(methodAndUri);
String receivedTimeStr = String.valueOf(receivedTimeMillis); String serviceKey = stdInfo.getBzwksvckeyname();
System.out.println("*** inbound receivedTimeStr ***"+receivedTimeStr); int idx = serviceKey.indexOf(":");
adapterGrpName = (idx != -1) ? serviceKey.substring(0, idx) : serviceKey; // ':' 이전 문자열 추출
if (logger.isDebug()) { apiSvcCode = stdInfo.getEaisvcname();
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI()); //아래 원래 Logic
} adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance(), adapterGrpName);
} catch (Exception e) {
if (adptUri == null) { adptUri = null;
logError(servletRequest); }
// throw new Exception("can not find Adapter Uri"); //***
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("can not find Adapter Uri");
} if (logger.isDebug()) {
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
}
String adapterGroupName = adptUri.getAdptGrpName();
String adapterName = adptUri.getAdptName(); if (adptUri == null) {
AdapterGroupVO adapterGroupVO = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName); logError(servletRequest);
AdapterVO adapterVO = AdapterManager.getInstance().getAdapterVO(adapterGroupName, adapterName); // throw new Exception("can not find Adapter Uri");
if (adapterVO == null) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("can not find Adapter Uri");
// throw new Exception("Adapter not found error"); }
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Adapter not found error");
} //Received time , jwhong
long receivedTimeMillis = System.currentTimeMillis(); // 밀리세컨 단위로 보내야함
Properties httpProp = AdapterPropManager.getInstance().getProperties(adapterVO.getPropGroupName()); String receivedTimeStr = String.valueOf(receivedTimeMillis);
String adptMsgType = adapterVO.getAdapterGroupVO().getMessageType(); String adapterGroupName = adptUri.getAdptGrpName();
String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8"); String adapterName = adptUri.getAdptName();
MediaType mediaType = MediaType.valueOf("application/json;charset=" + encode); AdapterGroupVO adapterGroupVO = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName);
String errorResponseFormat = httpProp.getProperty(ERROR_RESPONSE_FORMAT); AdapterVO adapterVO = AdapterManager.getInstance().getAdapterVO(adapterGroupName, adapterName);
if (adapterVO == null) {
String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC"); // throw new Exception("Adapter not found error");
ResponseEntity responseEntity = null; return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("Adapter not found error");
Properties transactionProp = new Properties(); }
//transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeMillis); // jwhong, put api received time
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr); Properties httpProp = AdapterPropManager.getInstance().getProperties(adapterVO.getPropGroupName());
try { String adptMsgType = adapterVO.getAdapterGroupVO().getMessageType();
String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp); String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8");
// if (RESPONSE_TYPE_ASYNC.equals(responseType)) { // table의 값이 ASYNC 로 들어가 있는데 response_type_async는 ASYN 로 되어 있어 아래처럼 비교함 jwhong 2025 MediaType mediaType = MediaType.valueOf("application/json;charset=" + encode);
if ("ASYNC".equals(responseType)) { String errorResponseFormat = httpProp.getProperty(ERROR_RESPONSE_FORMAT);
//responseEntity = ResponseEntity.ok("dummy"); // comment by jwhong
servletResponse.addHeader("traceId", responseData); // uuid를 response header에 String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC");
int httpStatus = servletResponse.getStatus(); ResponseEntity responseEntity = null;
if (httpStatus == 200) { Properties transactionProp = new Properties();
// 업체별 aync response message 가 다르다. // jwhong, put api received time, eaiSvcCode
String asyncMsgStyle = httpProp.getProperty("ASYNC_RTNMSG_TYPE", "").toUpperCase(); transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
String responseBody =""; transactionProp.put(API_SERVICE_CODE, apiSvcCode);
if (asyncMsgStyle == null || asyncMsgStyle.trim().isEmpty()) {
responseBody = makeResponseBodyMsg(); try {
} else { String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp);
responseBody = asyncMsgStyle; // if (RESPONSE_TYPE_ASYNC.equals(responseType)) { // table의 값이 ASYNC 로 들어가 있는데 response_type_async는 ASYN 로 되어 있어 아래처럼 비교함 jwhong 2025
} if ("ASYNC".equals(responseType)) {
responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseBody); //responseEntity = ResponseEntity.ok("dummy"); // comment by jwhong
// jwhong servletResponse.addHeader("traceId", responseData); // uuid를 response header에
} else { int httpStatus = servletResponse.getStatus();
responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseData); if (httpStatus == 200) {
} // 업체별 aync response message 가 다르다.
} else { String asyncMsgStyle = httpProp.getProperty("ASYNC_RTNMSG_TYPE", "").toUpperCase();
// responseEntity = ResponseEntity.ok().contentType(mediaType).body(responseData); String responseBody ="";
// 버즈빌 포인트 적립 처리하기 위하여 정상응답이더라도 응답코드(apiRsltCd) 값이 200이 아닌 경우 처리를 위하여 수정 if (asyncMsgStyle == null || asyncMsgStyle.trim().isEmpty()) {
// Filter에서 설정한 response status값을 responseEntity 생성시 적용 modify by lwk 2025.03.24 responseBody = makeResponseBodyMsg();
int httpStatus = servletResponse.getStatus(); } else {
if (httpStatus != 200) { responseBody = asyncMsgStyle;
responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseData); }
} else { responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseBody);
responseEntity = ResponseEntity.ok().contentType(mediaType).body(responseData); // jwhong
} } else {
} responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseData);
} catch (HttpStatusException e) { }
logger.warn("ApiAdapterController] " + adapterGroupName + "-" + adapterName + ">>" + e.getMessage()); } else {
String errorMsg = MessageUtil.makeErrorMessageByMessageType(adptMsgType, encode, e.getCode(), // responseEntity = ResponseEntity.ok().contentType(mediaType).body(responseData);
e.getMessage(), errorResponseFormat); // 버즈빌 포인트 적립 처리하기 위하여 정상응답이더라도 응답코드(apiRsltCd) 값이 200이 아닌 경우 처리를 위하여 수정
responseEntity = ResponseEntity.status(e.getStatus()).contentType(mediaType).body(errorMsg); // Filter에서 설정한 response status값을 responseEntity 생성시 적용 modify by lwk 2025.03.24
} catch (JwtAuthException e) { int httpStatus = servletResponse.getStatus();
logger.error(adapterGroupName + "-" + adapterName + ">>" + e.getMessage(), e); if (httpStatus != 200) {
String errorMsg = MessageUtil.makeErrorMessageByMessageType(adptMsgType, encode, e.getCode(), responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseData);
e.getMessage(), errorResponseFormat); } else {
responseEntity = ResponseEntity.status(HttpStatus.UNAUTHORIZED).contentType(mediaType).body(errorMsg); responseEntity = ResponseEntity.ok().contentType(mediaType).body(responseData);
} catch (Exception e) { }
logger.error(adapterGroupName + "-" + adapterName + ">>" + e.getMessage(), e); }
responseEntity = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).contentType(mediaType).body(e); } catch (HttpStatusException e) {
} finally { logger.warn("ApiAdapterController] " + adapterGroupName + "-" + adapterName + ">>" + e.getMessage());
/** String errorMsg = MessageUtil.makeErrorMessageByMessageType(adptMsgType, encode, e.getCode(),
* 로깅 인터셉터에 데이터를 전달하기 위한 처리 e.getMessage(), errorResponseFormat);
* 이미 거래처리가 끝나서 영향도가 없을만한 servletRequest에 Attribute로 전달 responseEntity = ResponseEntity.status(e.getStatus()).contentType(mediaType).body(errorMsg);
* 추후 더 좋은방법이 생길경우 개선 요망 } catch (JwtAuthException e) {
*/ logger.error(adapterGroupName + "-" + adapterName + ">>" + e.getMessage(), e);
servletRequest.setAttribute(TransactionContextKeys.TRANSACTION_PROP, transactionProp); String errorMsg = MessageUtil.makeErrorMessageByMessageType(adptMsgType, encode, e.getCode(),
} e.getMessage(), errorResponseFormat);
return responseEntity; responseEntity = ResponseEntity.status(HttpStatus.UNAUTHORIZED).contentType(mediaType).body(errorMsg);
} } catch (Exception e) {
logger.error(adapterGroupName + "-" + adapterName + ">>" + e.getMessage(), e);
responseEntity = ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).contentType(mediaType).body(e);
} finally {
/** /**
* url에서 뒤쪽 /이후를 제거하면서 찾는다.<br> * 로깅 인터셉터에 데이터를 전달하기 위한 처리
* /api/v1/public/getUserInfo.svc * 이미 거래처리가 끝나서 영향도가 없을만한 servletRequest에 Attribute로 전달
* * 추후 더 좋은방법이 생길경우 개선 요망
* @param apiUri */
* @return servletRequest.setAttribute(TransactionContextKeys.TRANSACTION_PROP, transactionProp);
*/ }
private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager) throws Exception { return responseEntity;
if (StringUtils.isBlank(apiUri)) { }
return null;
}
//** jwhong TSEAIHS04의 api full path와 비교하여 adapter를 가져온다 /**
STDMessageDAO dao = ApplicationContextProvider.getContext().getBean(STDMessageDAO.class); * url에서 뒤쪽 /이후를 제거하면서 찾는다.<br>
StandardMessageInfo stdInfo = dao.getSTDMsgByPath(apiUri); * /api/v1/public/getUserInfo.svc
String serviceKey = stdInfo.getBzwksvckeyname(); *
int idx = serviceKey.indexOf(":"); * @param apiUri
String adapterGrpName = (idx != -1) ? serviceKey.substring(0, idx) : serviceKey; // ':' 이전 문자열 추출 * @return
//*** */
private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager, String adapterGrpName) throws Exception {
System.out.println("====== adptUriMap 상세 내용 ======="); if (StringUtils.isBlank(apiUri)) {
for (Map.Entry<String, HttpDynamicInAdapterUri> entry : manager.adptUriMap.entrySet()) { return null;
HttpDynamicInAdapterUri uriObj = entry.getValue(); }
System.out.println("GroupName="+uriObj.getAdptGrpName()
+ ", AdapterName=" + uriObj.getAdptName() //* manager 출력
+ ", URI=" + uriObj.getUri()); logger.warn("===== adptUriMap 상세 내용 =====");
} for (Map.Entry<String, HttpDynamicInAdapterUri> entry : manager.adptUriMap.entrySet()) {
System.out.println("================================"); HttpDynamicInAdapterUri uriObj = entry.getValue();
logger.warn("GroupName=" + uriObj.getAdptGrpName()
for (int i = 0; i < 10; i++) { + ", AdapterName=" + uriObj.getAdptName()
HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri); + ", URI=" + uriObj.getUri());
if (adptUri != null) { }
System.out.println("*****adptUri.getAdptGrpName() "+ adptUri.getAdptGrpName()); logger.warn("================================");
System.out.println("*****getAdptGrpName "+ adapterGrpName);
if (adptUri.getAdptGrpName().equals(adapterGrpName)) {
return adptUri; //
}
} for (int i = 0; i < 10; i++) {
HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri);
// /api/v1/public if (adptUri != null) {
apiUri = StringUtils.substringBeforeLast(apiUri, "/"); if (adptUri.getAdptGrpName().equals(adapterGrpName)) {
System.out.println("*****apiUri "+ apiUri); return adptUri;
if (apiUri.length() < 4) { // /api }
return null; }
}
} // /api/v1/public
apiUri = StringUtils.substringBeforeLast(apiUri, "/");
return null; if (apiUri.length() < 4) { // /api
} return null;
}
private void logError(HttpServletRequest request) { }
InboundErrorInfoVO errorInfoVO = new InboundErrorInfoVO();
return null;
EAIServerManager eaiServerManager = EAIServerManager.getInstance(); }
String serverName = eaiServerManager.getLocalServerName();
String uuid = null; private void logError(HttpServletRequest request) {
StringBuffer sb = new StringBuffer(); InboundErrorInfoVO errorInfoVO = new InboundErrorInfoVO();
String instanceid1 = serverName.substring(0, 2); EAIServerManager eaiServerManager = EAIServerManager.getInstance();
String instanceid2 = serverName.substring(serverName.length() - 2, serverName.length()); String serverName = eaiServerManager.getLocalServerName();
String instid = instanceid1 + instanceid2; String uuid = null;
uuid = instid + UUIDGenerator.getUUID(); StringBuffer sb = new StringBuffer();
String[] msgArgs = new String[1]; String instanceid1 = serverName.substring(0, 2);
msgArgs[0] = request.getRequestURI(); String instanceid2 = serverName.substring(serverName.length() - 2, serverName.length());
String instid = instanceid1 + instanceid2;
String errorCode = "RECEAIIRP010"; uuid = instid + UUIDGenerator.getUUID();
String errorMsg = ExceptionUtil.make(new Exception("cat not find uri"), errorCode, msgArgs);
String[] msgArgs = new String[1];
errorInfoVO.setEaiSvcSno(uuid); // EAI서비스일련번호 msgArgs[0] = request.getRequestURI();
errorInfoVO.setAdptBwkGrpNm("HTTP_IN_NO_URI"); // 어댑터업무그룹명
errorInfoVO.setErrCd(errorCode); // 에러코드 String errorCode = "RECEAIIRP010";
errorInfoVO.setErrTxt(errorMsg); // 에러내용 String errorMsg = ExceptionUtil.make(new Exception("cat not find uri"), errorCode, msgArgs);
errorInfoVO.setErrTm(DatetimeUtil.getCurrentTime(new Date().getTime())); // 에러발생시각
errorInfoVO.setErrDstcd(" "); errorInfoVO.setEaiSvcSno(uuid); // EAI서비스일련번호
sb.append("Remote Addr : ").append(request.getRemoteAddr()).append("\n").append("Request URI : ") errorInfoVO.setAdptBwkGrpNm("HTTP_IN_NO_URI"); // 어댑터업무그룹명
.append(request.getRequestURI()); errorInfoVO.setErrCd(errorCode); // 에러코드
errorInfoVO.setBwkDataTxt(sb.toString()); // 업무데이터내용 errorInfoVO.setErrTxt(errorMsg); // 에러내용
errorInfoVO.setEaiSvrInstNm(serverName); // EAI서버인스턴스명 errorInfoVO.setErrTm(DatetimeUtil.getCurrentTime(new Date().getTime())); // 에러발생시각
errorInfoVO.setErrDstcd(" ");
InboundErrorLogger.error(errorInfoVO); sb.append("Remote Addr : ").append(request.getRemoteAddr()).append("\n").append("Request URI : ")
} .append(request.getRequestURI());
errorInfoVO.setBwkDataTxt(sb.toString()); // 업무데이터내용
errorInfoVO.setEaiSvrInstNm(serverName); // EAI서버인스턴스명
private String makeResponseBodyMsg() {
InboundErrorLogger.error(errorInfoVO);
Map<String, Object> dataMap = new HashMap<>(); }
dataMap.put("result", 1);
Map<String, Object> map = new HashMap<>();
private String makeResponseBodyMsg() {
map.put("code", "200");
map.put("data", dataMap); Map<String, Object> dataMap = new HashMap<>();
map.put("message", "정상 처리 되었습니다."); dataMap.put("result", 1);
Map<String, Object> map = new HashMap<>();
JSONObject json = new JSONObject();
json.putAll(map); map.put("code", "200");
map.put("data", dataMap);
return json.toJSONString(); map.put("message", "정상 처리 되었습니다.");
}
JSONObject json = new JSONObject();
/* json.putAll(map);
private String makeResponseBodyMsg(String asyncMsgStyle) {
return json.toJSONString();
Map<String, Object> dataMap = new HashMap<>(); }
dataMap.put("result", 1);
Map<String, Object> map = new HashMap<>(); /*
private String makeResponseBodyMsg(String asyncMsgStyle) {
switch (asyncMsgStyle) {
case "TB_SUC": Map<String, Object> dataMap = new HashMap<>();
map.put("rspCode", "TB_SUC_000"); dataMap.put("result", 1);
map.put("rspMsg", "정상"); Map<String, Object> map = new HashMap<>();
map.put("data", dataMap);
break; switch (asyncMsgStyle) {
case "ONLYDATA": case "TB_SUC":
map.put("data", dataMap); map.put("rspCode", "TB_SUC_000");
map.put("success", "true"); map.put("rspMsg", "정상");
break; map.put("data", dataMap);
default: break;
map.put("code", "200"); case "ONLYDATA":
map.put("data", dataMap); map.put("data", dataMap);
map.put("message", "정상 처리 되었습니다."); map.put("success", "true");
break; break;
} default:
map.put("code", "200");
JSONObject json = new JSONObject(); map.put("data", dataMap);
json.putAll(map); map.put("message", "정상 처리 되었습니다.");
break;
return json.toJSONString(); }
}
*/ JSONObject json = new JSONObject();
json.putAll(map);
return json.toJSONString();
}
*/
} }
@@ -448,6 +448,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
// end test source // end test source
switch (decryptAlgorithm) { switch (decryptAlgorithm) {
case "AES128":
case "AES128-TOSS": case "AES128-TOSS":
try { try {
String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네?? String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네??
@@ -532,6 +533,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
String decryptedBodyMessage = ""; String decryptedBodyMessage = "";
switch (decryptAlgorithm) { switch (decryptAlgorithm) {
case "AES128":
case "AES128-TOSS": case "AES128-TOSS":
decryptedJsonKey = "preScreeningRequest"; decryptedJsonKey = "preScreeningRequest";
break; break;
@@ -587,6 +589,7 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
// end test source // end test source
switch (encryptAlgorithm) { switch (encryptAlgorithm) {
case "AES128":
case "AES128-TOSS": case "AES128-TOSS":
try { try {
String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네?? String key128 = clientSecretKey.substring(22,38); //togetherEncoder 경우는 substring(44,60) 이네??