diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/mobileAttendanceMachine/WebSocketConfig.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/mobileAttendanceMachine/WebSocketConfig.java new file mode 100644 index 00000000..7f2f5d36 --- /dev/null +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/mobileAttendanceMachine/WebSocketConfig.java @@ -0,0 +1,24 @@ +package org.dromara.mobileAttendanceMachine; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +/** + * @Author 铁憨憨 + * @Date 2025/10/14 16:11 + * @Version 1.0 + * + * 系统启动就会开启ws + */ +@Configuration +public class WebSocketConfig { + + /** + * 自动注册所有标注了@ServerEndpoint的WebSocket端点 + */ + @Bean + public ServerEndpointExporter serverEndpointExporter() { + return new ServerEndpointExporter(); + } +}