T139 Server returns history to client request
This commit is contained in:
@@ -33,7 +33,7 @@ import java.util.UUID;
|
|||||||
public class EventController {
|
public class EventController {
|
||||||
private final EtrackService service;
|
private final EtrackService service;
|
||||||
|
|
||||||
@GetMapping
|
@PostMapping
|
||||||
public ResponseEntity getHistory(@RequestBody EventRequestDto event){
|
public ResponseEntity getHistory(@RequestBody EventRequestDto event){
|
||||||
return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(event), HttpStatus.OK);
|
return new ResponseEntity(service.getEventsByDateTimeAndBusinessKeys(event), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@
|
|||||||
<label for="historyTo">To</label>
|
<label for="historyTo">To</label>
|
||||||
<input type="datetime" name="dateTo" id="historyTo"/>
|
<input type="datetime" name="dateTo" id="historyTo"/>
|
||||||
</div>
|
</div>
|
||||||
<button>Search</button>
|
<button id="btn-searchHistory">Search</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<table id="historyTable" class="simpleTable">
|
<table id="historyTable" class="simpleTable">
|
||||||
@@ -208,6 +208,6 @@
|
|||||||
<script type="text/javascript" src="/js/modal.js"></script>
|
<script type="text/javascript" src="/js/modal.js"></script>
|
||||||
<script type="text/javascript" src="/js/uianimation.js"></script>
|
<script type="text/javascript" src="/js/uianimation.js"></script>
|
||||||
<script type="text/javascript" src="/js/datatransfer.js"></script>
|
<script type="text/javascript" src="/js/datatransfer.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/historyloader.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -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);
|
||||||
Binary file not shown.
@@ -101,7 +101,7 @@
|
|||||||
<label for="historyTo">To</label>
|
<label for="historyTo">To</label>
|
||||||
<input type="datetime" name="dateTo" id="historyTo"/>
|
<input type="datetime" name="dateTo" id="historyTo"/>
|
||||||
</div>
|
</div>
|
||||||
<button>Search</button>
|
<button id="btn-searchHistory">Search</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<table id="historyTable" class="simpleTable">
|
<table id="historyTable" class="simpleTable">
|
||||||
@@ -208,6 +208,6 @@
|
|||||||
<script type="text/javascript" src="/js/modal.js"></script>
|
<script type="text/javascript" src="/js/modal.js"></script>
|
||||||
<script type="text/javascript" src="/js/uianimation.js"></script>
|
<script type="text/javascript" src="/js/uianimation.js"></script>
|
||||||
<script type="text/javascript" src="/js/datatransfer.js"></script>
|
<script type="text/javascript" src="/js/datatransfer.js"></script>
|
||||||
|
<script type="text/javascript" src="/js/historyloader.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -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);
|
||||||
Reference in New Issue
Block a user