package com.ruoyi.web.modules.screen.mallstats;

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

/**
 * 大屏对接农资商城 Open Stats 配置 {@code bigscreen.mall-stats.*}
 */
@ConfigurationProperties(prefix = "bigscreen.mall-stats")
public class MallStatsOpenProperties
{
    /** 是否启用商城统计拉取；false 时客户端直接返回 null */
    private boolean enabled = false;

    /** 农资商城根地址，如 http://host:8020 */
    private String baseUrl = "";

    /** Open API Token AES 密钥，须与商城侧一致 */
    private String aesKey = "mdYJB5ENzTwEbql2";

    /** Open API Token AES IV，须与商城侧一致 */
    private String aesIv = "FU2GR30Iw76PjXbO";

    private int connectTimeoutMs = 5000;

    private int readTimeoutMs = 15000;

    /** 本地 Redis 缓存 overview 结果（分钟） */
    private int cacheTtlMinutes = 5;

    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 getAesKey()
    {
        return aesKey;
    }

    public void setAesKey(String aesKey)
    {
        this.aesKey = aesKey;
    }

    public String getAesIv()
    {
        return aesIv;
    }

    public void setAesIv(String aesIv)
    {
        this.aesIv = aesIv;
    }

    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 getCacheTtlMinutes()
    {
        return cacheTtlMinutes;
    }

    public void setCacheTtlMinutes(int cacheTtlMinutes)
    {
        this.cacheTtlMinutes = cacheTtlMinutes;
    }
}
