diff --git a/src/main/java/com/release11/klaus/controller/EventController.java b/src/main/java/com/release11/klaus/controller/EventController.java index ff89857..ecfcd36 100644 --- a/src/main/java/com/release11/klaus/controller/EventController.java +++ b/src/main/java/com/release11/klaus/controller/EventController.java @@ -33,7 +33,7 @@ import java.util.UUID; public class EventController { private final EtrackService service; - @GetMapping + @PostMapping public ResponseEntity getHistory(@RequestBody EventRequestDto event){ return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(event), HttpStatus.OK); } diff --git a/src/main/resources/static/html/mock.html b/src/main/resources/static/html/mock.html index caafe0a..b29d62b 100644 --- a/src/main/resources/static/html/mock.html +++ b/src/main/resources/static/html/mock.html @@ -101,7 +101,7 @@ - +
@@ -208,6 +208,6 @@ - + \ No newline at end of file diff --git a/src/main/resources/static/js/historyloader.js b/src/main/resources/static/js/historyloader.js index e69de29..7e20f19 100644 --- a/src/main/resources/static/js/historyloader.js +++ b/src/main/resources/static/js/historyloader.js @@ -0,0 +1,26 @@ +var historyJson = {}; + +function searchHistory(){ + var dateFrom = $('#historyFrom').val(); + var dateTo = $('#historyTo').val(); + var eventRequest = { + clientUUID : json[jsonIndex].clientUUID, + localDateTimeFrom : dateFrom, + localDateTimeTo : dateTo, + mockedResponseId : json[jsonIndex].mockedResponseId + }; + $.ajax({ + url: host + '/api/event', + type: 'POST', + data: JSON.stringify(eventRequest, null, 2), + contentType: "application/json" + }).done(function(data){ + console.log(data); + historyJson = data; + }); +} + +const startSearch = function(){ + searchHistory(); +} +$('#btn-searchHistory').click(startSearch); \ No newline at end of file diff --git a/target/classes/com/release11/klaus/controller/EventController.class b/target/classes/com/release11/klaus/controller/EventController.class index f188430..47acb1c 100644 Binary files a/target/classes/com/release11/klaus/controller/EventController.class and b/target/classes/com/release11/klaus/controller/EventController.class differ diff --git a/target/classes/static/html/mock.html b/target/classes/static/html/mock.html index caafe0a..b29d62b 100644 --- a/target/classes/static/html/mock.html +++ b/target/classes/static/html/mock.html @@ -101,7 +101,7 @@ - +
@@ -208,6 +208,6 @@ - + \ No newline at end of file diff --git a/target/classes/static/js/historyloader.js b/target/classes/static/js/historyloader.js index e69de29..7e20f19 100644 --- a/target/classes/static/js/historyloader.js +++ b/target/classes/static/js/historyloader.js @@ -0,0 +1,26 @@ +var historyJson = {}; + +function searchHistory(){ + var dateFrom = $('#historyFrom').val(); + var dateTo = $('#historyTo').val(); + var eventRequest = { + clientUUID : json[jsonIndex].clientUUID, + localDateTimeFrom : dateFrom, + localDateTimeTo : dateTo, + mockedResponseId : json[jsonIndex].mockedResponseId + }; + $.ajax({ + url: host + '/api/event', + type: 'POST', + data: JSON.stringify(eventRequest, null, 2), + contentType: "application/json" + }).done(function(data){ + console.log(data); + historyJson = data; + }); +} + +const startSearch = function(){ + searchHistory(); +} +$('#btn-searchHistory').click(startSearch); \ No newline at end of file