|
|
@ -19,13 +19,18 @@ import java.io.IOException; |
|
|
|
public class InteractiveWsService implements WebSocketService { |
|
|
|
public class InteractiveWsService implements WebSocketService { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean sendMessage(String signage, TextMessage message) { |
|
|
|
public Boolean sendMessage(String sessionId, TextMessage message) { |
|
|
|
WebSocketSession session = InteractiveSessionManager.get(signage); |
|
|
|
WebSocketSession session = InteractiveSessionManager.get(sessionId); |
|
|
|
|
|
|
|
return this.sendMessage(session,message); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Boolean sendMessage(WebSocketSession session, TextMessage message) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
session.sendMessage(message); |
|
|
|
session.sendMessage(message); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} catch (IOException e) { |
|
|
|
} catch (IOException e) { |
|
|
|
log.error("消息推送失败,推送sessionId为:" + signage + ";消息体为:" + JSON.toJSONString(message)); |
|
|
|
log.error("消息推送失败;消息体为:" + JSON.toJSONString(message)); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|