websocket:重新封装 websocket 组件,支持 token 认证,并增加 WebSocketMessageListener 方便处理消息

This commit is contained in:
YunaiV
2023-11-22 23:17:50 +08:00
parent 6a61db8508
commit 1941a7b3e6
27 changed files with 539 additions and 540 deletions

View File

@ -12,18 +12,22 @@
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>WebSocket</description>
<description>WebSocket 框架,支持多节点的广播</description>
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
<dependencies>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-common</artifactId>
</dependency>
<!-- Web 相关 -->
<dependency>
<!-- 为什么是 websocket 依赖 security 呢?而不是 security 拓展 websocket 呢?
因为 websocket 和 LoginUser 当前登录的用户有一定的相关性,具体可见 WebSocketSessionManagerImpl 逻辑。
如果让 security 拓展 websocket 的话,会导致 websocket 组件的封装很散,进而增大理解成本。
-->
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-spring-boot-starter-security</artifactId>
</dependency>