Advertisement
Guest User

Untitled

a guest
May 27th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. @RequestMapping(path="/{dishId}")
  2. public Dish getDishById(@PathVariable("dishId") long dishId) {
  3. Optional<Dish> dish = this.dishService.getDishById(dishId);
  4. if(dish.isPresent()) {
  5. return dish.get();
  6. } else {
  7. throw new ResponseStatusException(
  8. HttpStatus.NOT_FOUND, "Dish category not found"
  9. );
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement