fix(ai-chat): 优化引用文档ID处理支持字符串数组类型
- 将数据库中 referenced_doc_ids 字段从 BIGINT[] 修改为 VARCHAR(255)[] - 在实体类 AiChatMessage 中将 referencedDocIds 类型改为 String[] 并添加自定义类型处理器 - 新增 PostgresArrayTypeHandler 用于处理 PostgreSQL varchar 数组与 Java String[] 的映射 - 修改查询时 project_id 和 timeline_node_id 的过滤表达式,使用字符串匹配避免类型错误 - AiChatServiceImpl 中保存消息时改用字符串数组保存引用文档ID - KbDocumentVO 新增 fileUrl 字段映射数据库中对应字段 - 数据库映射文件 AiDocumentMapper.xml 增加 file_url 字段映射
This commit is contained in:
@@ -1106,7 +1106,7 @@ CREATE TABLE ai_chat_history (
|
||||
content_embedding vector(1024),
|
||||
|
||||
-- 引用的知识库文档
|
||||
referenced_doc_ids BIGINT[],
|
||||
referenced_doc_ids VARCHAR(255)[],
|
||||
|
||||
-- 上下文配置
|
||||
system_prompt TEXT,
|
||||
|
||||
Reference in New Issue
Block a user