package com.cy.guoyan.admin.module.ai.controller.admin.chatdocument.vo;

import lombok.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.cy.guoyan.admin.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

import static com.cy.guoyan.admin.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 知识库文档分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ChatDocumentPageReqVO extends PageParam {

    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime[] createTime;

    @Schema(description = "源文档 ID（更新时使用）", example = "13509")
    private String difyDocumentId;

    @Schema(description = "源文档 ID（更新时使用）", example = "13509")
    private String ragflowDocumentId;

    @Schema(description = "知识库 ID", example = "26727")
    private Integer datasetId;


    @Schema(description = "批次号")
    private String batch;

    @Schema(description = "数据来源类型（file_upload/api 等）", example = "1")
    private String dataSourceType;

    @Schema(description = "来源信息（JSON）")
    private String dataSourceInfo;

    @Schema(description = "处理规则 ", example = "23828")
    private String processRuleMode;

    @Schema(description = "文档名称", example = "木易")
    private String name;

    @Schema(description = "文件大小")
    private String fileSize;


    @Schema(description = "文件配置")
    private Long fileConfId;


    @Schema(description = "文件路径")
    private String filePath;


    @Schema(description = "创建来源（upload/api）")
    private String createdFrom;

    @Schema(description = "创建者")
    private String createdBy;

    @Schema(description = "创建时间（业务）")
    private LocalDateTime createdAt;

    @Schema(description = "总 Token 数")
    private Integer tokens;

    @Schema(description = "文档字数", example = "25319")
    private Integer wordCount;

    @Schema(description = "分段数", requiredMode = Schema.RequiredMode.REQUIRED, example = "25319")
    private Integer completedSegments;

    @Schema(description = "命中次数", example = "26583")
    private Integer hitCount;

    @Schema(description = "索引状态（waiting/indexing/completed/failed）", example = "2")
    private String indexingStatus;

    /**
     * 解析状态枚举：
     * – "0" / "UNSTART"：未开始
     * – "1" / "RUNNING"：进行中
     * – "2" / "DONE"：完成
     * – "3" / "FAIL"：失败
     */
    private String ragflowStatus;

    @Schema(description = "显示状态（queuing/processing/ready 等）", example = "2")
    private String displayStatus;

    @Schema(description = "错误信息")
    private String error;

    @Schema(description = "是否启用")
    private Boolean enabled;

    @Schema(description = "禁用时间")
    private LocalDateTime disabledAt;

    @Schema(description = "禁用者")
    private String disabledBy;

    @Schema(description = "是否归档")
    private Boolean archived;

    @Schema(description = "索引方式（high_quality/economy）")
    private String indexingTechnique;

    @Schema(description = "文档形式（text_model/hierarchical_model/qa_model）")
    private String docForm;

    @Schema(description = "文档语言（qa_model 模式下）")
    private String docLanguage;

    @Schema(description = "清洗 & 分段规则（JSON）")
    private String processRule;

    @Schema(description = "检索模型配置（首次上传使用）")
    private String retrievalModel;

    @Schema(description = "Embedding 模型名称")
    private String embeddingModel;

    @Schema(description = "Embedding 模型提供商")
    private String embeddingModelProvider;

}