Files
ylhp-ai-project-manager/src/main/java/cn/yinlihupo/domain/entity/AiDocument.java
JiaoTianBo 06d82187ff refactor(ai-chat): 将会话ID类型统一由UUID改为字符串类型
- 修改AiChat相关实体、VO及Mapper中sessionId字段类型为String
- 调整AiChatController接口,支持字符串类型sessionId参数
- 修改AiChatService及实现类中相关方法的sessionId参数类型
- 更新业务逻辑中sessionId的处理,移除UUID转换操作

feat(vector-store): 添加文件访问URL字段及切片更新接口

- 在vector_store表及对应实体中新增file_url字段
- 增加AiDocument的fileUrl字段,保存文件访问链接
- 在DocumentProcessor处理切片时更新file_url字段
- 添加AiDocumentMapper中updateChunkFields接口及XML实现

feat(attachment): 知识库文件上传支持记录文件附件

- 新增FileAttachment实体及Mapper,保存上传文件元信息
- 在AiKnowledgeBaseServiceImpl实现文件上传后保存附件记录
- 上传接口返回文件URL并保存到文档和附件表中
2026-03-30 18:35:20 +08:00

194 lines
3.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package cn.yinlihupo.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* 向量存储实体
* 对应 vector_store 表
* 兼容 Spring AI PgVectorStore 默认结构
*/
@Data
@TableName("vector_store")
public class AiDocument {
/**
* 文档ID字符串类型兼容PgVectorStore
* 使用标准UUID格式带连字符
*/
@TableId(type = IdType.INPUT)
private String id;
/**
* 关联项目ID
*/
private Long projectId;
/**
* 关联时间节点ID
*/
private Long timelineNodeId;
/**
* 关联知识库ID
*/
private Long kbId;
/**
* 来源类型: project-项目文档, risk-风险文档, ticket-工单,
* report-日报, upload-上传文件, knowledge-知识库, chat-对话记录
*/
private String sourceType;
/**
* 来源记录ID
*/
private Long sourceId;
/**
* 文档标题
*/
private String title;
/**
* 文档内容(纯文本)
*/
private String content;
/**
* 原始内容(带格式)
*/
private String contentRaw;
/**
* AI生成的摘要
*/
private String summary;
/**
* 向量嵌入(存储为字符串实际由pgvector处理)
*/
private String embedding;
/**
* 文档类型: requirement-需求, design-设计, plan-计划,
* report-报告, contract-合同, photo-照片, other-其他
*/
private String docType;
/**
* 语言: zh-中文, en-英文
*/
private String language;
/**
* 文件类型: pdf, doc, txt, md, jpg, png等
*/
private String fileType;
/**
* 文件大小(字节)
*/
private Long fileSize;
/**
* 文件存储路径
*/
private String filePath;
/**
* 文件访问URL
*/
private String fileUrl;
/**
* 文档日期(如日报日期、照片拍摄日期)
*/
private LocalDate docDate;
/**
* 文档时间戳
*/
private LocalDateTime docDatetime;
/**
* 分块序号
*/
private Integer chunkIndex;
/**
* 总分块数
*/
private Integer chunkTotal;
/**
* 父文档ID(分块时使用)
*/
private String chunkParentId;
/**
* 标签数组(JSON)
*/
private String tags;
/**
* 分类
*/
private String category;
/**
* 查看次数
*/
private Integer viewCount;
/**
* 被检索次数
*/
private Integer queryCount;
/**
* 最后被检索时间
*/
private LocalDateTime lastQueriedAt;
/**
* 状态: active-可用, processing-处理中, error-错误, archived-归档
*/
private String status;
/**
* 错误信息
*/
private String errorMessage;
/**
* 创建人ID
*/
private Long createBy;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 更新人ID
*/
private Long updateBy;
/**
* 更新时间
*/
private LocalDateTime updateTime;
/**
* 删除标记
*/
private Integer deleted;
}