Class ChatController


  • @RestController
    @RequestMapping("/api/v1/chats")
    public class ChatController
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ChatController()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.springframework.http.ResponseEntity<Chat> createChat​(Chat chat)  
      org.springframework.http.ResponseEntity<Message> createMessage​(long chatId, Message message)  
      org.springframework.http.ResponseEntity<java.lang.String> deleteChat​(long chatId)  
      org.springframework.http.ResponseEntity<Chat> getChat​(long chatId)  
      org.springframework.http.ResponseEntity<java.util.List<Chat>> getChats()  
      org.springframework.http.ResponseEntity<java.util.List<MessageDTO>> getMessages​(long chatId)  
      org.springframework.http.ResponseEntity<Chat> updateChat​(long chatId, Chat chat)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChatController

        public ChatController()
    • Method Detail

      • getChats

        @GetMapping
        public org.springframework.http.ResponseEntity<java.util.List<Chat>> getChats()
      • getChat

        @GetMapping("/{chat_id}")
        public org.springframework.http.ResponseEntity<Chat> getChat​(@PathVariable("chat_id")
                                                                     long chatId)
      • createChat

        @PostMapping
        public org.springframework.http.ResponseEntity<Chat> createChat​(@RequestBody
                                                                        Chat chat)
      • updateChat

        @PutMapping("/{chat_id}")
        public org.springframework.http.ResponseEntity<Chat> updateChat​(@PathVariable("chat_id")
                                                                        long chatId,
                                                                        @RequestBody
                                                                        Chat chat)
      • getMessages

        @GetMapping("/{chat_id}/messages")
        public org.springframework.http.ResponseEntity<java.util.List<MessageDTO>> getMessages​(@PathVariable("chat_id")
                                                                                               long chatId)
      • createMessage

        @PostMapping("/{chat_id}/messages")
        public org.springframework.http.ResponseEntity<Message> createMessage​(@PathVariable("chat_id")
                                                                              long chatId,
                                                                              @RequestBody
                                                                              Message message)
      • deleteChat

        @DeleteMapping("/{chat_id}")
        public org.springframework.http.ResponseEntity<java.lang.String> deleteChat​(@PathVariable("chat_id")
                                                                                    long chatId)