feat(property): 用 Server-Sent Events (SSE) 替代 WebSocket 实现消息推送
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user