package org.xyzh.common.dto.ai;

import org.xyzh.common.dto.BaseDTO;

/**
 * @description 知识库表
 * @filename TbAiKnowledge.java
 * @author yslg
 * @copyright xyzh
 * @since 2025-10-15
 */
public class TbAiKnowledge extends BaseDTO {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * @description 知识库标题
     */
    private String title;
    
    /**
     * @description 知识库头像
     */
    private String avatar;
    
    /**
     * @description 知识库描述
     */
    private String description;
    
    /**
     * @description 知识内容（手动添加时使用）
     */
    private String content;
    
    /**
     * @description 来源类型（1手动添加 2文件导入 3资源同步）
     */
    private Integer sourceType;
    
    /**
     * @description 来源ID
     */
    private String sourceID;
    
    /**
     * @description 文件名
     */
    private String fileName;
    
    /**
     * @description 文件路径
     */
    private String filePath;
    
    /**
     * @description 分类
     */
    private String category;
    
    /**
     * @description 标签（JSON数组）
     */
    private String tags;
    
    /**
     * @description Dify知识库ID（Dataset ID）
     */
    private String difyDatasetId;
    
    /**
     * @description Dify索引方式（high_quality/economy）
     */
    private String difyIndexingTechnique;
    
    /**
     * @description 向量模型名称
     */
    private String embeddingModel;
    
    /**
     * @description 向量模型提供商
     */
    private String embeddingModelProvider;
    
    /**
     * @description Rerank模型名称
     */
    private String rerankModel;
    
    /**
     * @description Rerank模型提供商
     */
    private String rerankModelProvider;
    
    /**
     * @description 是否启用Rerank
     */
    private Boolean rerankingEnable;
    
    /**
     * @description 检索Top K（返回前K个结果）
     */
    private Integer retrievalTopK;
    
    /**
     * @description 检索分数阈值（0.00-1.00）
     */
    private Double retrievalScoreThreshold;
    
    /**
     * @description 向量ID（用于向量检索）
     */
    private String vectorID;
    
    /**
     * @description 文档数量
     */
    private Integer documentCount;
    
    /**
     * @description 总分段数
     */
    private Integer totalChunks;
    
    /**
     * @description 状态（0禁用 1启用 2处理中）
     */
    private Integer status;
    
    /**
     * @description 创建者（用户ID）
     */
    private String creator;
    
    /**
     * @description 创建者部门ID
     */
    private String creatorDept;
    
    /**
     * @description 更新者
     */
    private String updater;

    // ========== 权限相关字段（不映射到数据库） ==========
    
    /**
     * @description 权限类型（all/dept/role/custom）
     */
    private transient String permissionType;
    
    /**
     * @description 是否可读
     */
    private transient Boolean canRead;
    
    /**
     * @description 是否可写
     */
    private transient Boolean canWrite;
    
    /**
     * @description 是否可删除
     */
    private transient Boolean canDelete;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getSourceType() {
        return sourceType;
    }

    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }

    public String getSourceID() {
        return sourceID;
    }

    public void setSourceID(String sourceID) {
        this.sourceID = sourceID;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getDifyDatasetId() {
        return difyDatasetId;
    }

    public void setDifyDatasetId(String difyDatasetId) {
        this.difyDatasetId = difyDatasetId;
    }

    public String getDifyIndexingTechnique() {
        return difyIndexingTechnique;
    }

    public void setDifyIndexingTechnique(String difyIndexingTechnique) {
        this.difyIndexingTechnique = difyIndexingTechnique;
    }

    public String getEmbeddingModel() {
        return embeddingModel;
    }

    public void setEmbeddingModel(String embeddingModel) {
        this.embeddingModel = embeddingModel;
    }

    public String getVectorID() {
        return vectorID;
    }

    public void setVectorID(String vectorID) {
        this.vectorID = vectorID;
    }

    public Integer getDocumentCount() {
        return documentCount;
    }

    public void setDocumentCount(Integer documentCount) {
        this.documentCount = documentCount;
    }

    public Integer getTotalChunks() {
        return totalChunks;
    }

    public void setTotalChunks(Integer totalChunks) {
        this.totalChunks = totalChunks;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getCreatorDept() {
        return creatorDept;
    }

    public void setCreatorDept(String creatorDept) {
        this.creatorDept = creatorDept;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public String getEmbeddingModelProvider() {
        return embeddingModelProvider;
    }
    public void setEmbeddingModelProvider(String embeddingModelProvider) {
        this.embeddingModelProvider = embeddingModelProvider;
    }

    public String getRerankModel() {
        return rerankModel;
    }

    public void setRerankModel(String rerankModel) {
        this.rerankModel = rerankModel;
    }

    public String getRerankModelProvider() {
        return rerankModelProvider;
    }

    public void setRerankModelProvider(String rerankModelProvider) {
        this.rerankModelProvider = rerankModelProvider;
    }

    public Boolean getRerankingEnable() {
        return rerankingEnable;
    }

    public void setRerankingEnable(Boolean rerankingEnable) {
        this.rerankingEnable = rerankingEnable;
    }

    public Integer getRetrievalTopK() {
        return retrievalTopK;
    }

    public void setRetrievalTopK(Integer retrievalTopK) {
        this.retrievalTopK = retrievalTopK;
    }

    public Double getRetrievalScoreThreshold() {
        return retrievalScoreThreshold;
    }

    public void setRetrievalScoreThreshold(Double retrievalScoreThreshold) {
        this.retrievalScoreThreshold = retrievalScoreThreshold;
    }

    public String getPermissionType() {
        return permissionType;
    }

    public void setPermissionType(String permissionType) {
        this.permissionType = permissionType;
    }

    public Boolean getCanRead() {
        return canRead;
    }

    public void setCanRead(Boolean canRead) {
        this.canRead = canRead;
    }

    public Boolean getCanWrite() {
        return canWrite;
    }

    public void setCanWrite(Boolean canWrite) {
        this.canWrite = canWrite;
    }

    public Boolean getCanDelete() {
        return canDelete;
    }

    public void setCanDelete(Boolean canDelete) {
        this.canDelete = canDelete;
    }

    @Override
    public String toString() {
        return "TbAiKnowledge{" +
                "id=" + getID() +
                ", title='" + title + '\'' +
                ", sourceType=" + sourceType +
                ", category='" + category + '\'' +
                ", status=" + status +
                ", createTime=" + getCreateTime() +
                '}';
    }
}
