1

Merge branch 'event-db' into html-gruppe

This commit is contained in:
Christoph
2020-03-10 13:04:14 +01:00
committed by GitHub
3 changed files with 15 additions and 25 deletions

View File

@ -53,20 +53,4 @@ public class SwaggerAPIControllerExample {
return "Product saved successfully";
}
/*@GetMapping("/json")
public void json() {
AddUserEvent aEvent = new AddUserEvent(
1,
1,
"Eins",
faker.leagueOfLegends().location(),
faker.name().lastName(),
"123@email.de");
try {
serializationService.serializeEvent(aEvent);
serializationService.saveEvent(aEvent);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
}*/
}

View File

@ -26,7 +26,7 @@ public class SerializationService {
ObjectMapper mapper = new ObjectMapper();
return mapper.writeValueAsString(event);
}
public Event deserializeEvent(String json) throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
return mapper.readValue(json, Event.class);