package com.spider.web.core.config;

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

/**
 * 爬虫配置属性
 * 放在 spider-main 模块中
 */
@Component
@ConfigurationProperties(prefix = "spider.initial-crawl")
public class CrawlConfigProperties {

    /**
     * 是否启用启动时爬取
     */
    private boolean enabled = false;

    /**
     * 爬取开始日期 (格式: yyyy-MM-dd)
     */
    private String startDate = "2025-01-01";

    /**
     * 是否强制重新爬取（忽略已存在的数据）
     */
    private boolean forceRefresh = false;

    // getter and setter
    public boolean isEnabled() {
        return enabled;
    }

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

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public boolean isForceRefresh() {
        return forceRefresh;
    }

    public void setForceRefresh(boolean forceRefresh) {
        this.forceRefresh = forceRefresh;
    }
}