|
@@ -678,16 +678,17 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void genTitleSync(String messageId, String carid, String userToken) {
|
|
|
|
|
|
|
+ public void genTitleSync(String conversationId, String carid, String userToken) {
|
|
|
//同步对话
|
|
//同步对话
|
|
|
- if (!StringUtils.isAnyBlank(messageId, carid, userToken)) {
|
|
|
|
|
- ChatgptUserConversation conversation = chatgptUserConversationMapper.selectOne(Wrappers.lambdaQuery(ChatgptUserConversation.class).eq(ChatgptUserConversation::getMessageId, messageId).last(" limit 1"));
|
|
|
|
|
-
|
|
|
|
|
- chatgptUserConversationRecordMapper.update(null, Wrappers.lambdaUpdate(ChatgptUserConversationRecord.class)
|
|
|
|
|
- .set(ChatgptUserConversationRecord::getConversationId, conversation.getConversationId())
|
|
|
|
|
- .eq(ChatgptUserConversationRecord::getMessageId, messageId)
|
|
|
|
|
|
|
+ if (!StringUtils.isAnyBlank(conversationId, carid, userToken)) {
|
|
|
|
|
+ ChatgptUserConversationRecord chatgptUserConversationRecord = chatgptUserConversationRecordMapper.selectOne(Wrappers.lambdaQuery(ChatgptUserConversationRecord.class)
|
|
|
|
|
+ .isNull(ChatgptUserConversationRecord::getConversationId)
|
|
|
.eq(ChatgptUserConversationRecord::getCarId, carid)
|
|
.eq(ChatgptUserConversationRecord::getCarId, carid)
|
|
|
- .eq(ChatgptUserConversationRecord::getUserToken, userToken));
|
|
|
|
|
|
|
+ .eq(ChatgptUserConversationRecord::getUserToken, userToken)
|
|
|
|
|
+ .orderByDesc(ChatgptUserConversationRecord::getId)
|
|
|
|
|
+ .last(" limit 1"));
|
|
|
|
|
+ chatgptUserConversationRecord.setConversationId(conversationId);
|
|
|
|
|
+ chatgptUserConversationRecordMapper.updateById(chatgptUserConversationRecord);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|