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
b6fb971e
Commit
b6fb971e
authored
Apr 03, 2025
by
luojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deepseek优化
parent
071edf96
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
7 deletions
+17
-7
WebSocketModel.java
src/main/java/admin/model/WebSocketModel.java
+2
-2
ChatgptRoleRecords.java
...java/admin/modules/chatgpt/domain/ChatgptRoleRecords.java
+2
-0
ChatgptRoleRecordsDto.java
...in/modules/chatgpt/service/dto/ChatgptRoleRecordsDto.java
+4
-0
ChatgptRoleRecordsController.java
src/main/java/admin/rest/ChatgptRoleRecordsController.java
+5
-2
VoiceWebSocketServer.java
src/main/java/admin/server/VoiceWebSocketServer.java
+4
-3
No files found.
src/main/java/admin/model/WebSocketModel.java
View file @
b6fb971e
...
...
@@ -93,9 +93,9 @@ public class WebSocketModel {
return
baseMode
;
}
public
static
WebSocketModel
createDataList
(
String
action
,
String
type
,
String
content
)
{
public
static
WebSocketModel
createDataList
(
String
action
,
String
type
,
String
content
,
String
dataList
)
{
WebSocketModel
baseMode
=
createBaseMode
(
action
,
type
,
content
);
baseMode
.
setDataList
(
conten
t
);
baseMode
.
setDataList
(
dataLis
t
);
return
baseMode
;
}
}
src/main/java/admin/modules/chatgpt/domain/ChatgptRoleRecords.java
View file @
b6fb971e
...
...
@@ -58,6 +58,8 @@ public class ChatgptRoleRecords implements Serializable {
@ApiModelProperty
(
value
=
"内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"1-深度分析 2-普通问答"
)
private
Integer
isDepth
;
public
void
copyFrom
(
ChatgptRoleRecords
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
...
...
src/main/java/admin/modules/chatgpt/service/dto/ChatgptRoleRecordsDto.java
View file @
b6fb971e
...
...
@@ -59,4 +59,8 @@ public class ChatgptRoleRecordsDto implements Serializable {
* 内容
*/
private
String
content
;
/**
* 1-深度 2-普通问答
*/
private
Integer
isDepth
;
}
src/main/java/admin/rest/ChatgptRoleRecordsController.java
View file @
b6fb971e
...
...
@@ -60,11 +60,14 @@ public class ChatgptRoleRecordsController {
@ApiOperation
(
"收藏会话"
)
@GetMapping
(
value
=
"collect/list"
)
public
ApiResponse
<
Object
>
collectList
(
String
content
,
String
sessionId
){
public
ApiResponse
<
Object
>
collectList
(
String
content
,
String
sessionId
,
Integer
isDepth
){
List
<
ChatgptRoleRecords
>
list
=
chatgptRoleRecordsService
.
lambdaQuery
()
.
eq
(
ChatgptRoleRecords:
:
getMessage
,
content
)
.
eq
(
ChatgptRoleRecords:
:
getSessionId
,
sessionId
).
list
();
list
.
forEach
(
i
->
i
.
setIsCollect
(
1
));
list
.
forEach
(
i
->{
i
.
setIsCollect
(
1
);
i
.
setIsDepth
(
isDepth
);
});
chatgptRoleRecordsService
.
updateBatchById
(
list
);
return
ApiResponse
.
buildSuccess
();
}
...
...
src/main/java/admin/server/VoiceWebSocketServer.java
View file @
b6fb971e
...
...
@@ -189,15 +189,16 @@ public class VoiceWebSocketServer {
if
(
byId
==
null
){
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
);
}
//创建问题记录
chatgptRoleRecordsService
.
saveRecords
(
webSocketModel
.
getData
(),
10001
,
Integer
.
valueOf
(
webSocketModel
.
getSessionId
()),
ScreenEnum
.
getByUserName
(
webSocketModel
.
getName
()),
1
);
PythonApiReq
pythonApiReq
=
new
PythonApiReq
();
pythonApiReq
.
setQuestion
(
webSocketModel
.
getData
());
PythonResp
analysisData
=
pythonOpenApiClient
.
getAnalysisData
(
pythonApiReq
);
if
(
analysisData
.
getType
().
equals
(
1
))
{
//左边内容
sendMessage
(
session
,
JSONObject
.
toJSONString
(
WebSocketModel
.
createDataList
(
"reply"
,
"text"
,
analysisData
.
getData
())));
sendMessage
(
session
,
JSONObject
.
toJSONString
(
WebSocketModel
.
createDataList
(
"reply"
,
"text"
,
analysisData
.
getData
()
,
analysisData
.
getDataList
()
)));
//右边内容
sendMessage
(
session
,
JSONObject
.
toJSONString
(
WebSocketModel
.
createBaseMode
(
"rightReply"
,
"text"
,
analysisData
.
getDataList
())));
//结束标识
...
...
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