From c42614978ff12013a1eabebd0289b27169a5784f Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 06 五月 2025 17:25:56 +0800 Subject: [PATCH] 1、实现万功能token(0000-0000-1234-9876-5); 2、web端单独实现命令结果等待器,并相应修改相关部分; 3、web端实现透传命令; 4、修改一些不当注释; 5、优化一些代码。 --- pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketHeartBeat.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketHeartBeat.java b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketHeartBeat.java new file mode 100644 index 0000000..ef881b4 --- /dev/null +++ b/pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/largeScreen/WebSocketHeartBeat.java @@ -0,0 +1,31 @@ +package com.dy.pipIrrRemote.largeScreen; + +/** + * @Author: liurunyu + * @Date: 2025/2/11 8:37 + * @Description + */ + +import com.alibaba.fastjson2.JSON; +import com.dy.common.util.DateTime; +import com.dy.common.webUtil.WebSocketMessage; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class WebSocketHeartBeat { + + // 璁剧疆瀹氭椂鍗佺涓�娆� + @Scheduled(cron = "0/10 * * * * ?") + public void WsHeartBeat() throws Exception { + WebSocketServer.sendMessage2AllClient(getHeartBeatMessage()); + } + + public static String getHeartBeatMessage() { + WebSocketMessage vo = new WebSocketMessage() ; + vo.type = WebSocketMessage.TYPE_HEARTBEAT ; + vo.content = DateTime.yyyy_MM_dd_HH_mm_ss() ; + return JSON.toJSONString(vo) ; + } + +} -- Gitblit v1.8.0