API SPEC 신규일때 인터페이스 하면 값을 세팅

This commit is contained in:
daekuk
2025-12-11 16:33:04 +09:00
parent b4eba6dfde
commit 2f11e50e41
3 changed files with 47 additions and 1 deletions
@@ -510,6 +510,8 @@
$("#fromResponseAdapter").change();
$("#toResponseAdapter").change();
$("#apiFullPath").val(data["apiFullPath"]); // 스펙 전달용 값
},
error:function(e){
alert(e.responseText);
@@ -931,7 +933,16 @@
function showApiSpecPopup() {
var eaiSvcName = getFullSvcName();
var args = {title:'API 스펙 관리', parent: true};
var eaiSvcDesc = $('#eaiSvcDesc').val();
var apipath = $('#apiFullPath').val();
var contentType = $('#contentType').val();
var args = {
title:'API 스펙 관리',
parent: true,
apipath : apipath,
eaiSvcDesc : eaiSvcDesc,
contentType : contentType
};
var popupUrl = url_spec + '?cmd=DETAIL&eaiSvcName=' + encodeURIComponent(eaiSvcName);
showModal(popupUrl, args, 1200, 800);
}
@@ -1503,6 +1514,7 @@
<label class="btn btn-outline-primary" for="btnTypeOutword"><i class="bi bi-arrow-left-circle"></i> 타발</label>
</div>
</div>
<input type="hidden" id="apiFullPath" value="">
</div>
</fieldset>
</div>
@@ -36,6 +36,7 @@
} else {
buttonControl(false);
}
initializeCodeMirror();
initializeSummernote();
}
@@ -97,6 +98,7 @@
function detail(key) {
// console.log('Before AJAX call, key:', key); // Log the key before the AJAX call
debugger;
$.ajax({
type: "POST",
url: url,
@@ -150,6 +152,37 @@
// console.log('After setting apiId, key:', key); // Log the key after setting apiId
buttonControl(true);
// 조회된 Spec 데이터가 없다면 인터페이스 화면의 값을 세팅함.
if (!data.apiId) {
var args = window.dialogArguments;
if (args && args.apipath) {
// HS04 의 fullpath 메서드/URL로 분리
var rawString = args.apipath;
var parts = rawString.split('|');
var method = parts[0].trim();
var url = parts[1].trim();
if ($('#apiName').val() === "" && args.eaiSvcDesc) {
$('#apiName').val(args.eaiSvcDesc);
}
if ($('#apiUrl').val() === "" && url) {
$('#apiUrl').val(url);
}
if (method) {
$('#apiMethod').val(method);
}
if ($('#apiContentType').val() === "" && args.contentType) {
$('#apiContentType').val(method);
}
}
}
},
error: function (e) {
console.error('AJAX error:', e); // Log any errors
@@ -248,6 +248,7 @@ public class ApiInterfaceService extends OnlBaseService {
String stdKey = stdMessageUI.getBzwkSvcKeyName();
String inboundRestPath = StringUtils.substringAfter(stdKey, STEMSG_SERVICE_URL_DELIMITER);
apiInterfaceUI.setInboundRestPath(inboundRestPath);
apiInterfaceUI.setApiFullPath(standardMessageInfo.getApifullpath());
apiInterfaceUI.setStandardMessageItems(stdMessageUI.getStandardMessageItems());