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
cbf680d1
Commit
cbf680d1
authored
Mar 10, 2025
by
luojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deepseek优化
parent
0116b25c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
14 deletions
+29
-14
DeepSeekAiListener.java
src/main/java/admin/listener/DeepSeekAiListener.java
+12
-9
MaxKbChatReq.java
src/main/java/admin/model/MaxKbChatReq.java
+4
-0
VoiceWebSocketServer.java
src/main/java/admin/server/VoiceWebSocketServer.java
+1
-1
MaxkbOpenApiServiceImpl.java
...main/java/admin/service/impl/MaxkbOpenApiServiceImpl.java
+2
-0
ScreenEnum.java
src/main/java/admin/util/ScreenEnum.java
+10
-4
No files found.
src/main/java/admin/listener/DeepSeekAiListener.java
View file @
cbf680d1
...
@@ -8,6 +8,7 @@ import admin.modules.chatgpt.service.ChatgptRoleRecordsService;
...
@@ -8,6 +8,7 @@ import admin.modules.chatgpt.service.ChatgptRoleRecordsService;
import
admin.util.DateUtil
;
import
admin.util.DateUtil
;
import
admin.util.ScreenEnum
;
import
admin.util.ScreenEnum
;
import
admin.util.WebConnectUtil
;
import
admin.util.WebConnectUtil
;
import
admin.util.WebSocketUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
lombok.SneakyThrows
;
import
lombok.SneakyThrows
;
...
@@ -84,15 +85,17 @@ public class DeepSeekAiListener extends EventSourceListener {
...
@@ -84,15 +85,17 @@ public class DeepSeekAiListener extends EventSourceListener {
map
.
put
(
"content"
,
completionResponse
.
getContent
());
map
.
put
(
"content"
,
completionResponse
.
getContent
());
String
msg
=
JSON
.
toJSONString
(
map
);
String
msg
=
JSON
.
toJSONString
(
map
);
maxKbChatReq
.
getSession
().
getBasicRemote
().
sendText
(
msg
);
maxKbChatReq
.
getSession
().
getBasicRemote
().
sendText
(
msg
);
List
<
Session
>
webMap
=
WebConnectUtil
.
getWebMap
(
maxKbChatReq
.
getUserName
());
if
(
maxKbChatReq
.
getClient
().
equals
(
WebSocketUtil
.
H5
)){
if
(!
webMap
.
isEmpty
()){
List
<
Session
>
webMap
=
WebConnectUtil
.
getWebMap
(
maxKbChatReq
.
getUserName
());
webMap
.
forEach
(
i
->{
if
(!
webMap
.
isEmpty
()){
try
{
webMap
.
forEach
(
i
->{
i
.
getBasicRemote
().
sendText
(
msg
);
try
{
}
catch
(
IOException
e
)
{
i
.
getBasicRemote
().
sendText
(
msg
);
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
}
throw
new
RuntimeException
(
e
);
});
}
});
}
}
}
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
src/main/java/admin/model/MaxKbChatReq.java
View file @
cbf680d1
...
@@ -18,6 +18,10 @@ public class MaxKbChatReq {
...
@@ -18,6 +18,10 @@ public class MaxKbChatReq {
* sessionId用于h5获取匹配的大屏session
* sessionId用于h5获取匹配的大屏session
*/
*/
private
String
sessionId
;
private
String
sessionId
;
/**
* 客户端 H5还是web
*/
private
String
client
;
/**
/**
* maxkb会话id
* maxkb会话id
*/
*/
...
...
src/main/java/admin/server/VoiceWebSocketServer.java
View file @
cbf680d1
...
@@ -167,7 +167,7 @@ public class VoiceWebSocketServer {
...
@@ -167,7 +167,7 @@ public class VoiceWebSocketServer {
String
msg
=
webSocketModel
.
getData
();
String
msg
=
webSocketModel
.
getData
();
if
(
msg
!=
null
&&
!
msg
.
isEmpty
())
{
if
(
msg
!=
null
&&
!
msg
.
isEmpty
())
{
String
showType
=
getShowType
(
msg
);
String
showType
=
getShowType
(
msg
);
SendSseModel
sendSseModel
=
new
SendSseModel
(
msg
,
webSocketModel
.
getSessionId
(),
session
,
webSocketModel
.
getName
(),
memberId
.
split
(
"__"
)[
0
].
equals
(
WebSocketUtil
.
web
),
showType
);
SendSseModel
sendSseModel
=
new
SendSseModel
(
msg
,
webSocketModel
.
getSessionId
(),
session
,
webSocketModel
.
getName
(),
memberId
.
split
(
"__"
)[
0
].
equals
(
WebSocketUtil
.
H5
),
showType
);
maxkbOpenApiService
.
talk
(
sendSseModel
);
maxkbOpenApiService
.
talk
(
sendSseModel
);
}
}
// 心跳
// 心跳
...
...
src/main/java/admin/service/impl/MaxkbOpenApiServiceImpl.java
View file @
cbf680d1
...
@@ -10,6 +10,7 @@ import admin.modules.chatgpt.service.ChatgptRoleRecordsService;
...
@@ -10,6 +10,7 @@ import admin.modules.chatgpt.service.ChatgptRoleRecordsService;
import
admin.resp.ApiResponse
;
import
admin.resp.ApiResponse
;
import
admin.service.MaxkbOpenApiService
;
import
admin.service.MaxkbOpenApiService
;
import
admin.util.HttpUtil
;
import
admin.util.HttpUtil
;
import
admin.util.WebSocketUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
...
@@ -63,6 +64,7 @@ public class MaxkbOpenApiServiceImpl implements MaxkbOpenApiService {
...
@@ -63,6 +64,7 @@ public class MaxkbOpenApiServiceImpl implements MaxkbOpenApiService {
maxKbChatReq
.
setSessionId
(
sendSseModel
.
getSessionId
());
maxKbChatReq
.
setSessionId
(
sendSseModel
.
getSessionId
());
maxKbChatReq
.
setUserName
(
sendSseModel
.
getUserName
());
maxKbChatReq
.
setUserName
(
sendSseModel
.
getUserName
());
maxKbChatReq
.
setShowType
(
sendSseModel
.
getShowType
());
maxKbChatReq
.
setShowType
(
sendSseModel
.
getShowType
());
maxKbChatReq
.
setClient
(
sendSseModel
.
isH5
()
?
WebSocketUtil
.
H5
:
WebSocketUtil
.
web
);
maxKbChatReq
.
setSession
(
sendSseModel
.
getSeesion
());
maxKbChatReq
.
setSession
(
sendSseModel
.
getSeesion
());
chatCompletions
(
maxKbChatReq
);
chatCompletions
(
maxKbChatReq
);
}
}
...
...
src/main/java/admin/util/ScreenEnum.java
View file @
cbf680d1
...
@@ -5,7 +5,9 @@ import lombok.Data;
...
@@ -5,7 +5,9 @@ import lombok.Data;
import
lombok.Getter
;
import
lombok.Getter
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author lj
* @author lj
...
@@ -57,13 +59,17 @@ public enum ScreenEnum {
...
@@ -57,13 +59,17 @@ public enum ScreenEnum {
return
ScreenEnum
.
ALL_PARK
.
userId
;
return
ScreenEnum
.
ALL_PARK
.
userId
;
}
}
public
static
List
<
ScreenEnum
>
getScreen
(){
public
static
List
<
Map
<
String
,
Object
>
>
getScreen
(){
List
<
ScreenEnum
>
list
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>
>
list
=
new
ArrayList
<>();
for
(
ScreenEnum
value:
ScreenEnum
.
values
()){
for
(
ScreenEnum
value:
ScreenEnum
.
values
()){
if
(
value
.
isShow
.
equals
(
1
)){
if
(
value
.
isShow
.
equals
(
1
)){
list
.
add
(
value
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
value
.
name
);
map
.
put
(
"userId"
,
value
.
userId
);
map
.
put
(
"isShow"
,
value
.
isShow
);
map
.
put
(
"screenName"
,
value
.
screenName
);
list
.
add
(
map
);
}
}
}
}
return
list
;
return
list
;
}
}
...
...
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