Merge remote-tracking branch 'origin/jenkins_with_weblogic' of
C:/eactive/bundle/bundles/20251223/eapim-admin_incremental_2025-12-01.bundle into jenkins_with_weblogic
This commit is contained in:
@@ -168,7 +168,7 @@ function validateName(){
|
||||
return checkError;
|
||||
}
|
||||
|
||||
function localSave(){
|
||||
function localSave(isSilent){
|
||||
var key =$("input[name=ADPTRBZWKNAME]").val();
|
||||
//객체 생성
|
||||
var save ={};
|
||||
@@ -217,8 +217,12 @@ function localSave(){
|
||||
save["adapterPropGroup"]= adapterPropGroup;
|
||||
save["adapterProps"] = fullData;
|
||||
submitData[key]=save;
|
||||
|
||||
alert("<%=localeMessage.getString("adapterDetail.saveAlertMsg1")%>");
|
||||
|
||||
if (!isSilent) {
|
||||
alert("<%=localeMessage.getString("adapterDetail.saveAlertMsg1")%>");
|
||||
} else {
|
||||
alert("어댑터 정보 저장 성공!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -280,6 +284,7 @@ function init(key,callback){
|
||||
callback(key);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
@@ -328,6 +333,7 @@ function detail(key){
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
//adapter
|
||||
@@ -632,7 +638,15 @@ $(document).ready(function() {
|
||||
var r = confirm("<%=localeMessage.getString("adapterDetail.checkMsg4")%>");
|
||||
if (r == false) return;
|
||||
}
|
||||
|
||||
|
||||
// 25.12.16 수정시 어댑터 리스트 자동저장
|
||||
alert("어댑터의 정보를 저장을 먼저 진행합니다.")
|
||||
var isSubSaveSuccess = ModifyPopCheckAndSave(true);
|
||||
|
||||
if (!isSubSaveSuccess) {
|
||||
alert("어댑터 정보 저장이 실패했습니다. 어댑터 정보를 확인해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
//공통부만 form으로 구성
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
@@ -819,24 +833,33 @@ $(document).ready(function() {
|
||||
localSave();
|
||||
chkAdapterCnt('add');
|
||||
|
||||
});
|
||||
$("#btn_pop_modify").click(function(){
|
||||
//
|
||||
});
|
||||
$("#btn_pop_modify").click(function(){ // 검색용
|
||||
ModifyPopCheckAndSave(false);
|
||||
});
|
||||
|
||||
function ModifyPopCheckAndSave(isSilent) {
|
||||
var isDuplication = false;
|
||||
|
||||
$("select[name=ADAPTERLIST] option").each(function(){
|
||||
if ($(this).val() == $("input[name=ADPTRBZWKNAME]").val()){
|
||||
isDuplication = true;
|
||||
}
|
||||
});
|
||||
if (!isDuplication){
|
||||
alert("<%=localeMessage.getString("adapterDetail.checkMsg2")%>");
|
||||
return;
|
||||
}
|
||||
localSave();
|
||||
|
||||
});
|
||||
if (!isDuplication){
|
||||
// 화면 저장시 기존 alert 표시, INSERT/UPDATE 시 메시지 표시하지 않음
|
||||
if (!isSilent) {
|
||||
alert("<%=localeMessage.getString("adapterDetail.checkMsg2")%>");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
localSave(isSilent);
|
||||
return true;
|
||||
}
|
||||
|
||||
$("#btn_pop_delete").click(function(){
|
||||
//
|
||||
var isDuplication = false;
|
||||
$("select[name=ADAPTERLIST] option").each(function(){
|
||||
if ($(this).val() == $("input[name=ADPTRBZWKNAME]").val()){
|
||||
|
||||
@@ -479,17 +479,17 @@
|
||||
<th>REDIRECT URI</th>
|
||||
<td><input type="text" name="redirectUri"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr style="display: none;">
|
||||
<th><%= localeMessage.getString("clntManDtl.athrt") %>
|
||||
(<%= localeMessage.getString("clntManDtl.sprt") %> ,)
|
||||
</th>
|
||||
<td><input type="text" name="authorities"/></td>
|
||||
<td><input type="text" name="authorities" value=""/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr style="display: none;">
|
||||
<th><%= localeMessage.getString("clntManDtl.rsrc") %>
|
||||
(<%= localeMessage.getString("clntManDtl.sprt") %> ,)
|
||||
</th>
|
||||
<td><input type="text" name="resourceIds"/></td>
|
||||
<td><input type="text" name="resourceIds" value=""/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("clntManDtl.tknExprtnDt") %>
|
||||
@@ -501,11 +501,11 @@
|
||||
</th>
|
||||
<td><input type="text" name="refreshTokenValiditySeconds"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr style="display: none;">
|
||||
<th><%= localeMessage.getString("clntManDtl.atmtcApprvlScp") %>
|
||||
(<%= localeMessage.getString("clntManDtl.sprt") %> ,)
|
||||
</th>
|
||||
<td><input type="text" name="autoApprove"/></td>
|
||||
<td><input type="text" name="autoApprove" value=""/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("clntManDtl.allwIp") %>
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<script language="javascript" >
|
||||
var url = '<c:url value="/onl/admin/authserver/scopeMan.json" />';
|
||||
var url_view = '<c:url value="/onl/admin/authserver/scopeMan.view" />';
|
||||
var api_url_view = '<c:url value="/onl/apim/apigroup/apiGroupMan.view" />';
|
||||
var mapping_url = '<c:url value="/onl/admin/authserver/apiScopeMan.json" />';
|
||||
|
||||
var isDetail = false;
|
||||
function isValid(){
|
||||
@@ -58,8 +60,106 @@ function detail(key){
|
||||
});
|
||||
}
|
||||
|
||||
function init(key,callback){
|
||||
function mappingInfo(key){
|
||||
if (!isDetail) return;
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url: mapping_url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'LIST', searchScopeId : key},
|
||||
success: function(json){
|
||||
var mappingData = json.rows;
|
||||
|
||||
if (mappingData && mappingData.length > 0) {
|
||||
$.each(mappingData, function(idx, row) {
|
||||
row.apiId = row.apiId;
|
||||
row.apiDesc = row.apiDesc;
|
||||
row.apiFullPath = row.APIFULLPATH;
|
||||
row.bzwksvckeyname = row.BZWKSVCKEYNAME;
|
||||
});
|
||||
}
|
||||
|
||||
var $grid = $("#selectedApiGrid");
|
||||
$grid.jqGrid('clearGridData');
|
||||
$grid.jqGrid('setGridParam', {
|
||||
datatype: 'local',
|
||||
data: mappingData
|
||||
}).trigger("reloadGrid");
|
||||
},
|
||||
error: function(e){
|
||||
alert("데이터 조회 중 오류 발생: " + e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init(key, callback){
|
||||
detail(key);
|
||||
|
||||
var selectedApiGrid = $("#selectedApiGrid");
|
||||
selectedApiGrid.jqGrid({
|
||||
datatype: "local",
|
||||
colNames: ['API ID', 'API 명', 'SCOPE ID', 'SCOPE 명', 'API FULL PATH', 'API 정보'],
|
||||
colModel: [
|
||||
{name: 'apiId', index: 'apiId', width: 100, align: 'center'},
|
||||
{name: 'apiDesc', index: 'apiDesc', width: 100, align: 'center'},
|
||||
{name: 'SCOPEID', index: 'SCOPEID', width: 100, align: 'center'},
|
||||
{name: 'SCOPENAME', index: 'SCOPENAME', width: 100, align: 'center'},
|
||||
{name: 'APIFULLPATH', index: 'APIFULLPATH', width: 100, align: 'left'},
|
||||
{name: 'BZWKSVCKEYNAME', index: 'BZWKSVCKEYNAME', width: 100, align: 'left'}
|
||||
],
|
||||
rowNum: 30,
|
||||
rowList: [10, 20, 30],
|
||||
pager: '#selectedApiGridPager',
|
||||
sortname: 'apiId',
|
||||
viewrecords: true,
|
||||
sortorder: "asc",
|
||||
caption: "선택된 API",
|
||||
height: 200,
|
||||
autowidth: true,
|
||||
multiselect: true,
|
||||
ondblClickRow: function (rowid, status, e) {
|
||||
// selectedApiGrid.jqGrid('delRowData', rowid);
|
||||
}
|
||||
});
|
||||
|
||||
mappingInfo(key); // SCOPE ID의 매핑정보 (AJAX 호출)
|
||||
|
||||
// callback이 함수인지 확인 후 호출 (안전장치)
|
||||
if (typeof callback === 'function') {
|
||||
callback(key);
|
||||
}
|
||||
}
|
||||
|
||||
function saveApiGridData(scopeId, returnUrl) {
|
||||
var postData = [];
|
||||
var rows = $("#selectedApiGrid").jqGrid('getRowData');
|
||||
|
||||
$.each(rows, function(index, item) {
|
||||
item.scopeId = scopeId;
|
||||
});
|
||||
|
||||
postData.push({
|
||||
name: "apiList",
|
||||
value: JSON.stringify(rows)
|
||||
});
|
||||
|
||||
postData.push({ name: "cmd" , value:"INSERT_APILIST" });
|
||||
postData.push({ name: "scopeId" , value:scopeId });
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:mapping_url,
|
||||
data: postData,
|
||||
success:function(args){
|
||||
alert("저장 되었습니다.");
|
||||
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@@ -85,8 +185,10 @@ $(document).ready(function() {
|
||||
url:url,
|
||||
data:postData,
|
||||
success:function(args){
|
||||
alert("저장 되었습니다.");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
alert("SCOPE 정보가 저장 되었습니다. 이어서 API 리스트를 저장합니다.");
|
||||
|
||||
saveApiGridData(key, returnUrl); // API LIST 저장.
|
||||
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
@@ -121,8 +223,65 @@ $(document).ready(function() {
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
});
|
||||
|
||||
$("#btn_popup_api").click(function () {
|
||||
const args = {};
|
||||
const url2 = api_url_view += "?cmd=POPUP";
|
||||
showModal(url2, args, 1280, 860, function () {
|
||||
const popupFrame = args.self.frames[0];
|
||||
const returnValue = popupFrame.returnValue;
|
||||
const frameElement = popupFrame.frameElement
|
||||
const parentElement = frameElement.parentNode; // 부모 노드를 가져옴
|
||||
|
||||
if (parentElement) { // 부모 노드가 존재하는지 확인
|
||||
parentElement.removeChild(frameElement);
|
||||
}
|
||||
|
||||
var rows = $("#selectedApiGrid").jqGrid('getRowData');
|
||||
|
||||
var existingApiIds = new Set(rows.map(function(row) {
|
||||
return String(row.apiId);
|
||||
}));
|
||||
|
||||
var newItems = Array.isArray(returnValue) ? returnValue : [returnValue];
|
||||
|
||||
var ids = $("#selectedApiGrid").jqGrid('getDataIDs');
|
||||
var currentIdSeq = ids.length > 0 ? Math.max(...ids.map(Number)) : 0;
|
||||
|
||||
$.each(newItems, function(index, item) {
|
||||
var checkId = String(item.apiId);
|
||||
|
||||
if (!existingApiIds.has(checkId)) {
|
||||
currentIdSeq++;
|
||||
$("#selectedApiGrid").jqGrid('addRowData', currentIdSeq, item, "last");
|
||||
|
||||
existingApiIds.add(checkId);
|
||||
} else {
|
||||
//console.log("중복 제외됨: " + item.apiId);
|
||||
}
|
||||
});
|
||||
|
||||
alert("중복건 수를 제외한 API가 추가되었습니다.");
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_delete_api").click(function () {
|
||||
var grid = $("#selectedApiGrid");
|
||||
var selectedRowIds = grid.jqGrid('getGridParam', 'selarrrow'); // 선택된 행의 ID 배열을 가져옴
|
||||
if (selectedRowIds.length > 0) {
|
||||
// 선택된 행의 ID를 복사한 배열을 사용
|
||||
var idsToDelete = selectedRowIds.slice();
|
||||
|
||||
for (var i = 0; i < idsToDelete.length; i++) {
|
||||
grid.jqGrid('delRowData', idsToDelete[i]); // 선택된 각 행을 삭제
|
||||
}
|
||||
} else {
|
||||
alert("Please select at least one row to delete.");
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl(isDetail);
|
||||
titleControl(isDetail);
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -161,7 +320,25 @@ $(document).ready(function() {
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<!-- API ID / API Full Path 추가 -->
|
||||
<div style="font-size:0;">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px ">
|
||||
<div class="table_row_title" style="margin-bottom: 0px">API</div>
|
||||
<div style="text-align: end;">
|
||||
<button type="button" class="cssbtn" id="btn_delete_api" level="W" status="DETAIL,NEW">
|
||||
<i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %>
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_popup_api" level="W" status="DETAIL,NEW">
|
||||
<i class="material-icons">add</i> API <%= localeMessage.getString("button.add") %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:inline-block; width:calc(100%); vertical-align:top;">
|
||||
<div id="selectedApiList" style="margin-top:10px;">
|
||||
<table id="selectedApiGrid"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
|
||||
@@ -27,9 +27,11 @@
|
||||
for(var i = 0; i < selectedRowIds.length; i++) {
|
||||
var rowData = grid.jqGrid('getRowData', selectedRowIds[i]);
|
||||
selectedData.push({
|
||||
bizCode: rowData.eaiBzwkDstcd,
|
||||
bizCode: rowData.eaiBzwkDstcd, // CLINET
|
||||
apiId: rowData.eaiSvcName,
|
||||
apiDesc: rowData.eaiSvcDesc
|
||||
apiDesc: rowData.eaiSvcDesc, // SCOPE-API
|
||||
APIFULLPATH: rowData.apiFullPath,
|
||||
BZWKSVCKEYNAME: rowData.bzwksvckeyname
|
||||
});
|
||||
}
|
||||
|
||||
@@ -108,6 +110,7 @@
|
||||
'API ID',
|
||||
'API 명',
|
||||
'API FULL PATH',
|
||||
'업무서비스명',
|
||||
'요청',
|
||||
'응답',
|
||||
'작성자',
|
||||
@@ -117,12 +120,13 @@
|
||||
colModel : [ { name : 'eaiBzwkDstcd' , align : 'center' , width:'40', sortable:false},
|
||||
{ name : 'eaiSvcName' , align : 'left' , width:'100'},
|
||||
{ name : 'eaiSvcDesc' , align : 'left' },
|
||||
{ name : 'apiFullPath' , align : 'left' , width:'180'},
|
||||
{ name : 'apiFullPath' , align : 'left' , width:'100'},
|
||||
{ name : 'bzwksvckeyname' , align : 'left' , width:'100', hidden: true},
|
||||
{ name : 'fromAdapter' , align : 'center' , width:'40', formatter:adapterNameShortFormatter },
|
||||
{ name : 'toAdapter' , align : 'center' , width:'40', formatter:adapterNameShortFormatter },
|
||||
{ name : 'author' , align : 'center' , width:'60' },
|
||||
{ name : 'simYn' , align : 'center' , width:'40' },
|
||||
{ name : 'syncAsyncType' , align : 'center' , width:'40', hidden: true },
|
||||
{ name : 'syncAsyncType' , align : 'center' , width:'40', hidden: true},
|
||||
],
|
||||
jsonReader : {
|
||||
repeatitems : false
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
@@ -512,6 +512,9 @@
|
||||
$("#toResponseAdapter").change();
|
||||
|
||||
$("#apiFullPath").val(data["apiFullPath"]); // 스펙 전달용 값
|
||||
|
||||
$('#inboundHttpMethod').trigger('change');
|
||||
$('#outboundHttpMethod').trigger('change');
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
@@ -831,10 +834,19 @@
|
||||
$("input[name=bzwkSvcKeyName]").val($("input[name=eaiTranName]").val());
|
||||
}
|
||||
|
||||
// 사용자 편의를 위해 inboundRestPath 앞에 "/" 는 제외함.
|
||||
// 사용자 편의를 위해 Path 앞에 "/" 는 제외, 복제도 포함.
|
||||
$("input[name=inboundRestPath]").val(function(index, value) {
|
||||
return value.replace(/^\/+/, "");
|
||||
});
|
||||
$("input[name=inboundResponseRestPath]").val(function(index, value) {
|
||||
return value.replace(/^\/+/, "");
|
||||
});
|
||||
$("input[name=outboundRestPath]").val(function(index, value) {
|
||||
return value.replace(/^\/+/, "");
|
||||
});
|
||||
$("input[name=outboundResponseRestPath]").val(function(index, value) {
|
||||
return value.replace(/^\/+/, "");
|
||||
});
|
||||
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
if (isDetail){
|
||||
@@ -1232,7 +1244,15 @@
|
||||
$('#stdCommonValueModal').modal('hide');
|
||||
});
|
||||
|
||||
function setupCloneInterfaceModal() {
|
||||
function setupCloneInterfaceModal(event) {
|
||||
const eaiBzwkDstcd = $('#eaiBzwkDstcd').val();
|
||||
const eaiSvcDesc = $('#eaiSvcDesc').val();
|
||||
const inboundHttpMethod = $('#inboundHttpMethod').val();
|
||||
|
||||
$('#newBizCode').val(eaiBzwkDstcd).trigger('change');
|
||||
$('#newSvcDesc').val(eaiSvcDesc);
|
||||
$('#newInboundHttpMethod').val(inboundHttpMethod).trigger('change');
|
||||
|
||||
$('#newSvcName').val('');
|
||||
if($('#inboundRestPath').prop('disabled')){
|
||||
$('#newRoutingOptionGroup').css('display','none');
|
||||
@@ -1245,11 +1265,19 @@
|
||||
const orgApiInterfaceId = getFullSvcName();
|
||||
const newBizCode = $('#newBizCode').val();
|
||||
const newSvcName = $('#newSvcName').val();
|
||||
const newSvcDesc = $('#newSvcDesc').val();
|
||||
const newSendRecvType = $('#newSendRecvType').val();
|
||||
const newInOutType = $('#newInOutType').val();
|
||||
const newApiInterfaceId = newSvcName+newSendRecvType+newInOutType;
|
||||
const newInboundHttpMethod = $('#newInboundHttpMethod').val();
|
||||
|
||||
$("input[name=newInboundRestPath]").val(function(index, value) {
|
||||
return value.replace(/^\/+/, "");
|
||||
});
|
||||
|
||||
const newInboundRestPath = $('#newInboundRestPath').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: jsonUrl,
|
||||
@@ -1257,12 +1285,13 @@
|
||||
cmd: 'CLONE',
|
||||
orgApiInterfaceId,
|
||||
newBizCode,
|
||||
newSvcDesc,
|
||||
newApiInterfaceId,
|
||||
newInboundHttpMethod,
|
||||
newInboundRestPath,
|
||||
},
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("[id=doCloneInterfaceButton]").prop("disabled", true);
|
||||
$("#doCloneInterfaceButton").text("처리중 . . . . .");
|
||||
},
|
||||
success: function () {
|
||||
@@ -1986,7 +2015,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="cloneInterfaceModal" tabindex="-1" role="dialog" aria-labelledby=cloneInterfaceModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-dialog modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="cloneInterfaceModalLabel">API 인터페이스 복제</h5>
|
||||
@@ -2000,12 +2029,12 @@
|
||||
<fieldset class="groupbox-border" style="margin-top:0px !important">
|
||||
<legend class="groupbox-border">BASIC</legend>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-2">
|
||||
<label for="newBizCode"><span class="material-icons-outlined">work</span> 업무구분</label>
|
||||
<select id="newBizCode" class="form-select" name="newBizCode" style="width: 100%">
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-8">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="newSvcName"><span class="material-icons-outlined">badge</span> API ID</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="newSvcName" name="newSvcName" required>
|
||||
@@ -2017,6 +2046,12 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="newSvcDesc"><span class="material-icons-outlined">badge</span> API 명</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="newSvcDesc" name="newSvcDesc">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset id="newRoutingOptionGroup" class="groupbox-border">
|
||||
@@ -2049,4 +2084,11 @@
|
||||
</div>
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>loneInterfaceButton">복제</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -98,7 +98,6 @@
|
||||
|
||||
function detail(key) {
|
||||
// console.log('Before AJAX call, key:', key); // Log the key before the AJAX call
|
||||
debugger;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
|
||||
+22
-19
@@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.http.converter.StringHttpMessageConverter;
|
||||
import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
@@ -25,6 +26,7 @@ public class EmptyJsonResponseAdviceController implements ResponseBodyAdvice<Obj
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(EmptyJsonResponseAdviceController.class);
|
||||
private static final Map<String, Object> EMPTY_JSON = Collections.emptyMap();
|
||||
private static final String EMPTY_JSON_STRING = "{}";
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
@@ -42,24 +44,25 @@ public class EmptyJsonResponseAdviceController implements ResponseBodyAdvice<Obj
|
||||
Class<? extends HttpMessageConverter<?>> selectedConverterType, ServerHttpRequest request,
|
||||
ServerHttpResponse response) {
|
||||
|
||||
// .json 요청이 아니면 원본 그대로 반환
|
||||
String path = request.getURI().getPath();
|
||||
if (path == null || !path.endsWith(".json")) {
|
||||
return body;
|
||||
}
|
||||
|
||||
// 빈 응답인 경우 빈 JSON 객체로 변환
|
||||
if (body == null) {
|
||||
logger.debug("빈 응답 감지 (null), {} 로 변환: {}", path);
|
||||
return EMPTY_JSON;
|
||||
}
|
||||
|
||||
// String 타입의 빈 응답 처리
|
||||
if (body instanceof String && ((String) body).isEmpty()) {
|
||||
logger.debug("빈 응답 감지 (empty string), {} 로 변환: {}", path);
|
||||
return EMPTY_JSON;
|
||||
}
|
||||
|
||||
return body;
|
||||
String path = request.getURI().getPath();
|
||||
|
||||
// .json 요청이 아니면 원본 그대로 반환
|
||||
if (path == null || !path.endsWith(".json")) {
|
||||
return body;
|
||||
}
|
||||
|
||||
// 정상적인 응답이 있는 경우, String 타입의 빈 응답 처리
|
||||
if (body != null && !(body instanceof String && ((String) body).isEmpty())) {
|
||||
return body;
|
||||
}
|
||||
|
||||
// Controller 리턴타입이 String 일 때 cannot be cast 에러 대응
|
||||
logger.debug("빈 응답 감지, {} 로 변환 시도. 선택된 컨버터: {}", path, selectedConverterType.getSimpleName());
|
||||
|
||||
if (StringHttpMessageConverter.class.isAssignableFrom(selectedConverterType)) {
|
||||
return EMPTY_JSON_STRING; // 문자열 "{}" 반환
|
||||
}
|
||||
|
||||
return EMPTY_JSON; // Map 객체 반환
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ import lombok.Data;
|
||||
@AllArgsConstructor
|
||||
public class ApiScopeDto {
|
||||
|
||||
@JsonProperty("EAISVCNAME")
|
||||
private String eaiSvcName;
|
||||
|
||||
@JsonProperty("EAISVCDESC")
|
||||
private String eaiSvcDesc;
|
||||
|
||||
@@ -20,5 +23,8 @@ public class ApiScopeDto {
|
||||
|
||||
@JsonProperty("SCOPENAME")
|
||||
private String scopeName;
|
||||
|
||||
@JsonProperty("APIFULLPATH")
|
||||
private String apiFullPath;
|
||||
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ public class EAIMessageService extends AbstractDataService<EAIMessageEntity, Str
|
||||
, qServiceMessageEntity.psvsysadptrbzwkgroupname
|
||||
, qRouting.nonmotivrouturiname
|
||||
, qStdInfo.apifullpath
|
||||
, qStdInfo.bzwksvckeyname
|
||||
|
||||
)
|
||||
.limit(pageable.getPageSize())
|
||||
.offset(pageable.getOffset())
|
||||
@@ -111,6 +113,7 @@ public class EAIMessageService extends AbstractDataService<EAIMessageEntity, Str
|
||||
, qServiceMessageEntity.psvintfacdsticname
|
||||
, qRouting.nonmotivrouturiname
|
||||
, qStdInfo.apifullpath
|
||||
, qStdInfo.bzwksvckeyname
|
||||
)
|
||||
.from(qeaiMessageEntity)
|
||||
.join(qRouting)
|
||||
@@ -290,10 +293,14 @@ public class EAIMessageService extends AbstractDataService<EAIMessageEntity, Str
|
||||
|
||||
List<ApiScopeDto> result = getJPAQueryFactory()
|
||||
.select(Projections.constructor(ApiScopeDto.class ,
|
||||
qEaiMessageEntity.eaisvcname ,
|
||||
qEaiMessageEntity.eaisvcdesc ,
|
||||
qScopeEntity.id.scopeid ,
|
||||
qScopeEntity.id.bzwksvckeyname ,
|
||||
qScopeInfo.scopeName ))
|
||||
qScopeInfo.scopeName ,
|
||||
qStandardMessageInfo.apifullpath
|
||||
)
|
||||
)
|
||||
.from(qEaiMessageEntity)
|
||||
.join(qStandardMessageInfo)
|
||||
.on(qEaiMessageEntity.eaisvcname.eq(qStandardMessageInfo.eaisvcname))
|
||||
@@ -313,19 +320,20 @@ public class EAIMessageService extends AbstractDataService<EAIMessageEntity, Str
|
||||
private BooleanExpression booleanPredicate(QEAIMessageEntity qEaiMessageEntity, QScopeEntity qScopeEntity,
|
||||
QScopeInfo qScopeInfo, ApiScopeSearch apiScopeSearch) {
|
||||
|
||||
BooleanExpression predicate = qEaiMessageEntity.eaisvcdesc.containsIgnoreCase(apiScopeSearch.getSearchEaiSvcDesc());
|
||||
BooleanExpression predicate = qScopeEntity.id.scopeid.containsIgnoreCase(apiScopeSearch.getSearchScopeId());
|
||||
// BooleanExpression predicate = qEaiMessageEntity.eaisvcdesc.containsIgnoreCase(apiScopeSearch.getSearchEaiSvcDesc());
|
||||
|
||||
if(StringUtils.isNotBlank(apiScopeSearch.getSearchBzwkSvcKeyName())) {
|
||||
predicate = predicate.and(qScopeEntity.id.bzwksvckeyname.containsIgnoreCase(apiScopeSearch.getSearchBzwkSvcKeyName()));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(apiScopeSearch.getSearchScopeId())) {
|
||||
predicate = predicate.and(qScopeEntity.id.scopeid.containsIgnoreCase(apiScopeSearch.getSearchScopeId()));
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(apiScopeSearch.getSearchScopeName())) {
|
||||
predicate = predicate.and(qScopeInfo.scopeName.containsIgnoreCase(apiScopeSearch.getSearchScopeName()));
|
||||
}
|
||||
// if(StringUtils.isNotBlank(apiScopeSearch.getSearchBzwkSvcKeyName())) {
|
||||
// predicate = predicate.and(qScopeEntity.id.bzwksvckeyname.containsIgnoreCase(apiScopeSearch.getSearchBzwkSvcKeyName()));
|
||||
// }
|
||||
//
|
||||
// if(StringUtils.isNotBlank(apiScopeSearch.getSearchScopeId())) {
|
||||
// predicate = predicate.and(qScopeEntity.id.scopeid.containsIgnoreCase(apiScopeSearch.getSearchScopeId()));
|
||||
// }
|
||||
//
|
||||
// if(StringUtils.isNotBlank(apiScopeSearch.getSearchScopeName())) {
|
||||
// predicate = predicate.and(qScopeInfo.scopeName.containsIgnoreCase(apiScopeSearch.getSearchScopeName()));
|
||||
// }
|
||||
|
||||
return predicate;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,15 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.eactive.eai.agent.authserver.ReloadApiScopeCommand;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
import com.eactive.eai.rms.common.base.OnlBaseAnnotationController;
|
||||
import com.eactive.eai.rms.common.vo.GridResponse;
|
||||
import com.eactive.eai.rms.data.entity.onl.eaimsg.ApiScopeSearch;
|
||||
import com.eactive.eai.rms.onl.common.exception.BizException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -11,6 +20,7 @@ import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import com.eactive.eai.agent.authserver.ReloadApiScopeCommand;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
@@ -53,6 +63,25 @@ public class ApiScopeController extends OnlBaseAnnotationController {
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/admin/authserver/apiScopeMan.json", params = "cmd=INSERT_APILIST")
|
||||
public ResponseEntity<Void> insertApiScopeList(@RequestParam("apiList") String apiListJson, @RequestParam("scopeId") String scopeId) {
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
List<ApiScopeUI> apiScopeList = null;
|
||||
|
||||
try {
|
||||
apiScopeList = mapper.readValue(apiListJson, new TypeReference<List<ApiScopeUI>>(){});
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new BizException("데이터 변환 중 오류가 발생했습니다.");
|
||||
}
|
||||
|
||||
apiScopeManService.insertApiScopeRelationList(apiScopeList, scopeId);
|
||||
|
||||
return ResponseEntity.ok().build();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value = "/onl/admin/authserver/apiScopeMan.json", params = "cmd=DELETE")
|
||||
public ResponseEntity<Void> deleteApiScope(ApiScopeUI apiScopeUI) {
|
||||
apiScopeManService.deleteApiScopeRelation(apiScopeUI);
|
||||
|
||||
+31
-1
@@ -11,6 +11,8 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.eactive.eai.agent.authserver.ReloadApiScopeCommand;
|
||||
import com.eactive.eai.agent.command.CommonCommand;
|
||||
import com.eactive.eai.rms.common.base.OnlBaseService;
|
||||
import com.eactive.eai.rms.common.spring.LocaleMessage;
|
||||
import com.eactive.eai.rms.data.entity.onl.authserver.ScopeEntityService;
|
||||
@@ -56,10 +58,12 @@ public class ApiScopeManService extends OnlBaseService {
|
||||
|
||||
private ApiScopeUI convertToApiScopeUI(ApiScopeDto dto) {
|
||||
ApiScopeUI apiScopeUI = new ApiScopeUI();
|
||||
apiScopeUI.setEaiSvcDesc(dto.getEaiSvcDesc());
|
||||
apiScopeUI.setApiDesc(dto.getEaiSvcDesc());
|
||||
apiScopeUI.setScopeId(dto.getScopeId());
|
||||
apiScopeUI.setBzwkSvcKeyName(dto.getBzwkSvcKeyName());
|
||||
apiScopeUI.setScopeName(dto.getScopeName());
|
||||
apiScopeUI.setApiFullPath(dto.getApiFullPath());
|
||||
apiScopeUI.setApiId(dto.getEaiSvcName());
|
||||
return apiScopeUI;
|
||||
}
|
||||
|
||||
@@ -72,6 +76,32 @@ public class ApiScopeManService extends OnlBaseService {
|
||||
scopeEntityService.save(apiScopeUIMapper.toEntity(apiScopeUI));
|
||||
}
|
||||
|
||||
public void insertApiScopeRelationList(List<ApiScopeUI> apiScopeList, String scopeId) {
|
||||
// ScopeId 기준 전체 삭제 후 LIST 기준으로 저장.
|
||||
if(scopeId == null || scopeId.isEmpty()) {
|
||||
throw new BizException("ScopeId 가 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
scopeEntityService.deleteByIdScopeId(scopeId);
|
||||
|
||||
if(apiScopeList == null || apiScopeList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ApiScopeUI ui : apiScopeList) {
|
||||
ui.setScopeId(scopeId);
|
||||
|
||||
scopeEntityService.save(apiScopeUIMapper.toEntity(ui));
|
||||
|
||||
CommonCommand.builder()
|
||||
.name(CommonCommand.RELOAD_API_SCOPE_COMMAND)
|
||||
.args(new String[] {ReloadApiScopeCommand.COMMAND_TYPE_API_SCOPE,
|
||||
ui.getBzwkSvcKeyName(), ui.getScopeId()})
|
||||
.build()
|
||||
.broadcast(agentUtilService);
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteApiScopeRelation(ApiScopeUI apiScopeUI) {
|
||||
scopeEntityService.deleteById(apiScopeUIMapper.toId(apiScopeUI));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.eactive.eai.rms.onl.manage.authserver.scope;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor // jackson 사용을 위해 추가.
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ApiScopeUI {
|
||||
|
||||
@JsonProperty("SCOPEID")
|
||||
@@ -16,7 +20,13 @@ public class ApiScopeUI {
|
||||
@JsonProperty("SCOPENAME")
|
||||
private String scopeName;
|
||||
|
||||
@JsonProperty("EAISVCDESC")
|
||||
private String eaiSvcDesc;
|
||||
@JsonProperty("apiDesc")
|
||||
private String apiDesc;
|
||||
|
||||
@JsonProperty("APIFULLPATH")
|
||||
private String apiFullPath;
|
||||
|
||||
@JsonProperty("apiId")
|
||||
private String apiId;
|
||||
|
||||
}
|
||||
|
||||
@@ -271,10 +271,12 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
|
||||
}
|
||||
|
||||
@PostMapping(value = "/onl/transaction/apim/apiInterfaceMan.json", params = "cmd=CLONE")
|
||||
public ResponseEntity<?> cloneApiInterface(String orgApiInterfaceId, String newBizCode, String newApiInterfaceId, String newInboundHttpMethod, String newInboundRestPath, boolean importDupliCheck) throws BizException {
|
||||
public ResponseEntity<?> cloneApiInterface(String orgApiInterfaceId, String newBizCode,
|
||||
String newApiInterfaceId, String newInboundHttpMethod,
|
||||
String newInboundRestPath, String newSvcDesc, boolean importDupliCheck) throws BizException {
|
||||
try {
|
||||
ApiInterfaceUI orgApiInterfaceUI = service.selectDetail(orgApiInterfaceId);
|
||||
ApiInterfaceUI apiInterfaceUI = service.cloneApiInterface(orgApiInterfaceUI, newBizCode, newApiInterfaceId, newInboundHttpMethod, newInboundRestPath, importDupliCheck);
|
||||
ApiInterfaceUI apiInterfaceUI = service.cloneApiInterface(orgApiInterfaceUI, newBizCode, newApiInterfaceId, newInboundHttpMethod, newInboundRestPath, newSvcDesc, importDupliCheck);
|
||||
Map<String, Object> resultMap = reloadSync(apiInterfaceUI);
|
||||
return ResponseEntity.ok(resultMap);
|
||||
} catch(Exception e) {
|
||||
|
||||
@@ -139,6 +139,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
EAIMessageEntity eaiMessageEntity = tuple.get(QEAIMessageEntity.eAIMessageEntity);
|
||||
|
||||
String apiFullPath = tuple.get(QStandardMessageInfo.standardMessageInfo.apifullpath);
|
||||
String bzwksvckeyname = tuple.get(QStandardMessageInfo.standardMessageInfo.bzwksvckeyname);
|
||||
|
||||
ApiInterfaceUI apiInterfaceUI;
|
||||
if (eaiMessageEntity.getServiceMessages() != null && eaiMessageEntity.getServiceMessages().size() > 0) {
|
||||
@@ -148,6 +149,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
}
|
||||
|
||||
apiInterfaceUI.setApiFullPath(apiFullPath);
|
||||
apiInterfaceUI.setBzwksvckeyname(bzwksvckeyname);
|
||||
|
||||
return apiInterfaceUI;
|
||||
});
|
||||
@@ -1159,7 +1161,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
|
||||
public ApiInterfaceUI cloneApiInterface(ApiInterfaceUI orgApiInterfaceUI, String newBizCd,
|
||||
String newApiInterfaceId, String newInboundHttpMethod,
|
||||
String newInboundRestPath, boolean importDupliCheck) throws Exception {
|
||||
String newInboundRestPath, String newSvcDesc, boolean importDupliCheck) throws Exception {
|
||||
|
||||
Optional<EAIMessageEntity> optional = eaiMessageQueryService.findById(newApiInterfaceId);
|
||||
if (optional.isPresent()) {
|
||||
@@ -1173,6 +1175,7 @@ public class ApiInterfaceService extends OnlBaseService {
|
||||
apiInterfaceUI.setEaiBzwkDstcd(newBizCd);
|
||||
settingInterfaceId(apiInterfaceUI, newApiInterfaceId);
|
||||
apiInterfaceUI.setEaiSvcName(newApiInterfaceId);
|
||||
apiInterfaceUI.setEaiSvcDesc(newSvcDesc);
|
||||
apiInterfaceUI.setInboundHttpMethod(newInboundHttpMethod);
|
||||
apiInterfaceUI.setInboundRestPath(newInboundRestPath);
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ public class ApiInterfaceUI {
|
||||
private List<StdMessageItemUI> inboundResponseStandardMessageItems ;
|
||||
|
||||
private String apiFullPath;
|
||||
private String bzwksvckeyname;
|
||||
|
||||
//ASYNC-SYNC 용
|
||||
private String inboundResponseHttpMethod;
|
||||
|
||||
Reference in New Issue
Block a user