package com.ruoyi.web.modules.industryservice.support;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 第三方生产管理系统（牧场、牦牛资产等同源开放接口）共用连接配置。
 * <p>
 * 前缀 {@code third-party.farming}；各业务客户端仅使用各自 API 路径，共享 baseUrl 与鉴权。
 * </p>
 */
@Component
@ConfigurationProperties(prefix = "third-party.farming")
public class ThirdPartyFarmingProperties
{
    /** 拉取模式：stub=classpath 样例 JSON，http=调用远程开放接口 */
    private String mode = "stub";

    /** 是否允许执行同步；false 时各同步接口收到「第三方…同步未启用」 */
    private boolean enabled = true;

    /** 第三方服务根地址（不含路径），如 https://api.example.com */
    private String baseUrl = "";

    /** 请求头 X-App-Key */
    private String appKey = "";

    /** 请求头 X-App-Secret */
    private String appSecret = "";

    /** HTTP 连接超时（毫秒） */
    private int connectTimeoutMs = 15000;

    /** HTTP 读取超时（毫秒），全量分页拉取时宜适当加大 */
    private int readTimeoutMs = 120000;

    /** 分页 pageSize，接口上限 200 */
    private int pageSize = 200;

    public String getMode()
    {
        return mode;
    }

    public void setMode(String mode)
    {
        this.mode = mode;
    }

    public boolean isEnabled()
    {
        return enabled;
    }

    public void setEnabled(boolean enabled)
    {
        this.enabled = enabled;
    }

    public String getBaseUrl()
    {
        return baseUrl;
    }

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

    public String getAppKey()
    {
        return appKey;
    }

    public void setAppKey(String appKey)
    {
        this.appKey = appKey;
    }

    public String getAppSecret()
    {
        return appSecret;
    }

    public void setAppSecret(String appSecret)
    {
        this.appSecret = appSecret;
    }

    public int getConnectTimeoutMs()
    {
        return connectTimeoutMs;
    }

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

    public int getReadTimeoutMs()
    {
        return readTimeoutMs;
    }

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

    public int getPageSize()
    {
        return pageSize;
    }

    public void setPageSize(int pageSize)
    {
        this.pageSize = pageSize;
    }
}
