Ejemplo n.º 1
0
 @RequestMapping(
     value = "/deleteVotes",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON)
 public ResponseEntity<String> deleteVotes() {
   initService.deleteVotes();
   return new ResponseEntity<>("Votes deleted successfully.", HttpStatus.OK);
 }
Ejemplo n.º 2
0
 @RequestMapping(
     value = "/init",
     method = RequestMethod.GET,
     produces = MediaType.APPLICATION_JSON)
 public ResponseEntity<InitDTO> init() {
   try {
     return new ResponseEntity<>(initService.initDatabase(false), HttpStatus.OK);
   } catch (RestClientException exception) {
     LOGGER.warn("Can't init", exception);
     return new ResponseEntity<>(new InitDTO(), HttpStatus.BAD_REQUEST);
   }
 }