Class RestaurantController

java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.RestaurantController

@RequestMapping("/api/Restaurant") @RestController public class RestaurantController extends ApiController
  • Constructor Details

    • RestaurantController

      public RestaurantController()
  • Method Details

    • allRestaurants

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<Restaurant> allRestaurants()
    • getById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public Restaurant getById(@RequestParam Long id)
    • postrestaurant

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Restaurant postrestaurant(@RequestParam String name, @RequestParam String description)
    • deleterestaurant

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleterestaurant(@RequestParam Long id)
    • updaterestaurant

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public Restaurant updaterestaurant(@RequestParam Long id, @RequestBody @Valid @Valid Restaurant incoming)