Class UCSBSubjectsController

java.lang.Object
edu.ucsb.cs156.courses.controllers.ApiController
edu.ucsb.cs156.courses.controllers.UCSBSubjectsController

@RequestMapping("/api/UCSBSubjects") @RestController public class UCSBSubjectsController extends ApiController
  • Constructor Details

    • UCSBSubjectsController

      public UCSBSubjectsController()
  • Method Details

    • allSubjects

      @GetMapping("/all") public Iterable<UCSBSubject> allSubjects()
    • loadSubjects

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/load") public List<UCSBSubject> loadSubjects() throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • getSubjectById

      @PreAuthorize("hasRole(\'ROLE_USER\') || hasRole(\'ROLE_ADMIN\')") @GetMapping("") public UCSBSubject getSubjectById(@RequestParam String subjectCode) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteSubject

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteSubject(@RequestParam String subjectCode)
    • deleteAllSubjects

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/all") public Object deleteAllSubjects()