企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` /** * @author 张跃帅 * @Description: WebSocket-工具 * @date 2020/08/12 */ public class WebSocketUtil { private static final WebSocketServer webSocketServer = SpringUtil.getBean(WebSocketServer.class); /** * 给指定用户-发送消息 */ public static void sendToUser(String msg) { webSocketServer.sendToUser(msg); } /** * 向客户端-群发消息 */ public static void sendMsgALL(String msg) { webSocketServer.sendMsgALL(msg); } }