Class CartController

java.lang.Object
edu.ucsb.cs156.gauchoride.controllers.ApiController
edu.ucsb.cs156.gauchoride.controllers.CartController

@RequestMapping("/api/carts") @RestController public class CartController extends ApiController
  • Constructor Details

    • CartController

      public CartController()
  • Method Details

    • allCart

      @PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @GetMapping("/all") public Iterable<Cart> allCart()
    • getById

      @PreAuthorize("hasRole(\'ROLE_ADMIN\') || hasRole(\'ROLE_DRIVER\')") @GetMapping("") public Cart getById(@RequestParam Long id)
    • postCart

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Cart postCart(@RequestParam String name, @RequestParam int capacityPeople, @RequestParam int capacityWheelchair) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteCart

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

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