package com.pavis.admin.aigc.model.entity;

import lombok.Data;

import com.baomidou.mybatisplus.annotation.TableName;

import com.pavis.admin.common.model.entity.BaseDO;

import java.io.Serial;

/**
 * 智能文档实体
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Data
@TableName("aigc_doc")
public class DocDO extends BaseDO {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 所属知识库ID
     */
    private Long knowledgeId;

    /**
     * 文档名称
     */
    private String name;

    /**
     * 文件类型
     */
    private String fileType;

    /**
     * MIME类型
     */
    private String mimeType;

    /**
     * 文件编码
     */
    private String fileEncoding;

    /**
     * 文件哈希
     */
    private String fileHash;

    /**
     * 文件大小
     */
    private Long fileSize;

    /**
     * 存储路径
     */
    private String storagePath;

    /**
     * 存储区域
     */
    private String storageRegion;

    /**
     * 解析后文本
     */
    private String parsedContent;

    /**
     * 原始文件内容
     */
    private String originalContent;

    /**
     * 元数据 {
     * "author": "张三",
     * "pages": 42,
     * "language": "zh",
     * "created_time": "2023-01-01"
     * }
     */
    private String metadata;

    /**
     * 处理状态:uploaded/parsing/parsed/failed
     */
    private String processingStatus;

    /**
     * 切片配置 {
     * "strategy":"auto",
     * "chunk_size":1000,
     * "overlap":50
     * }
     */
    private String chunkConfig;

    /**
     * 切片详情 [
     * {"id":1,"content":"...","vectors":32},
     * {"id":2,"content":"...","vectors":28}
     * ]
     */
    private String chunkDetails;

    /**
     * 向量化状态:pending/processing/completed/failed
     */
    private String vectorStatus;

    /**
     * 错误日志
     */
    private String errorLog;

    /**
     * 重试次数
     */
    private Integer retryCount;

    /**
     * 敏感内容标记
     */
    private Boolean isSensitive;

    /**
     * 文档版本
     */
    private Integer version;

    /**
     * 切片数量
     */
    private Integer sliceNum;
}
