Class CourseController

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

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

    • CourseController

      public CourseController()
  • Method Details

    • allCourses

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

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Course postCourse(@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)
    • deleteCourse

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteCourse(@RequestParam Long id)