api 복제 api명 추가, 팝업 열 때 부모값 가져와서 세팅, spce의 debugger 삭제, 모든 path에 '/' 시작시

replce 시키는 기능 추가
This commit is contained in:
daekuk
2025-12-16 09:28:43 +09:00
parent c3f348d84e
commit e929a51e0a
4 changed files with 44 additions and 10 deletions
@@ -834,10 +834,19 @@
$("input[name=bzwkSvcKeyName]").val($("input[name=eaiTranName]").val()); $("input[name=bzwkSvcKeyName]").val($("input[name=eaiTranName]").val());
} }
// 사용자 편의를 위해 inboundRestPath 앞에 "/" 는 제외함. // 사용자 편의를 위해 Path 앞에 "/" 는 제외, 복제도 포함.
$("input[name=inboundRestPath]").val(function(index, value) { $("input[name=inboundRestPath]").val(function(index, value) {
return value.replace(/^\/+/, ""); 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(); var postData = $('#ajaxForm').serializeArray();
if (isDetail){ if (isDetail){
@@ -1235,7 +1244,15 @@
$('#stdCommonValueModal').modal('hide'); $('#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(''); $('#newSvcName').val('');
if($('#inboundRestPath').prop('disabled')){ if($('#inboundRestPath').prop('disabled')){
$('#newRoutingOptionGroup').css('display','none'); $('#newRoutingOptionGroup').css('display','none');
@@ -1248,11 +1265,19 @@
const orgApiInterfaceId = getFullSvcName(); const orgApiInterfaceId = getFullSvcName();
const newBizCode = $('#newBizCode').val(); const newBizCode = $('#newBizCode').val();
const newSvcName = $('#newSvcName').val(); const newSvcName = $('#newSvcName').val();
const newSvcDesc = $('#newSvcDesc').val();
const newSendRecvType = $('#newSendRecvType').val(); const newSendRecvType = $('#newSendRecvType').val();
const newInOutType = $('#newInOutType').val(); const newInOutType = $('#newInOutType').val();
const newApiInterfaceId = newSvcName+newSendRecvType+newInOutType; const newApiInterfaceId = newSvcName+newSendRecvType+newInOutType;
const newInboundHttpMethod = $('#newInboundHttpMethod').val(); const newInboundHttpMethod = $('#newInboundHttpMethod').val();
$("input[name=newInboundRestPath]").val(function(index, value) {
return value.replace(/^\/+/, "");
});
const newInboundRestPath = $('#newInboundRestPath').val(); const newInboundRestPath = $('#newInboundRestPath').val();
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: jsonUrl, url: jsonUrl,
@@ -1260,12 +1285,13 @@
cmd: 'CLONE', cmd: 'CLONE',
orgApiInterfaceId, orgApiInterfaceId,
newBizCode, newBizCode,
newSvcDesc,
newApiInterfaceId, newApiInterfaceId,
newInboundHttpMethod, newInboundHttpMethod,
newInboundRestPath, newInboundRestPath,
}, },
beforeSend: function() { beforeSend: function() {
$("[id^='btn_']").prop("disabled", true); $("[id=doCloneInterfaceButton]").prop("disabled", true);
$("#doCloneInterfaceButton").text("처리중 . . . . ."); $("#doCloneInterfaceButton").text("처리중 . . . . .");
}, },
success: function () { success: function () {
@@ -1989,7 +2015,7 @@
</div> </div>
</div> </div>
<div class="modal fade" id="cloneInterfaceModal" tabindex="-1" role="dialog" aria-labelledby=cloneInterfaceModalLabel" aria-hidden="true"> <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-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="cloneInterfaceModalLabel">API 인터페이스 복제</h5> <h5 class="modal-title" id="cloneInterfaceModalLabel">API 인터페이스 복제</h5>
@@ -2003,12 +2029,12 @@
<fieldset class="groupbox-border" style="margin-top:0px !important"> <fieldset class="groupbox-border" style="margin-top:0px !important">
<legend class="groupbox-border">BASIC</legend> <legend class="groupbox-border">BASIC</legend>
<div class="row"> <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> <label for="newBizCode"><span class="material-icons-outlined">work</span> 업무구분</label>
<select id="newBizCode" class="form-select" name="newBizCode" style="width: 100%"> <select id="newBizCode" class="form-select" name="newBizCode" style="width: 100%">
</select> </select>
</div> </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> <label for="newSvcName"><span class="material-icons-outlined">badge</span> API ID</label>
<div class="input-group"> <div class="input-group">
<input type="text" class="form-control" id="newSvcName" name="newSvcName" required> <input type="text" class="form-control" id="newSvcName" name="newSvcName" required>
@@ -2020,6 +2046,12 @@
</span> </span>
</div> </div>
</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> </div>
</fieldset> </fieldset>
<fieldset id="newRoutingOptionGroup" class="groupbox-border"> <fieldset id="newRoutingOptionGroup" class="groupbox-border">
@@ -98,7 +98,6 @@
function detail(key) { function detail(key) {
// console.log('Before AJAX call, key:', key); // Log the key before the AJAX call // console.log('Before AJAX call, key:', key); // Log the key before the AJAX call
debugger;
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: url, url: url,
@@ -271,10 +271,12 @@ public class ApiInterfaceController extends OnlBaseAnnotationController {
} }
@PostMapping(value = "/onl/transaction/apim/apiInterfaceMan.json", params = "cmd=CLONE") @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 { try {
ApiInterfaceUI orgApiInterfaceUI = service.selectDetail(orgApiInterfaceId); 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); Map<String, Object> resultMap = reloadSync(apiInterfaceUI);
return ResponseEntity.ok(resultMap); return ResponseEntity.ok(resultMap);
} catch(Exception e) { } catch(Exception e) {
@@ -1159,7 +1159,7 @@ public class ApiInterfaceService extends OnlBaseService {
public ApiInterfaceUI cloneApiInterface(ApiInterfaceUI orgApiInterfaceUI, String newBizCd, public ApiInterfaceUI cloneApiInterface(ApiInterfaceUI orgApiInterfaceUI, String newBizCd,
String newApiInterfaceId, String newInboundHttpMethod, String newApiInterfaceId, String newInboundHttpMethod,
String newInboundRestPath, boolean importDupliCheck) throws Exception { String newInboundRestPath, String newSvcDesc, boolean importDupliCheck) throws Exception {
Optional<EAIMessageEntity> optional = eaiMessageQueryService.findById(newApiInterfaceId); Optional<EAIMessageEntity> optional = eaiMessageQueryService.findById(newApiInterfaceId);
if (optional.isPresent()) { if (optional.isPresent()) {
@@ -1173,6 +1173,7 @@ public class ApiInterfaceService extends OnlBaseService {
apiInterfaceUI.setEaiBzwkDstcd(newBizCd); apiInterfaceUI.setEaiBzwkDstcd(newBizCd);
settingInterfaceId(apiInterfaceUI, newApiInterfaceId); settingInterfaceId(apiInterfaceUI, newApiInterfaceId);
apiInterfaceUI.setEaiSvcName(newApiInterfaceId); apiInterfaceUI.setEaiSvcName(newApiInterfaceId);
apiInterfaceUI.setEaiSvcDesc(newSvcDesc);
apiInterfaceUI.setInboundHttpMethod(newInboundHttpMethod); apiInterfaceUI.setInboundHttpMethod(newInboundHttpMethod);
apiInterfaceUI.setInboundRestPath(newInboundRestPath); apiInterfaceUI.setInboundRestPath(newInboundRestPath);