Class CoursesController

java.lang.Object
edu.ucsb.cs156.happiercows.controllers.ApiController
edu.ucsb.cs156.happiercows.controllers.CoursesController

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

    • CoursesController

      public CoursesController()
  • Method Details

    • allCourses

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<Courses> allCourses()
    • postCourses

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Courses postCourses(@RequestParam String name, @RequestParam String school, @RequestParam String term, @RequestParam("startDate") @DateTimeFormat(iso=DATE_TIME) LocalDateTime startDate, @RequestParam("endDate") @DateTimeFormat(iso=DATE_TIME) LocalDateTime endDate) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • updateCourses

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