Class SchoolsController

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

@RequestMapping("/api/schools") @RestController public class SchoolsController extends ApiController
  • Constructor Details

    • SchoolsController

      public SchoolsController()
  • Method Details

    • allSchools

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

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

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public School postSchool(@RequestParam String name, @RequestParam String rank, @RequestParam String description)
    • deleteSchool

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

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