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, LocalDateTime startDate, LocalDateTime endDate, String announcementText) org.springframework.http.ResponseEntity<Object>
org.springframework.http.ResponseEntity<Object>
editAnnouncement
(Long id, Long commonsId, LocalDateTime startDate, LocalDateTime endDate, String announcementText) 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(name="startDate",required=false) @DateTimeFormat(iso=DATE_TIME) LocalDateTime startDate, @RequestParam(name="endDate",required=false) @DateTimeFormat(iso=DATE_TIME) LocalDateTime 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(name="startDate",required=false) @DateTimeFormat(iso=DATE_TIME) LocalDateTime startDate, @RequestParam(name="endDate",required=false) @DateTimeFormat(iso=DATE_TIME) LocalDateTime endDate, @RequestParam String announcementText) -
deleteAnnouncement
-