Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
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
580ee3ea
Commit
580ee3ea
authored
Apr 03, 2025
by
luojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deepseek优化
parent
32eae563
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
DeepSeekAiListener.java
src/main/java/admin/listener/DeepSeekAiListener.java
+1
-1
ChatgptRoleRecordsService.java
...in/modules/chatgpt/service/ChatgptRoleRecordsService.java
+2
-2
ChatgptRoleRecordsServiceImpl.java
...s/chatgpt/service/impl/ChatgptRoleRecordsServiceImpl.java
+6
-5
ChatgptRoleRecordsController.java
src/main/java/admin/rest/ChatgptRoleRecordsController.java
+1
-2
VoiceWebSocketServer.java
src/main/java/admin/server/VoiceWebSocketServer.java
+5
-5
No files found.
src/main/java/admin/listener/DeepSeekAiListener.java
View file @
580ee3ea
...
...
@@ -92,7 +92,7 @@ public class DeepSeekAiListener extends EventSourceListener {
//存储聊天记录
chatgptRoleRecordsService
.
saveRecords
(
this
.
stringBuffer
.
toString
(),
ScreenEnum
.
getByUserName
(
maxKbChatReq
.
getUserName
()),
Integer
.
valueOf
(
maxKbChatReq
.
getSessionId
()),
10001
,
0
);
Integer
.
valueOf
(
maxKbChatReq
.
getSessionId
()),
10001
,
0
,
2
);
return
;
}
if
(
completionResponse
.
getContent
()!=
null
){
...
...
src/main/java/admin/modules/chatgpt/service/ChatgptRoleRecordsService.java
View file @
580ee3ea
...
...
@@ -89,11 +89,11 @@ public interface ChatgptRoleRecordsService extends CommonService<ChatgptRoleReco
/**
* 创建聊天记录
*/
void
saveRecords
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
);
void
saveRecords
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
depth
);
/**
* 创建聊天记录
*/
void
saveContent
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
type
,
String
content
);
void
saveContent
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
depth
,
Integer
type
,
String
content
);
}
src/main/java/admin/modules/chatgpt/service/impl/ChatgptRoleRecordsServiceImpl.java
View file @
580ee3ea
...
...
@@ -124,26 +124,27 @@ public class ChatgptRoleRecordsServiceImpl extends CommonServiceImpl<ChatgptRole
}
@Override
public
void
saveRecords
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
)
{
ChatgptRoleRecords
chatgptRoleRecords
=
createRecords
(
message
,
receiverId
,
sessionId
,
senderId
,
isAsk
);
public
void
saveRecords
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
depth
)
{
ChatgptRoleRecords
chatgptRoleRecords
=
createRecords
(
message
,
receiverId
,
sessionId
,
senderId
,
isAsk
,
depth
);
save
(
chatgptRoleRecords
);
}
@NotNull
private
static
ChatgptRoleRecords
createRecords
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
)
{
private
static
ChatgptRoleRecords
createRecords
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
depth
)
{
ChatgptRoleRecords
chatgptRoleRecords
=
new
ChatgptRoleRecords
();
chatgptRoleRecords
.
setMessage
(
message
);
chatgptRoleRecords
.
setReceiverId
(
receiverId
);
chatgptRoleRecords
.
setSessionId
(
sessionId
);
chatgptRoleRecords
.
setSenderId
(
senderId
);
chatgptRoleRecords
.
setIsAsk
(
isAsk
);
chatgptRoleRecords
.
setIsDepth
(
depth
);
chatgptRoleRecords
.
setCreateTime
(
DateUtil
.
getNowTimestamp
());
return
chatgptRoleRecords
;
}
@Override
public
void
saveContent
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
type
,
String
content
)
{
ChatgptRoleRecords
chatgptRoleRecords
=
createRecords
(
message
,
receiverId
,
sessionId
,
senderId
,
isAsk
);
public
void
saveContent
(
String
message
,
Integer
receiverId
,
Integer
sessionId
,
Integer
senderId
,
Integer
isAsk
,
Integer
depth
,
Integer
type
,
String
content
)
{
ChatgptRoleRecords
chatgptRoleRecords
=
createRecords
(
message
,
receiverId
,
sessionId
,
senderId
,
isAsk
,
depth
);
chatgptRoleRecords
.
setType
(
type
);
chatgptRoleRecords
.
setContent
(
content
);
save
(
chatgptRoleRecords
);
...
...
src/main/java/admin/rest/ChatgptRoleRecordsController.java
View file @
580ee3ea
...
...
@@ -60,13 +60,12 @@ public class ChatgptRoleRecordsController {
@ApiOperation
(
"收藏会话"
)
@GetMapping
(
value
=
"collect/list"
)
public
ApiResponse
<
Object
>
collectList
(
String
content
,
String
sessionId
,
Integer
isDepth
){
public
ApiResponse
<
Object
>
collectList
(
String
content
,
String
sessionId
){
List
<
ChatgptRoleRecords
>
list
=
chatgptRoleRecordsService
.
lambdaQuery
()
.
eq
(
ChatgptRoleRecords:
:
getMessage
,
content
)
.
eq
(
ChatgptRoleRecords:
:
getSessionId
,
sessionId
).
list
();
list
.
forEach
(
i
->{
i
.
setIsCollect
(
1
);
i
.
setIsDepth
(
isDepth
);
});
chatgptRoleRecordsService
.
updateBatchById
(
list
);
return
ApiResponse
.
buildSuccess
();
...
...
src/main/java/admin/server/VoiceWebSocketServer.java
View file @
580ee3ea
...
...
@@ -162,11 +162,11 @@ public class VoiceWebSocketServer {
chatgptRoleSessionService
.
saveRecord
(
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
webSocketModel
.
getData
(),
10001
,
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()));
chatgptRoleRecordsService
.
saveRecords
(
webSocketModel
.
getData
(),
10001
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()),
1
,
2
);
//如果是H5则发送给大屏消息
sendMsgToWeb
(
memberId
,
webSocketModel
.
getData
());
}
else
if
(
byId
!=
null
&&
"sendText"
.
equals
(
webSocketModel
.
getAction
()))
{
chatgptRoleRecordsService
.
saveRecords
(
webSocketModel
.
getData
(),
10001
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()),
1
);
chatgptRoleRecordsService
.
saveRecords
(
webSocketModel
.
getData
(),
10001
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()),
1
,
2
);
//如果是H5则发送给大屏消息
sendMsgToWeb
(
memberId
,
webSocketModel
.
getData
());
...
...
@@ -191,7 +191,7 @@ public class VoiceWebSocketServer {
webSocketModel
.
getData
(),
10001
,
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()));
}
//创建问题记录
chatgptRoleRecordsService
.
saveRecords
(
webSocketModel
.
getData
(),
10001
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()),
1
);
chatgptRoleRecordsService
.
saveRecords
(
webSocketModel
.
getData
(),
10001
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()),
1
,
1
);
PythonApiReq
pythonApiReq
=
new
PythonApiReq
();
pythonApiReq
.
setQuestion
(
webSocketModel
.
getData
());
...
...
@@ -204,7 +204,7 @@ public class VoiceWebSocketServer {
//结束标识
sendMessage
(
session
,
JSONObject
.
toJSONString
(
WebSocketModel
.
createBaseMode
(
"done"
,
"text"
,
""
)));
//存储会话记录
chatgptRoleRecordsService
.
saveContent
(
analysisData
.
getData
(),
ScreenEnum
.
getByUserName
(
memberId
.
split
(
"__"
)[
1
])
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
10001
,
0
,
analysisData
.
getDataList
()!=
null
?
1
:
0
,
analysisData
.
getDataList
());
chatgptRoleRecordsService
.
saveContent
(
analysisData
.
getData
(),
ScreenEnum
.
getByUserName
(
memberId
.
split
(
"__"
)[
1
])
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
10001
,
0
,
1
,
analysisData
.
getDataList
()!=
null
?
1
:
0
,
analysisData
.
getDataList
());
}
else
if
(
analysisData
.
getType
().
equals
(
2
)){
//左边内容
sendMessage
(
session
,
JSONObject
.
toJSONString
(
WebSocketModel
.
createChartMode
(
"reply"
,
"text"
,
analysisData
.
getData
(),
StringUtils
.
isNotBlank
(
analysisData
.
getFile
())
?
"https://newscreen.justh5.com/bg/"
+
analysisData
.
getFile
()
:
null
)));
...
...
@@ -212,7 +212,7 @@ public class VoiceWebSocketServer {
//结束标识
sendMessage
(
session
,
JSONObject
.
toJSONString
(
WebSocketModel
.
createChartMode
(
"done"
,
"chart"
,
analysisData
.
getData
(),
StringUtils
.
isNotBlank
(
analysisData
.
getFile
())
?
"https://newscreen.justh5.com/bg/"
+
analysisData
.
getFile
()
:
null
)));
//存储会话记录
chatgptRoleRecordsService
.
saveContent
(
analysisData
.
getData
(),
ScreenEnum
.
getByUserName
(
memberId
.
split
(
"__"
)[
1
]),
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
10001
,
0
,
StringUtils
.
isNotBlank
(
analysisData
.
getFile
())?
2
:
0
,
StringUtils
.
isNotBlank
(
analysisData
.
getFile
())?
"https://newscreen.justh5.com/bg/"
+
analysisData
.
getFile
():
null
);
chatgptRoleRecordsService
.
saveContent
(
analysisData
.
getData
(),
ScreenEnum
.
getByUserName
(
memberId
.
split
(
"__"
)[
1
]),
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
10001
,
0
,
1
,
StringUtils
.
isNotBlank
(
analysisData
.
getFile
())?
2
:
0
,
StringUtils
.
isNotBlank
(
analysisData
.
getFile
())?
"https://newscreen.justh5.com/bg/"
+
analysisData
.
getFile
():
null
);
}
}
...
...
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