Class PersonalSchedulesController
java.lang.Object
edu.ucsb.cs156.courses.controllers.ApiController
edu.ucsb.cs156.courses.controllers.PersonalSchedulesController
@RequestMapping("/api/personalschedules")
@RestController
public class PersonalSchedulesController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeleteSchedule
(Long id) getScheduleById
(Long id) postSchedule
(String name, Optional<String> description, String quarter) putScheduleById
(Long id, @Valid PersonalSchedule incomingSchedule) putScheduleById_admin
(Long id, @Valid PersonalSchedule incomingSchedule) Methods inherited from class edu.ucsb.cs156.courses.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException, handleIllegalArgumentException
-
Constructor Details
-
PersonalSchedulesController
public PersonalSchedulesController()
-
-
Method Details
-
allUsersSchedules
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/all") public Iterable<PersonalSchedule> allUsersSchedules() -
thisUsersSchedules
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<PersonalSchedule> thisUsersSchedules() -
getScheduleById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public PersonalSchedule getScheduleById(@RequestParam Long id) -
getScheduleById_admin
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin") public PersonalSchedule getScheduleById_admin(@RequestParam Long id) -
postSchedule
@PreAuthorize("hasRole(\'ROLE_USER\')") @PostMapping("/post") public PersonalSchedule postSchedule(@RequestParam String name, Optional<String> description, @RequestParam String quarter) -
deleteSchedule
-
deleteSchedule_Admin
-
putScheduleById
@PreAuthorize("hasRole(\'ROLE_USER\')") @PutMapping("") public PersonalSchedule putScheduleById(@RequestParam Long id, @RequestBody @Valid @Valid PersonalSchedule incomingSchedule) -
putScheduleById_admin
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("/admin") public PersonalSchedule putScheduleById_admin(@RequestParam Long id, @RequestBody @Valid @Valid PersonalSchedule incomingSchedule)
-