Commit cf7758b9 authored by alex yao's avatar alex yao

fix: 修复AIBI 对话历史记录无保存问题

parent ec23cc35
...@@ -213,6 +213,25 @@ public class AiBiServiceImpl implements AiBiService { ...@@ -213,6 +213,25 @@ public class AiBiServiceImpl implements AiBiService {
@Override @Override
public void callV2(String dialoguesId, String input, String fileUrl, Integer[] knowledgeIds, Integer[] databaseIds, Long userId) throws Exception { public void callV2(String dialoguesId, String input, String fileUrl, Integer[] knowledgeIds, Integer[] databaseIds, Long userId) throws Exception {
// 保存对话基础信息
BizAiDialoguesEntity bizAiDialoguesEntity = new BizAiDialoguesEntity();
bizAiDialoguesEntity.setMemberId(userId);
bizAiDialoguesEntity.setDialoguesId(dialoguesId);
bizAiDialoguesEntity.setIsDeleted(CommonConstant.IsDeleted.N);
List<BizAiDialoguesEntity> bizAiDialoguesEntities = bizAiDialoguesService.findByExample(bizAiDialoguesEntity, null);
if (CollectionUtils.isEmpty(bizAiDialoguesEntities)) {
logger.error("dialogues id 不存在,请重新创建");
throw new BusinessException("对话异常");
}
// 保存标题信息
if (StringUtils.isBlank(bizAiDialoguesEntities.get(0).getTitle())) {
BizAiDialoguesEntity portalDialoguesEntity = bizAiDialoguesEntities.get(0);
portalDialoguesEntity.setTitle(input);
bizAiDialoguesService.update(portalDialoguesEntity);
}
if (databaseIds.length > 1) { if (databaseIds.length > 1) {
throw new BusinessException("仅支持单个数据库"); throw new BusinessException("仅支持单个数据库");
} }
......
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