|
|
@@ -112,13 +112,18 @@ public class PublicScreenChatWebsocket extends WebsocketCommon {
|
|
|
}
|
|
|
|
|
|
@OnMessage
|
|
|
- public void onMessage(@PathParam("userId") String userId, String message) {
|
|
|
+ public void onMessage(@PathParam("userId") String userId, String message, Session session) {
|
|
|
init();
|
|
|
if (StringUtils.isBlank(message)) {
|
|
|
String errMsg = "Illegal parameter : message can not be null";
|
|
|
exceptionHandle(userId, new PublicScreenChatExceptionMsg(4, errMsg));
|
|
|
return;
|
|
|
}
|
|
|
+ if ("META_PING".equals(message)) {
|
|
|
+ log.info(String.format("sessionId:[%S] userId:[%S] 连接正常", session.getId(), userId));
|
|
|
+ sendMessageTo(clients, "META_PONG", PREFIX.concat(userId));
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!contentAuditService.auditText(message)) {
|
|
|
savePublicScreenChat(userId, message, false);
|
|
|
exceptionHandle(userId, new PublicScreenChatExceptionMsg(3, "消息包含非法内容"));
|