Commit b6fb971e authored by luojun's avatar luojun

deepseek优化

parent 071edf96
......@@ -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(content);
baseMode.setDataList(dataList);
return baseMode;
}
}
......@@ -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));
}
......
......@@ -59,4 +59,8 @@ public class ChatgptRoleRecordsDto implements Serializable {
* 内容
*/
private String content;
/**
* 1-深度 2-普通问答
*/
private Integer isDepth;
}
......@@ -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();
}
......
......@@ -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())));
//结束标识
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment