package com.lingyue.extract.dto.config;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 文档来源配置
 * 
 * 用于 sourceType = "document" 的规则
 * 
 * @author lingyue
 * @since 2026-01-22
 */
@Data
@Schema(description = "文档来源配置")
public class DocumentSourceConfig {
    
    @Schema(description = "来源文档ID（SourceDocument.id）")
    private String sourceDocId;
    
    @Schema(description = "定位配置")
    private LocationConfig location;
    
    @Schema(description = "是否包含整个定位范围的内容")
    private Boolean includeFullRange;
    
    @Schema(description = "内容预处理选项")
    private PreprocessConfig preprocess;
    
    /**
     * 内容预处理配置
     */
    @Data
    @Schema(description = "内容预处理配置")
    public static class PreprocessConfig {
        
        @Schema(description = "去除首尾空白")
        private Boolean trimWhitespace;
        
        @Schema(description = "移除换行符")
        private Boolean removeLineBreaks;
        
        @Schema(description = "合并连续空格")
        private Boolean mergeSpaces;
        
        @Schema(description = "最大内容长度（用于AI调用时截断）")
        private Integer maxLength;
    }
}
