package com.easyagents.document.core.mineru;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * MinerU 文档解析配置。
 *
 * @author Codex
 * @since 2026-04-16
 */
public class MineruProperties {

    private String baseUrl;
    private Integer connectTimeoutMs = 3000;
    private Integer readTimeoutMs = 600000;
    private Integer writeTimeoutMs = 600000;
    private Integer submitTimeoutMs = 120000;
    private Integer pollIntervalMs = 1000;
    private Integer resultTimeoutMs = 1800000;
    private String defaultBackend = "vlm-http-client";
    private String defaultParseMethod = "auto";
    private List<String> defaultLangList = new ArrayList<String>(Arrays.asList("ch"));
    private Boolean defaultFormulaEnable = true;
    private Boolean defaultTableEnable = true;

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public Integer getConnectTimeoutMs() {
        return connectTimeoutMs;
    }

    public void setConnectTimeoutMs(Integer connectTimeoutMs) {
        this.connectTimeoutMs = connectTimeoutMs;
    }

    public Integer getReadTimeoutMs() {
        return readTimeoutMs;
    }

    public void setReadTimeoutMs(Integer readTimeoutMs) {
        this.readTimeoutMs = readTimeoutMs;
    }

    public Integer getWriteTimeoutMs() {
        return writeTimeoutMs;
    }

    public void setWriteTimeoutMs(Integer writeTimeoutMs) {
        this.writeTimeoutMs = writeTimeoutMs;
    }

    /**
     * 获取异步任务提交总超时时间。
     *
     * @return 提交总超时时间，单位毫秒
     */
    public Integer getSubmitTimeoutMs() {
        return submitTimeoutMs;
    }

    /**
     * 设置异步任务提交总超时时间。
     *
     * @param submitTimeoutMs 提交总超时时间，单位毫秒
     */
    public void setSubmitTimeoutMs(Integer submitTimeoutMs) {
        this.submitTimeoutMs = submitTimeoutMs;
    }

    public Integer getPollIntervalMs() {
        return pollIntervalMs;
    }

    public void setPollIntervalMs(Integer pollIntervalMs) {
        this.pollIntervalMs = pollIntervalMs;
    }

    public Integer getResultTimeoutMs() {
        return resultTimeoutMs;
    }

    public void setResultTimeoutMs(Integer resultTimeoutMs) {
        this.resultTimeoutMs = resultTimeoutMs;
    }

    public String getDefaultBackend() {
        return defaultBackend;
    }

    public void setDefaultBackend(String defaultBackend) {
        this.defaultBackend = defaultBackend;
    }

    public String getDefaultParseMethod() {
        return defaultParseMethod;
    }

    public void setDefaultParseMethod(String defaultParseMethod) {
        this.defaultParseMethod = defaultParseMethod;
    }

    public List<String> getDefaultLangList() {
        return defaultLangList;
    }

    public void setDefaultLangList(List<String> defaultLangList) {
        this.defaultLangList = defaultLangList == null
            ? new ArrayList<String>(Arrays.asList("ch"))
            : defaultLangList;
    }

    public Boolean getDefaultFormulaEnable() {
        return defaultFormulaEnable;
    }

    public void setDefaultFormulaEnable(Boolean defaultFormulaEnable) {
        this.defaultFormulaEnable = defaultFormulaEnable;
    }

    public Boolean getDefaultTableEnable() {
        return defaultTableEnable;
    }

    public void setDefaultTableEnable(Boolean defaultTableEnable) {
        this.defaultTableEnable = defaultTableEnable;
    }
}
