Exemplo n.º 1
0
 @RequestMapping(
     value = "/events/{eventId}/speeches",
     method = POST,
     consumes = MediaType.APPLICATION_JSON_VALUE,
     produces = MediaType.APPLICATION_JSON_VALUE)
 @ResponseStatus(HttpStatus.CREATED)
 public Speech createAndLinkToEvent(
     @PathVariable("eventId") Long eventId, @RequestBody @Validated Speech speech) {
   Event event = eventService.findById(eventId);
   return speechService.createAndLinkToEvent(speech, event);
 }