Class StoresController

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

@RequestMapping("/api/stores") @RestController public class StoresController extends ApiController
  • Constructor Details

    • StoresController

      public StoresController()
  • Method Details

    • allStores

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

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

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Stores postStores(@RequestParam String location, @RequestParam String name, @RequestParam String price, @RequestParam String sales)
    • deleteStores

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

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