Class AnnouncementsController
java.lang.Object
edu.ucsb.cs156.happiercows.controllers.ApiController
edu.ucsb.cs156.happiercows.controllers.AnnouncementsController
@RequestMapping("/api/announcements")
@RestController
public class AnnouncementsController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Object>
createAnnouncement
(Long commonsId, Date startDate, Date endDate, String announcementText) org.springframework.http.ResponseEntity<Object>
org.springframework.http.ResponseEntity<Object>
org.springframework.http.ResponseEntity<Object>
org.springframework.http.ResponseEntity<Object>
getAnnouncements
(Long commonsId) Methods inherited from class edu.ucsb.cs156.happiercows.controllers.ApiController
genericMessage, getCurrentUser, handleBadRequest, handleGenericException
-
Constructor Details
-
AnnouncementsController
public AnnouncementsController()
-
-
Method Details
-
createAnnouncement
@PreAuthorize("hasAnyRole(\'ROLE_USER\', \'ROLE_ADMIN\')") @PostMapping("/post") public org.springframework.http.ResponseEntity<Object> createAnnouncement(@RequestParam Long commonsId, @RequestParam(required=false) Date startDate, @RequestParam(required=false) Date endDate, @RequestParam String announcementText) -
getAnnouncements
-
getAnnouncementById
-
editAnnouncement
@PreAuthorize("hasAnyRole(\'ROLE_USER\', \'ROLE_ADMIN\')") @PutMapping("/put") public org.springframework.http.ResponseEntity<Object> editAnnouncement(@RequestParam Long id, @RequestParam Long commonsId, @RequestParam(required=false) Date startDate, @RequestParam(required=false) Date endDate, @RequestParam String announcementText) -
deleteAnnouncement
-