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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetMessageById
(Long id) getRecentMessage
(int limit) postNewMessage
(String messageContent) updateMessageByAdmin
(Long id, String messageContent) updateMessageByDriver
(Long id, String messageContent) Methods inherited from class edu.ucsb.cs156.gauchoride.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
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
-
deleteMessageByAdmin
-
deleteAllMessages
-