Class DriverChatController

java.lang.Object
edu.ucsb.cs156.gauchoride.controllers.ApiController
edu.ucsb.cs156.gauchoride.controllers.DriverChatController

@RequestMapping("/api/driverchats") @RestController public class DriverChatController extends ApiController
  • Constructor Details

    • DriverChatController

      public DriverChatController()
  • Method Details

    • getAllMessages

      @PreAuthorize("hasAnyRole(\'ROLE_ADMIN\',\'ROLE_DRIVER\')") @GetMapping("/all") public Iterable<DriverChat> getAllMessages()
    • getRecentMessage

      @PreAuthorize("hasAnyRole(\'ROLE_ADMIN\',\'ROLE_DRIVER\')") @GetMapping("/list") public Iterable<DriverChat> getRecentMessage(@RequestParam int limit)
    • getMessageById

      @PreAuthorize("hasAnyRole(\'ROLE_ADMIN\',\'ROLE_DRIVER\')") @GetMapping("") public DriverChat getMessageById(@RequestParam Long id)
    • postNewMessage

      @PreAuthorize("hasAnyRole(\'ROLE_ADMIN\',\'ROLE_DRIVER\')") @PostMapping("/post") public DriverChat postNewMessage(@RequestBody String messageContent) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • updateMessageByDriver

      @PreAuthorize("hasRole(\'ROLE_DRIVER\')") @PutMapping("") public DriverChat updateMessageByDriver(@RequestParam Long id, @RequestParam String messageContent)
    • updateMessageByAdmin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("admin") public DriverChat updateMessageByAdmin(@RequestParam Long id, @RequestParam String messageContent)
    • deleteMessageByDriver

      @PreAuthorize("hasRole(\'ROLE_DRIVER\')") @DeleteMapping public Object deleteMessageByDriver(@RequestParam Long id)
    • deleteMessageByAdmin

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/admin") public Object deleteMessageByAdmin(@RequestParam Long id)
    • deleteAllMessages

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/all") public Object deleteAllMessages()