Class ChatController

java.lang.Object
vaultWeb.controllers.ChatController

@Controller public class ChatController extends Object
Controller responsible for handling WebSocket-based chat functionality.

Supports both group chat and private messages. Messages are first persisted via ChatService and then dispatched to the corresponding topics or users.

  • Constructor Details

    • ChatController

      public ChatController()
  • Method Details

    • sendMessage

      @MessageMapping("/chat.send") public void sendMessage(@Payload ChatMessageDto messageDto)
      Handles incoming group chat messages from clients and broadcasts them to all subscribers of the specified group topic.
      Parameters:
      messageDto - DTO containing message content, sender information, and target group
    • sendPrivateMessage

      @MessageMapping("/chat.private.send") public void sendPrivateMessage(@Payload ChatMessageDto messageDto)
      Handles incoming private chat messages from clients and sends them to both users of the private chat. The message content is decrypted before delivery.
      Parameters:
      messageDto - DTO containing message content, sender information, and private chat ID