Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(path="/{dishId}")
- public Dish getDishById(@PathVariable("dishId") long dishId) {
- Optional<Dish> dish = this.dishService.getDishById(dishId);
- if(dish.isPresent()) {
- return dish.get();
- } else {
- throw new ResponseStatusException(
- HttpStatus.NOT_FOUND, "Dish category not found"
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement