修改了给前端的websocket

master
bmpandlcm 11 months ago
parent 3b737e3f89
commit 18a103b03f

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">

@ -10,9 +10,9 @@
</component>
<component name="ChangeListManager">
<list default="true" id="29bcb86b-1634-41e0-a498-79481163cba8" name="Changes" comment="解决餐饮预约核销成功之后前端通过websocket没有收到消息的问题">
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/QcodeInfoController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/QcodeInfoController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/util/main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/util/main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/WebSocket.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/nmgs/controller/WebSocket.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -76,7 +76,7 @@
&quot;Application.PubTools.executor&quot;: &quot;Run&quot;,
&quot;Application.QCodeInfoServiceImpl.executor&quot;: &quot;Debug&quot;,
&quot;Application.SensitiveFilter.executor&quot;: &quot;Run&quot;,
&quot;Application.main.executor&quot;: &quot;Debug&quot;,
&quot;Application.main.executor&quot;: &quot;Run&quot;,
&quot;Application.redisConfigUtil.executor&quot;: &quot;Debug&quot;,
&quot;Maven.IntegraManager [clean].executor&quot;: &quot;Run&quot;,
&quot;Maven.IntegraManager [install].executor&quot;: &quot;Run&quot;,
@ -103,7 +103,7 @@
&quot;deletionFromPopupRequiresConfirmation&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;E:/work/TGGLT-WorkSpace/springcloud_mybatisplus&quot;,
&quot;last_opened_file_path&quot;: &quot;E:/work/TGGLT-WorkSpace/IntegralManager&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
@ -543,7 +543,11 @@
<workItem from="1733902595732" duration="639000" />
<workItem from="1733964297677" duration="4644000" />
<workItem from="1733994734948" duration="8894000" />
<workItem from="1734079178237" duration="1988000" />
<workItem from="1734079178237" duration="7953000" />
<workItem from="1735008741059" duration="915000" />
<workItem from="1735025147716" duration="621000" />
<workItem from="1735284165308" duration="116000" />
<workItem from="1735284453688" duration="36000" />
</task>
<task id="LOCAL-00001" summary="特请处理">
<option name="closed" value="true" />
@ -705,7 +709,15 @@
<option name="project" value="LOCAL" />
<updated>1734053883415</updated>
</task>
<option name="localTasksCounter" value="21" />
<task id="LOCAL-00021" summary="解决餐饮预约核销成功之后前端通过websocket没有收到消息的问题">
<option name="closed" value="true" />
<created>1734314915199</created>
<option name="number" value="00021" />
<option name="presentableId" value="LOCAL-00021" />
<option name="project" value="LOCAL" />
<updated>1734314915199</updated>
</task>
<option name="localTasksCounter" value="22" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">

@ -44,6 +44,11 @@ public class WebSocket {
@OnMessage
public void onMessage(Session session,@PathParam(value = "userId") String userId, String message) {
System.out.println("发送消息的人员======"+userId);
JSONObject retJo = new JSONObject();
retJo.put("code", 1);
retJo.put("msg", "连接成功");
retJo.put("data", "");
WebsocketUtil.sendMessage(session, JSONObject.toJSONString(retJo));
}
@OnError

Loading…
Cancel
Save