Merge branch 'event-db' into html-gruppe
This commit is contained in:
@ -53,7 +53,7 @@ public class SwaggerAPIControllerExample {
|
||||
return "Product saved successfully";
|
||||
}
|
||||
|
||||
/*@GetMapping("/json") //just for testing
|
||||
/*@GetMapping("/json")
|
||||
public void json() {
|
||||
AddUserEvent aEvent = new AddUserEvent(
|
||||
1,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package mops.gruppen2.repository;
|
||||
|
||||
import mops.gruppen2.domain.EventDTO;
|
||||
import mops.gruppen2.domain.event.Event;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
public interface EventRepository extends CrudRepository<EventDTO, Long> {
|
||||
|
||||
@ -24,10 +24,11 @@ public class SerializationService {
|
||||
|
||||
public String serializeEvent(Event event) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String json = mapper.writeValueAsString(event);
|
||||
log.info(json);
|
||||
return json;
|
||||
return mapper.writeValueAsString(event);
|
||||
}
|
||||
|
||||
|
||||
public Event deserializeEvent(String json) throws JsonProcessingException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
return mapper.readValue(json, Event.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user