package com.fastbee.data.controller.websocket;

import com.fastbee.common.core.domain.AjaxResult;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * ws发送消息测试
 */
@RestController
@RequestMapping(value = "/api/v1/websocket")

public class WebSocketController {
    @Autowired
    private WebSocketService webSocketServer;

    /**
     * 模拟数据发送
     */
    @RequestMapping(value = "/sendTestMessage", method = RequestMethod.GET)
    public AjaxResult sendTestMessage(String message) {
        try {
//            webSocketServer.sendAllMessage(message);
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error();
        }
        return AjaxResult.success("发送成功");
    }
}
