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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeleteSubject
(String subjectCode) getSubjectById
(String subjectCode) Methods inherited from class edu.ucsb.cs156.courses.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException, handleIllegalArgumentException
-
Constructor Details
-
UCSBSubjectsController
public UCSBSubjectsController()
-
-
Method Details
-
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
-
deleteAllSubjects
-