Commit e007eca7 authored by luojun's avatar luojun

响应修改

parent 58e6942a
...@@ -80,7 +80,14 @@ public class DeepSeekAiListener extends EventSourceListener { ...@@ -80,7 +80,14 @@ 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);
this.session.getBasicRemote().sendText(msg); this.session.getBasicRemote().sendText(msg);
// textToSpeechService.convertTextToSpeech(this.stringBuffer.toString()); //存储聊天记录
ChatgptRoleRecords chatgptRoleRecords = new ChatgptRoleRecords();
chatgptRoleRecords.setMessage(this.stringBuffer.toString());
chatgptRoleRecords.setReceiverId(ScreenEnum.getByUserName(userName));
chatgptRoleRecords.setSessionId(Integer.valueOf(sessionId));
chatgptRoleRecords.setSenderId(10001);
chatgptRoleRecords.setCreateTime(DateUtil.getNowTimestamp());
chatgptRoleRecordsService.save(chatgptRoleRecords);
return; return;
} }
if (completionResponse.getContent()!=null){ if (completionResponse.getContent()!=null){
...@@ -103,14 +110,6 @@ public class DeepSeekAiListener extends EventSourceListener { ...@@ -103,14 +110,6 @@ public class DeepSeekAiListener extends EventSourceListener {
}); });
} }
} }
//存储聊天记录
ChatgptRoleRecords chatgptRoleRecords = new ChatgptRoleRecords();
chatgptRoleRecords.setMessage(this.stringBuffer.toString());
chatgptRoleRecords.setReceiverId(ScreenEnum.getByUserName(userName));
chatgptRoleRecords.setSessionId(Integer.valueOf(sessionId));
chatgptRoleRecords.setSenderId(10001);
chatgptRoleRecords.setCreateTime(DateUtil.getNowTimestamp());
chatgptRoleRecordsService.save(chatgptRoleRecords);
}catch (Exception e){ }catch (Exception e){
System.out.println(e.getMessage()); System.out.println(e.getMessage());
} }
......
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