package com.project.whatsappchatbot.controller;

import com.project.whatsappchatbot.DTO.NotificationMessage;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

@Controller
public class NotificationController {

    @MessageMapping("/notify")
    @SendTo("/topic/notifications")
    public NotificationMessage send(NotificationMessage message) throws Exception {
        return new NotificationMessage("New Order Added: " + message.getContent());
    }
}
