+
+ @RequestMapping(value = { "/" }, method = RequestMethod.POST)
+ public ResponseEntity<Timeslot> createTimeslot(@RequestBody Timeslot timeslot) {
+ try {
+ service.saveTimeslot(timeslot);
+ return new ResponseEntity<>(timeslot, HttpStatus.OK);
+ } catch (Exception e) {
+ LOGGER.error(EELFLoggerDelegate.errorLogger, "Creation of timeslot failed. " + UserUtils.getStackTrace(e));
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+ }
+ }
+
+ @RequestMapping(value = { "/" }, method = RequestMethod.DELETE)
+ public ResponseEntity<Boolean> deleteTimeslot(@RequestBody Timeslot timeslot) {
+ try {
+ service.deleteTimeslot(timeslot);
+ return new ResponseEntity<>(true, HttpStatus.OK);
+ } catch (Exception e) {
+ LOGGER.error(EELFLoggerDelegate.errorLogger, "Deletion of timeslot failed. " + UserUtils.getStackTrace(e));
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
+ }
+ }