DB 컬럼 마이그레이션 추가 및 API 요청 저장 처리 수정
This commit is contained in:
+4
@@ -37,6 +37,10 @@ public class ApiRequestMigrationService {
|
|||||||
try (Statement statement = connection.createStatement()) {
|
try (Statement statement = connection.createStatement()) {
|
||||||
statement.execute(sql2);
|
statement.execute(sql2);
|
||||||
}
|
}
|
||||||
|
String sql3 = String.format("ALTER TABLE %s ALTER COLUMN %s %s;", "API_REQUEST_INFO", "REQUEST_BODY", "CLOB");
|
||||||
|
try (Statement statement = connection.createStatement()) {
|
||||||
|
statement.execute(sql3);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -366,7 +366,7 @@ class APITester {
|
|||||||
|
|
||||||
showCollectionDeleteModal(event) {
|
showCollectionDeleteModal(event) {
|
||||||
const collectionId = $(event.currentTarget).closest('button').data('collection');
|
const collectionId = $(event.currentTarget).closest('button').data('collection');
|
||||||
$('#confirm_delete_modal').find('.confirm_delete').attr('data-id', collectionId);
|
$('#confirm_delete_modal').find('.confirm_delete').data('id', collectionId);
|
||||||
$('#confirm_delete_modal').modal('show');
|
$('#confirm_delete_modal').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,9 +394,9 @@ class APITester {
|
|||||||
showDeleteApiRequestModal(event) {
|
showDeleteApiRequestModal(event) {
|
||||||
let collectionId = $(event.currentTarget).closest('li').data('collection');
|
let collectionId = $(event.currentTarget).closest('li').data('collection');
|
||||||
let apiId = $(event.currentTarget).closest('li').data('id');
|
let apiId = $(event.currentTarget).closest('li').data('id');
|
||||||
|
console.log('apiId: ' + apiId);
|
||||||
$('#confirm_delete_api_modal').find('.confirm_delete_api').attr('data-id', apiId);
|
$('#confirm_delete_api_modal').find('.confirm_delete_api').data('id', apiId);
|
||||||
$('#confirm_delete_api_modal').find('.confirm_delete_api').attr('data-collection', collectionId);
|
$('#confirm_delete_api_modal').find('.confirm_delete_api').data('collection', collectionId);
|
||||||
$('#confirm_delete_api_modal').modal('show');
|
$('#confirm_delete_api_modal').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -893,7 +893,7 @@ class APITester {
|
|||||||
},
|
},
|
||||||
error: function (response, textStatus, errorThrown) {
|
error: function (response, textStatus, errorThrown) {
|
||||||
me.hideLoadingOverlay();
|
me.hideLoadingOverlay();
|
||||||
$('.toast-body').text(response.responseJSON);
|
$('.toast-body').text(response.responseJSON.error);
|
||||||
$('.toast').toast('show');
|
$('.toast').toast('show');
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
@@ -922,7 +922,7 @@ class APITester {
|
|||||||
},
|
},
|
||||||
error: function (response, textStatus, errorThrown) {
|
error: function (response, textStatus, errorThrown) {
|
||||||
me.hideLoadingOverlay();
|
me.hideLoadingOverlay();
|
||||||
$('.toast-body').text(response.responseJSON);
|
$('.toast-body').text(response.responseJSON.error);
|
||||||
$('.toast').toast('show');
|
$('.toast').toast('show');
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
@@ -964,6 +964,8 @@ class APITester {
|
|||||||
},
|
},
|
||||||
error: function (response, textStatus, errorThrown) {
|
error: function (response, textStatus, errorThrown) {
|
||||||
me.hideLoadingOverlay();
|
me.hideLoadingOverlay();
|
||||||
|
$('.toast-body').text(response.responseJSON.error);
|
||||||
|
$('.toast').toast('show');
|
||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
me.loadCollections();
|
me.loadCollections();
|
||||||
@@ -1031,10 +1033,19 @@ class APITester {
|
|||||||
|
|
||||||
deleteApiRequest(event) {
|
deleteApiRequest(event) {
|
||||||
let collectionId = $(event.currentTarget).closest('button').data('collection');
|
let collectionId = $(event.currentTarget).closest('button').data('collection');
|
||||||
let apiId = $(event.currentTarget).closest('button').data('id');
|
let apiId = $(event.currentTarget).closest('.confirm_delete_api').data('id');
|
||||||
|
console.log(event.currentTarget);
|
||||||
|
console.log($(event.currentTarget));
|
||||||
|
console.log('deleteApiRequest: ' + apiId);
|
||||||
|
console.log('collectionId: ' + collectionId);
|
||||||
|
let apiIndex = this.apiRequests.findIndex(function (api) {
|
||||||
|
return api.id === apiId;
|
||||||
|
});
|
||||||
|
console.log(apiIndex);
|
||||||
|
if(apiIndex >= 0){
|
||||||
|
this.closeTabWithApiIndex(apiIndex);
|
||||||
|
}
|
||||||
const me = this;
|
const me = this;
|
||||||
let apiRequests = this.apiRequests;
|
|
||||||
this.currentAjaxRequest = $.ajax({
|
this.currentAjaxRequest = $.ajax({
|
||||||
url: `/mgmt/collections/${collectionId}/apis/delete.do`,
|
url: `/mgmt/collections/${collectionId}/apis/delete.do`,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@@ -1047,14 +1058,10 @@ class APITester {
|
|||||||
},
|
},
|
||||||
complete: function () {
|
complete: function () {
|
||||||
me.hideLoadingOverlay();
|
me.hideLoadingOverlay();
|
||||||
|
|
||||||
//get the api with apiIndex index from apiRequests
|
|
||||||
let apiIndex = apiRequests.findIndex(function (api) {
|
|
||||||
return api.id === apiId;
|
|
||||||
});
|
|
||||||
me.closeTabWithApiIndex(apiIndex);
|
|
||||||
me.loadCollections();
|
me.loadCollections();
|
||||||
$('#confirm_delete_api_modal').modal('hide');
|
$('#confirm_delete_api_modal').modal('hide');
|
||||||
|
// $('#confirm_delete_api_modal').find('.confirm_delete_api').removeAttr('data-id');
|
||||||
|
// $('#confirm_delete_api_modal').find('.confirm_delete_api').removeAttr('data-collection');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
<section layout:fragment="contentFragment">
|
<section layout:fragment="contentFragment">
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card mt-2">
|
<div class="card mt-4">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3>응답 API 목록</h3>
|
<h5><span style="font-weight: bold">응답 API 목록</span></h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="d-flex justify-content-between">
|
<div class="d-flex justify-content-between">
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card mt-2">
|
<div class="card mt-4">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form name="listForm">
|
<form name="listForm">
|
||||||
<input name="id" type="hidden"/>
|
<input name="id" type="hidden"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user