merge
This commit is contained in:
@@ -44,8 +44,9 @@ public class MockController {
|
||||
@ResponseBody
|
||||
@GetMapping({"/mock/json", "/mock/json/{uuidValue}"})
|
||||
public List<MockedMessageDto> getJson(@PathVariable(required = false) String uuidValue){
|
||||
UUID clientUUID = UUID.fromString(uuidValue);
|
||||
if(clientUUID == null) clientUUID = UUID.randomUUID();
|
||||
UUID clientUUID;
|
||||
if(uuidValue == null || uuidValue.equals("")) clientUUID = UUID.randomUUID();
|
||||
else clientUUID = UUID.fromString(uuidValue);
|
||||
List<MockedMessageDto> messages = klausService.getAllMockedResponses(clientUUID);
|
||||
if(messages.size() == 0) {
|
||||
klausService.setMockedResponse(buildDefaultMessage(clientUUID));
|
||||
|
||||
@@ -49,37 +49,38 @@ function getCookie(cname) {
|
||||
|
||||
function updateData(){
|
||||
var updatedJson = generateJson();
|
||||
$.ajax({
|
||||
var request = $.ajax({
|
||||
url: 'http://localhost:8097/mock/json',
|
||||
type: 'PUT',
|
||||
data: JSON.stringify(updatedJson, null, 2),
|
||||
error: function(e) {
|
||||
console.log(e);
|
||||
},
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
success: getData(),
|
||||
});
|
||||
getData();
|
||||
request.done(function () {
|
||||
getData();
|
||||
});
|
||||
}
|
||||
|
||||
function addMessage(){
|
||||
$.ajax({
|
||||
|
||||
var request = $.ajax({
|
||||
url: 'http://localhost:8097/mock/json/'+clientUUID,
|
||||
type: 'POST',
|
||||
success: getData(),
|
||||
});
|
||||
getData();
|
||||
request.done(function () {
|
||||
getData();
|
||||
});
|
||||
}
|
||||
|
||||
function removeTile(id){
|
||||
var jsonObject = findJsonById(id);
|
||||
$.ajax({
|
||||
var request = $.ajax({
|
||||
url: 'http://localhost:8097/mock/json/'+clientUUID + '/' + id,
|
||||
type: 'DELETE',
|
||||
success: getData(),
|
||||
});
|
||||
getData();
|
||||
request.done(function () {
|
||||
getData();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
<title>R11 MockedServices</title>
|
||||
<meta charset="utf-8">
|
||||
<link rel="stylesheet" href="/css/main.css" type="text/css">
|
||||
<!-- <link rel="stylesheet" href="/css/wojtas.css" type="text/css">-->
|
||||
<link rel="stylesheet" href="/Dependency/fontello-plus/css/fontello.css" type="text/css"/>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Acme&family=Josefin+Slab:wght@500&display=swap" rel="stylesheet">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="/js/datatransfer.js"></script>
|
||||
<script type="text/javascript" src="historyloader.js"></script>
|
||||
<!-- <script type="text/javascript" src="historyloader.js"></script>-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="container">
|
||||
|
||||
Reference in New Issue
Block a user