package com.gyee.frame.common.websocket;

import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Component;


@Component
public class WebsocketMessageService
{

    @Resource
    private SimpMessagingTemplate simpMessagingTemplate;


    public void SendAlertToAll(String destination, Object sendData)
    {
        String s = JSON.toJSONString(sendData);
//        System.out.println(s);
        simpMessagingTemplate.convertAndSend(destination, s);

    }
}
