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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeleteCourse
(Long id) postCourse
(String name, String term) updateCourse
(Long id, String name, String term) Methods inherited from class edu.ucsb.cs156.happiercows.controllers.ApiController
genericMessage, getCurrentUser, handleBadRequest, handleGenericException
-
Constructor Details
-
CoursesController
public CoursesController()
-
-
Method Details
-
allCourses
-
getById
-
postCourse
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\')") @PostMapping("/post") public Courses postCourse(@RequestParam String name, @RequestParam String term) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
updateCourse
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\')") @PutMapping("/update") public Courses updateCourse(@RequestParam Long id, @RequestParam String name, @RequestParam String term) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
deleteCourse
@PreAuthorize("hasAnyRole(\'ROLE_ADMIN\')") @DeleteMapping("/delete") public Courses deleteCourse(@RequestParam Long id) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-