feat(property): 用 Server-Sent Events (SSE) 替代 WebSocket 实现消息推送

This commit is contained in:
2025-09-06 13:16:40 +08:00
parent 22c6efea63
commit 0bf8cf45e8
8 changed files with 111 additions and 38 deletions

View File

@@ -45,4 +45,16 @@ public class RemoteMessageServiceImpl implements RemoteMessageService {
SseMessageUtils.publishAll(message);
}
/**
* 向指定的用户的指定会话发送消息
*
* @param userId 要发送消息的用户id
* @param token 用户的会话令牌
* @param message 要发送的消息内容
*/
@Override
public void sendMessage(Long userId, String token, String message) {
SseMessageUtils.sendMessage(userId, token, message);
}
}