package com.ruoyi.web.modules.industryservice.research.config;

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

/**
 * 科研开放数据接口配置。
 */
@Component
@ConfigurationProperties(prefix = "research-open-api")
public class ResearchOpenApiProperties
{
    /** 是否启用 */
    private boolean enabled = false;

    /** 调用凭证（申请 Token 时使用，全局唯一一对） */
    private String appKey = "";

    private String appSecret = "";

    /** JWT 签名密钥（生产环境须独立配置） */
    private String tokenSecret = "research-open-api-change-me-in-production";

    /** 访问令牌有效期（分钟） */
    private int tokenExpireMinutes = 120;

    /** 单页最大条数 */
    private int maxPageSize = 200;

    public boolean isEnabled()
    {
        return enabled;
    }

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

    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 String getTokenSecret()
    {
        return tokenSecret;
    }

    public void setTokenSecret(String tokenSecret)
    {
        this.tokenSecret = tokenSecret;
    }

    public int getTokenExpireMinutes()
    {
        return tokenExpireMinutes;
    }

    public void setTokenExpireMinutes(int tokenExpireMinutes)
    {
        this.tokenExpireMinutes = tokenExpireMinutes;
    }

    public int getMaxPageSize()
    {
        return maxPageSize;
    }

    public void setMaxPageSize(int maxPageSize)
    {
        this.maxPageSize = maxPageSize;
    }
}
