Class PSCourseController

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

@RequestMapping("/api/courses") @RestController public class PSCourseController extends ApiController
  • Constructor Details

    • PSCourseController

      public PSCourseController()
  • Method Details

    • allUsersCourses

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/all") public Iterable<PSCourse> allUsersCourses()
    • thisUsersCourses

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/user/all") public Iterable<PSCourse> thisUsersCourses()
    • allCoursesForPsId

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/psid/all") public Iterable<PSCourse> allCoursesForPsId(@RequestParam Long psId)
    • thisUsersCoursesForPsId

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/user/psid/all") public Iterable<PSCourse> thisUsersCoursesForPsId(@RequestParam Long psId)
    • getCourseById_admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin") public PSCourse getCourseById_admin(@RequestParam Long id)
    • getCourseById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/user") public PSCourse getCourseById(@RequestParam Long id)
    • postCourses

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PostMapping("/post") public ArrayList<PSCourse> postCourses(@RequestParam String enrollCd, @RequestParam Long psId) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteCourses_Admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/admin") public Object deleteCourses_Admin(@RequestParam Long id)
    • deleteCourses

      @PreAuthorize("hasRole(\'ROLE_USER\')") @DeleteMapping("/user") public Object deleteCourses(@RequestParam Long id) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • deleteCourses_PSID

      @PreAuthorize("hasRole(\'ROLE_USER\')") @DeleteMapping("/user/psid") public Object deleteCourses_PSID(@RequestParam String enrollCd, @RequestParam Long psId) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • putCourseById_admin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("/admin") public PSCourse putCourseById_admin(@RequestParam Long id, @RequestBody @Valid @Valid PSCourse incomingCourses)
    • putCoursesById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @PutMapping("/user") public PSCourse putCoursesById(@RequestParam Long id, @RequestBody @Valid @Valid PSCourse incomingCourses)