处理数据库 复杂查询问题
This commit is contained in:
@@ -66,7 +66,7 @@ public class MentorMockChatService {
|
|||||||
String aiResponse = aiChatAbility.chat(systemPrompt, userMessage);
|
String aiResponse = aiChatAbility.chat(systemPrompt, userMessage);
|
||||||
String json = AiResponseCleanTool.clean(aiResponse);
|
String json = AiResponseCleanTool.clean(aiResponse);
|
||||||
|
|
||||||
// 5. 入库(存在则更新,不存在则插入)
|
// 5. 入库(再查一次,防止并发期间已被其他线程插入)
|
||||||
MentorMockChat existRecord = mentorMockChatMapper.selectOne(new LambdaQueryWrapper<MentorMockChat>().eq(MentorMockChat::getMentorId, mentorId));
|
MentorMockChat existRecord = mentorMockChatMapper.selectOne(new LambdaQueryWrapper<MentorMockChat>().eq(MentorMockChat::getMentorId, mentorId));
|
||||||
if (existRecord != null) {
|
if (existRecord != null) {
|
||||||
existRecord.setMessages(json);
|
existRecord.setMessages(json);
|
||||||
|
|||||||
Reference in New Issue
Block a user