Merge branch 'jenkins_with_weblogic' of ssh://192.168.240.178:18081/eapim/eapim-online into jenkins_with_weblogic
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="euc-kr"?>
|
||||||
|
<%@ page contentType="text/xml; charset=utf-8"%>
|
||||||
|
<%@ page import="com.eactive.eai.adapter.socket2.config.MonitoringUtil"%>
|
||||||
|
<%@ page import="java.util.*,com.eactive.eai.common.util.Logger" %>
|
||||||
|
<Dataset>
|
||||||
|
<Columns>
|
||||||
|
<Column Name="EaiSevrInstncName" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrBzwkGroupName" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrBzwkName" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrBzwkDesc" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrType" Type="string" Size="255" />
|
||||||
|
<Column Name="Status" Type="string" Size="255" />
|
||||||
|
<Column Name="Param7" Type="string" Size="255" />
|
||||||
|
<Column Name="Param8" Type="string" Size="255" />
|
||||||
|
<Column Name="Starting" Type="string" Size="255" />
|
||||||
|
<Column Name="KesaUseYn" Type="string" Size="255" />
|
||||||
|
<Column Name="TestMasterYn" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrNickName" Type="string" Size="255" />
|
||||||
|
<Column Name="CompanyCodeData" Type="string" Size="255" />
|
||||||
|
<Column Name="StartStop" Type="string" Size="255" />
|
||||||
|
</Columns>
|
||||||
|
<Rows>
|
||||||
|
<%!
|
||||||
|
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||||
|
%>
|
||||||
|
|
||||||
|
<%
|
||||||
|
//
|
||||||
|
// Socket2 status info
|
||||||
|
|
||||||
|
|
||||||
|
String eaiSvrInstNm = request.getParameter("eaiSvrInstNm");
|
||||||
|
String adapterGroupName = request.getParameter("adapterGroupName");
|
||||||
|
|
||||||
|
if (eaiSvrInstNm == null)
|
||||||
|
eaiSvrInstNm = "";
|
||||||
|
|
||||||
|
if (adapterGroupName == null)
|
||||||
|
adapterGroupName = "";
|
||||||
|
|
||||||
|
String stateColor = "";
|
||||||
|
String stateText = "";
|
||||||
|
|
||||||
|
String startColor = "";
|
||||||
|
String startText = "";
|
||||||
|
String startStop = "";
|
||||||
|
|
||||||
|
|
||||||
|
String[][] arrList = null ;
|
||||||
|
try {
|
||||||
|
if(adapterGroupName.length() > 0) {
|
||||||
|
arrList = MonitoringUtil.adapterStatus(adapterGroupName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
arrList = MonitoringUtil.adapterList1();
|
||||||
|
}
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
if (logger.isError()){
|
||||||
|
logger.error(e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 리턴된 arrList 가 null 이 아니면서 배열길이가 0 인 경우 Exception 발생
|
||||||
|
// 하지 않도록 하기 위함. (2008-06-30)
|
||||||
|
if( arrList == null || arrList.length == 0 ) {
|
||||||
|
%>
|
||||||
|
<Row>
|
||||||
|
<Data><%=eaiSvrInstNm%></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
</Row>
|
||||||
|
<%
|
||||||
|
|
||||||
|
} else {
|
||||||
|
int col = arrList[0].length ;
|
||||||
|
int row = arrList.length ;
|
||||||
|
|
||||||
|
for( int i = 0 ; i < row ; i++ ) {
|
||||||
|
out.println("<Row>");
|
||||||
|
out.println("<Data>" + eaiSvrInstNm + "</Data>");
|
||||||
|
for( int j = 0 ; j < col ; j++ ) {
|
||||||
|
if(j == 2) {
|
||||||
|
out.println("<Data><![CDATA[" + arrList[i][j] + "]]></Data>");
|
||||||
|
} else {
|
||||||
|
out.println("<Data>" + arrList[i][j] + "</Data>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 버그수정
|
||||||
|
if(arrList[i] != null && arrList[i].length > 4 ) {
|
||||||
|
if( "STARTED".equals(arrList[i][7]) || "STARTING".equals(arrList[i][7])) {
|
||||||
|
startStop = "03" ; // stop
|
||||||
|
} else {
|
||||||
|
startStop = "01" ; // start
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
out.println("<Data>"+ startStop +"</Data>");
|
||||||
|
out.println("</Row>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
</Rows>
|
||||||
|
</Dataset>
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="euc-kr"?>
|
||||||
|
<%@ page contentType="text/xml; charset=utf-8"%>
|
||||||
|
<%@ page import="com.eactive.eai.adapter.socket2.config.MonitoringUtil"%>
|
||||||
|
<%@ page import="java.util.*,com.eactive.eai.common.util.Logger" %>
|
||||||
|
<Dataset>
|
||||||
|
<Columns>
|
||||||
|
<Column Name="EaiSevrInstncName" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrBzwkGroupName" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrBzwkName" Type="string" Size="255" />
|
||||||
|
<Column Name="AdptrBzwkDesc" Type="string" Size="255" />
|
||||||
|
<Column Name="MaxConnection" Type="string" Size="255" />
|
||||||
|
<Column Name="CurrentConnection" Type="string" Size="255" />
|
||||||
|
<Column Name="SendCount" Type="string" Size="255" />
|
||||||
|
<Column Name="RecvCount" Type="string" Size="255" />
|
||||||
|
<Column Name="ErrorCount" Type="string" Size="255" />
|
||||||
|
<Column Name="Status" Type="string" Size="255" />
|
||||||
|
<Column Name="Param7" Type="string" Size="255" />
|
||||||
|
<Column Name="Param8" Type="string" Size="255" />
|
||||||
|
</Columns>
|
||||||
|
<Rows>
|
||||||
|
<%!
|
||||||
|
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||||
|
%>
|
||||||
|
<%
|
||||||
|
//
|
||||||
|
// Socket2 connection info
|
||||||
|
|
||||||
|
String eaiSvrInstNm = request.getParameter("eaiSvrInstNm");
|
||||||
|
|
||||||
|
if (eaiSvrInstNm == null)
|
||||||
|
eaiSvrInstNm = "";
|
||||||
|
|
||||||
|
String stateColor = "";
|
||||||
|
String stateText = "";
|
||||||
|
|
||||||
|
String startColor = "";
|
||||||
|
String startText = "";
|
||||||
|
String startStop = "";
|
||||||
|
|
||||||
|
String[][] arrList = null ;
|
||||||
|
try {
|
||||||
|
arrList = MonitoringUtil.adapterList2();
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
if (logger.isError()){
|
||||||
|
logger.error(e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 리턴된 arrList 가 null 이 아니면서 배열길이가 0 인 경우 Exception 발생
|
||||||
|
// 하지 않도록 하기 위함. (2008-06-30)
|
||||||
|
if( arrList == null || arrList.length == 0 ) {
|
||||||
|
%>
|
||||||
|
<Row>
|
||||||
|
<Data><%=eaiSvrInstNm%></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
<Data></Data>
|
||||||
|
</Row>
|
||||||
|
<%
|
||||||
|
|
||||||
|
} else {
|
||||||
|
int col = arrList[0].length ;
|
||||||
|
int row = arrList.length ;
|
||||||
|
for( int i = 0 ; i < row ; i++ ) {
|
||||||
|
out.println("<Row>");
|
||||||
|
out.println("<Data>" + eaiSvrInstNm + "</Data>");
|
||||||
|
|
||||||
|
for( int j = 0 ; j < col ; j++ ) {
|
||||||
|
out.println("<Data>" + arrList[i][j] + "</Data>");
|
||||||
|
}
|
||||||
|
out.println("</Row>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%>
|
||||||
|
</Rows>
|
||||||
|
</Dataset>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
|
||||||
|
<%@ page import="com.eactive.eai.adapter.socket2.config.MonitoringUtil"%>
|
||||||
|
<%@ page import="com.eactive.eai.common.util.CharsetDecoderUtil" %>
|
||||||
|
<%@ page import="java.util.*,com.eactive.eai.common.util.Logger" %>
|
||||||
|
<%!
|
||||||
|
static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||||
|
%>
|
||||||
|
<%
|
||||||
|
//
|
||||||
|
// Socket2 adapter start/stop command
|
||||||
|
|
||||||
|
String adapterGroupName = request.getParameter("adapterGroupName");
|
||||||
|
String adapterName = request.getParameter("adapterName");
|
||||||
|
String cmd = request.getParameter("cmd");
|
||||||
|
|
||||||
|
if( adapterGroupName == null ) {
|
||||||
|
adapterGroupName = "" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( adapterName == null ) {
|
||||||
|
adapterName = "" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( cmd == null ) {
|
||||||
|
cmd = "" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String retMsg = null ;
|
||||||
|
try {
|
||||||
|
if( cmd.equals("start") ) {
|
||||||
|
MonitoringUtil.adapterStart(adapterGroupName, adapterName);
|
||||||
|
retMsg = "true" ;
|
||||||
|
} else if( cmd.equals("stop") ) {
|
||||||
|
MonitoringUtil.adapterStop(adapterGroupName, adapterName);
|
||||||
|
retMsg = "true" ;
|
||||||
|
} else {
|
||||||
|
retMsg = "Unknown command error :" + cmd ;
|
||||||
|
}
|
||||||
|
} catch ( Exception e ) {
|
||||||
|
if (logger.isError()){
|
||||||
|
logger.error("MonitoringUtil.adapterStart|adapterStop(" + adapterGroupName + ", " + adapterName + ")" );
|
||||||
|
}
|
||||||
|
//e.printStackTrace(new java.io.PrintWriter(out));
|
||||||
|
retMsg = "false" ;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( retMsg == null )
|
||||||
|
retMsg = "" ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
out.println( CharsetDecoderUtil.toKor(retMsg) );
|
||||||
|
%>
|
||||||
@@ -51,6 +51,7 @@ war {
|
|||||||
|
|
||||||
if (profile == "weblogic") {
|
if (profile == "weblogic") {
|
||||||
webXml = file("WebContent/WEB-INF/weblogic-web.xml")
|
webXml = file("WebContent/WEB-INF/weblogic-web.xml")
|
||||||
|
exclude 'WEB-INF/web.xml'
|
||||||
}
|
}
|
||||||
archiveFileName = "eapim-online.war"
|
archiveFileName = "eapim-online.war"
|
||||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
duplicatesStrategy = DuplicatesStrategy.WARN
|
||||||
|
|||||||
@@ -27,20 +27,20 @@ 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.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;
|
|
||||||
import com.kjbank.encrypt.exchange.crypto.AESCipher;
|
|
||||||
|
|
||||||
// jwhong
|
// jwhong
|
||||||
import org.json.simple.JSONObject;
|
import org.json.simple.JSONObject;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import com.eactive.eai.data.entity.onl.stdmessage.StandardMessageInfo;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
public class ApiAdapterController implements HttpAdapterServiceKey {
|
public class ApiAdapterController implements HttpAdapterServiceKey {
|
||||||
@@ -48,21 +48,39 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ApiAdapterService service;
|
ApiAdapterService service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KBANK 요구사항으로 /api/v1/oauth/token 과 같은 형태로 토큰 발급거래를 수행해야해서 예외처리함
|
* KBANK 요구사항으로 /api/v1/oauth/token 과 같은 형태로 토큰 발급거래를 수행해야해서 예외처리함
|
||||||
* @See com.eactive.eai.authserver.config.AuthorizationServerConfig.configure(AuthorizationServerEndpointsConfigurer endpoints)
|
* @See com.eactive.eai.authserver.config.AuthorizationServerConfig.configure(AuthorizationServerEndpointsConfigurer endpoints)
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"/api/*", "/api/*/{path:^(?!.*oauth).*$}/**"})
|
@RequestMapping(value = {"/api/*", "/mapi/*", "/api/*/{path:^(?!.*oauth).*$}/**", "/mapi/*/{path:^(?!.*oauth).*$}/**"})
|
||||||
// @RequestMapping(value = {"/api/**"})
|
// @RequestMapping(value = {"/api/**"})
|
||||||
public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception {
|
public ResponseEntity<String> callApi(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws Exception {
|
||||||
// /ONLWeb/api/v1/public/getUserInfo.svc
|
// /ONLWeb/api/v1/public/getUserInfo.svc
|
||||||
String apiUri = servletRequest.getRequestURI();
|
String apiUri = servletRequest.getRequestURI();
|
||||||
// /api/v1/public/getUserInfo.svc
|
// /api/v1/public/getUserInfo.svc
|
||||||
apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath());
|
apiUri = StringUtils.removeStart(apiUri, servletRequest.getContextPath());
|
||||||
apiUri = StringUtils.removeEnd(apiUri, "/");
|
apiUri = StringUtils.removeEnd(apiUri, "/");
|
||||||
HttpDynamicInAdapterUri adptUri = findAdptUri(apiUri, HttpDynamicInAdapterManager.getInstance());
|
|
||||||
|
|
||||||
|
//** 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()) {
|
if (logger.isDebug()) {
|
||||||
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
logger.debug("ApiAdapterController] service request uri : " + servletRequest.getRequestURI());
|
||||||
}
|
}
|
||||||
@@ -71,8 +89,11 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
logError(servletRequest);
|
logError(servletRequest);
|
||||||
// throw new Exception("can not find Adapter Uri");
|
// throw new Exception("can not find Adapter Uri");
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("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 adapterGroupName = adptUri.getAdptGrpName();
|
||||||
String adapterName = adptUri.getAdptName();
|
String adapterName = adptUri.getAdptName();
|
||||||
@@ -93,6 +114,10 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC");
|
String responseType = httpProp.getProperty(RESPONSE_TYPE, "SYNC");
|
||||||
ResponseEntity responseEntity = null;
|
ResponseEntity responseEntity = null;
|
||||||
Properties transactionProp = new Properties();
|
Properties transactionProp = new Properties();
|
||||||
|
// jwhong, put api received time, eaiSvcCode
|
||||||
|
transactionProp.put(INBOUND_REQUESTED_TIME, receivedTimeStr);
|
||||||
|
transactionProp.put(API_SERVICE_CODE, apiSvcCode);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp);
|
String responseData = service.callApi(servletRequest, servletResponse, httpProp, adapterGroupVO, adapterVO, transactionProp);
|
||||||
// if (RESPONSE_TYPE_ASYNC.equals(responseType)) { // table의 값이 ASYNC 로 들어가 있는데 response_type_async는 ASYN 로 되어 있어 아래처럼 비교함 jwhong 2025
|
// if (RESPONSE_TYPE_ASYNC.equals(responseType)) { // table의 값이 ASYNC 로 들어가 있는데 response_type_async는 ASYN 로 되어 있어 아래처럼 비교함 jwhong 2025
|
||||||
@@ -103,7 +128,12 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
if (httpStatus == 200) {
|
if (httpStatus == 200) {
|
||||||
// 업체별 aync response message 가 다르다.
|
// 업체별 aync response message 가 다르다.
|
||||||
String asyncMsgStyle = httpProp.getProperty("ASYNC_RTNMSG_TYPE", "").toUpperCase();
|
String asyncMsgStyle = httpProp.getProperty("ASYNC_RTNMSG_TYPE", "").toUpperCase();
|
||||||
String responseBody = makeResponseBodyMsg(asyncMsgStyle);
|
String responseBody ="";
|
||||||
|
if (asyncMsgStyle == null || asyncMsgStyle.trim().isEmpty()) {
|
||||||
|
responseBody = makeResponseBodyMsg();
|
||||||
|
} else {
|
||||||
|
responseBody = asyncMsgStyle;
|
||||||
|
}
|
||||||
responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseBody);
|
responseEntity = ResponseEntity.status(httpStatus).contentType(mediaType).body(responseBody);
|
||||||
// jwhong
|
// jwhong
|
||||||
} else {
|
} else {
|
||||||
@@ -153,15 +183,30 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
* @param apiUri
|
* @param apiUri
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager) {
|
private HttpDynamicInAdapterUri findAdptUri(String apiUri, HttpDynamicInAdapterManager manager, String adapterGrpName) throws Exception {
|
||||||
if (StringUtils.isBlank(apiUri)) {
|
if (StringUtils.isBlank(apiUri)) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
//* manager 출력
|
||||||
|
logger.warn("===== adptUriMap 상세 내용 =====");
|
||||||
|
for (Map.Entry<String, HttpDynamicInAdapterUri> 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++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri);
|
HttpDynamicInAdapterUri adptUri = manager.getAdptUri(apiUri);
|
||||||
if (adptUri != null) {
|
if (adptUri != null) {
|
||||||
return adptUri;
|
if (adptUri.getAdptGrpName().equals(adapterGrpName)) {
|
||||||
|
return adptUri;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/v1/public
|
// /api/v1/public
|
||||||
@@ -207,6 +252,24 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
InboundErrorLogger.error(errorInfoVO);
|
InboundErrorLogger.error(errorInfoVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private String makeResponseBodyMsg() {
|
||||||
|
|
||||||
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
|
dataMap.put("result", 1);
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
|
map.put("code", "200");
|
||||||
|
map.put("data", dataMap);
|
||||||
|
map.put("message", "정상 처리 되었습니다.");
|
||||||
|
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.putAll(map);
|
||||||
|
|
||||||
|
return json.toJSONString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
private String makeResponseBodyMsg(String asyncMsgStyle) {
|
private String makeResponseBodyMsg(String asyncMsgStyle) {
|
||||||
|
|
||||||
Map<String, Object> dataMap = new HashMap<>();
|
Map<String, Object> dataMap = new HashMap<>();
|
||||||
@@ -235,6 +298,7 @@ public class ApiAdapterController implements HttpAdapterServiceKey {
|
|||||||
|
|
||||||
return json.toJSONString();
|
return json.toJSONString();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -76,7 +76,6 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
|
|||||||
String adptGrpName = adapterGroupVO.getName();
|
String adptGrpName = adapterGroupVO.getName();
|
||||||
String adptName = adapterVO.getName();
|
String adptName = adapterVO.getName();
|
||||||
|
|
||||||
|
|
||||||
String urlDecodeYn = httpProp.getProperty(URL_DECODE_YN, "N");
|
String urlDecodeYn = httpProp.getProperty(URL_DECODE_YN, "N");
|
||||||
String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8");
|
String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8");
|
||||||
|
|
||||||
@@ -310,7 +309,9 @@ public class ApiAdapterService extends HttpAdapterServiceSupport {
|
|||||||
result = mapper.writeValueAsString(rootNode);
|
result = mapper.writeValueAsString(rootNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KJBank는 요청에 대한 응답 (Sync응답, Aync 에 대한 Ack응답) 에 대하여 암호화 하지 않는다. 무조건 안한다. 따라서 아래부분은 구현은 했지만 사용하지 않는다.
|
||||||
|
//result = doPostEncryption(result, transactionProp); // jwhong Encrypt
|
||||||
// ASYNC 인 경우 광주은행은 RETURN 해 주는 값들이 수정되어야 한다. JWHONG
|
// ASYNC 인 경우 광주은행은 RETURN 해 주는 값들이 수정되어야 한다. JWHONG
|
||||||
/*
|
/*
|
||||||
if ("ASYN".equals(syncAsyncType) && MessageType.JSON.equals(adptMsgType) && StringUtils.isNotBlank(headerGroupName)) {
|
if ("ASYN".equals(syncAsyncType) && MessageType.JSON.equals(adptMsgType) && StringUtils.isNotBlank(headerGroupName)) {
|
||||||
@@ -467,6 +468,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) 이네??
|
||||||
@@ -551,6 +553,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;
|
||||||
@@ -606,6 +609,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) 이네??
|
||||||
|
|||||||
Reference in New Issue
Block a user