Class ChatMessageController

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

@RequestMapping("/api/chat") @RestController public class ChatMessageController extends ApiController
  • Constructor Details

    • ChatMessageController

      public ChatMessageController()
  • Method Details

    • getChatMessages

      @PreAuthorize("hasAnyRole(\'ROLE_USER\', \'ROLE_ADMIN\')") @GetMapping("/get") public org.springframework.http.ResponseEntity<Object> getChatMessages(@RequestParam Long commonsId, @RequestParam int page, @RequestParam int size)
    • getAllChatMessages

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/get") public org.springframework.http.ResponseEntity<Object> getAllChatMessages(@RequestParam Long commonsId, @RequestParam int page, @RequestParam int size)
    • getHiddenChatMessages

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/admin/hidden") public org.springframework.http.ResponseEntity<Object> getHiddenChatMessages(@RequestParam Long commonsId, @RequestParam int page, @RequestParam int size)
    • createChatMessage

      @PreAuthorize("hasAnyRole(\'ROLE_USER\', \'ROLE_ADMIN\')") @PostMapping("/post") public org.springframework.http.ResponseEntity<Object> createChatMessage(@RequestParam Long commonsId, @RequestParam String content)
    • hideChatMessage

      @PreAuthorize("hasAnyRole(\'ROLE_USER\', \'ROLE_ADMIN\')") @PutMapping("/hide") public org.springframework.http.ResponseEntity<Object> hideChatMessage(@RequestParam Long chatMessageId)