@RequestMapping( value = "/entries", produces = Constants.APPLICATION_JSON, method = RequestMethod.GET) @ResponseStatus(HttpStatus.FOUND) public List<Beer> getAllBeers() { logger.debug("endpoint: .../entries"); return beerService.getAll(); }
@RequestMapping( value = "/update", consumes = Constants.APPLICATION_JSON, produces = Constants.APPLICATION_JSON, method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) public Beer updateBeer(@RequestBody Beer beer) { logger.debug("endpoint: .../update with payload: " + beer.toString()); return beerService.update(beer); }
@RequestMapping( value = "/entry/{id}", produces = Constants.APPLICATION_JSON, method = RequestMethod.GET) @ResponseStatus(HttpStatus.FOUND) public Beer getBeer(@PathVariable long id) { logger.debug("endpoint: .../entry/" + id); Beer beer = beerService.getOne(id); return beer; }
@RequestMapping(value = "/delete/all", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) public void deleteBeer() { logger.debug("endpoint: .../delete/all"); beerService.deleteAll(); }
@RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK) public void deleteBeer(@PathVariable long id) { logger.debug("endpoint: .../delete/" + id); beerService.deleteById(id); }