Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
deep-ask
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
deepseek
deep-ask
Commits
58e6942a
Commit
58e6942a
authored
Mar 04, 2025
by
leiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、对接调整
parent
2dba1935
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
VoiceWebSocketServer.java
src/main/java/admin/server/VoiceWebSocketServer.java
+15
-13
No files found.
src/main/java/admin/server/VoiceWebSocketServer.java
View file @
58e6942a
...
...
@@ -146,7 +146,7 @@ public class VoiceWebSocketServer {
chatgptRoleRecordsService
.
save
(
chatgptRoleRecords
);
//如果是H5则发送给大屏消息
sendMsgToWeb
(
memberId
,
webSocketModel
.
getData
()
,
session
);
sendMsgToWeb
(
memberId
,
webSocketModel
.
getData
());
}
else
if
(
byId
!=
null
&&
"sendText"
.
equals
(
webSocketModel
.
getAction
()))
{
ChatgptRoleRecords
chatgptRoleRecords
=
new
ChatgptRoleRecords
();
chatgptRoleRecords
.
setMessage
(
webSocketModel
.
getData
());
...
...
@@ -157,7 +157,7 @@ public class VoiceWebSocketServer {
chatgptRoleRecordsService
.
save
(
chatgptRoleRecords
);
//如果是H5则发送给大屏消息
sendMsgToWeb
(
memberId
,
webSocketModel
.
getData
()
,
session
);
sendMsgToWeb
(
memberId
,
webSocketModel
.
getData
());
}
// 文字聊天
...
...
@@ -178,7 +178,7 @@ public class VoiceWebSocketServer {
}
}
private
void
sendMsgToWeb
(
String
memberId
,
String
content
,
Session
session
)
{
private
void
sendMsgToWeb
(
String
memberId
,
String
content
)
{
String
[]
split
=
memberId
.
split
(
"__"
);
//1.h5还是web端
String
mark
=
split
[
0
];
...
...
@@ -186,20 +186,22 @@ public class VoiceWebSocketServer {
String
name
=
split
[
1
];
if
(
mark
.
equals
(
WebSocketUtil
.
H5
)){
Map
<
String
,
String
>
map1
=
WebConnectUtil
.
getMap
();
map1
.
forEach
((
i
,
j
)->{
if
(
j
.
equals
(
name
)){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"action"
,
"reply"
);
map
.
put
(
"type"
,
"text"
);
map
.
put
(
"content"
,
content
);
String
msg
=
JSON
.
toJSONString
(
map
);
List
<
Session
>
webMap
=
WebConnectUtil
.
getWebMap
(
name
);
if
(!
webMap
.
isEmpty
()){
webMap
.
forEach
(
i
->{
try
{
session
.
getBasicRemote
().
sendText
(
msg
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 用于标识是h5端问的,web收到收展示问的内容
map
.
put
(
"action"
,
"askReply"
);
map
.
put
(
"type"
,
"text"
);
map
.
put
(
"content"
,
content
);
String
msg
=
JSON
.
toJSONString
(
map
);
i
.
getBasicRemote
().
sendText
(
msg
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
);
}
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment