package com.jsc.dsp.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsc.dsp.model.SearchAggregation;
import com.jsc.dsp.model.TargetSocial;
import com.jsc.dsp.model.TargetWebsite;

import java.util.Date;
import java.util.Map;
import java.util.logging.Logger;

import static com.jsc.dsp.utils.EsUtils.performAggregationSearch;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.support.LogIfLevelEnabled;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AutoPatroller {

    private final Logger logger = Logger.getLogger(this.getClass().getName());

    long updateInterval = 1500L;

    @Value("${custom.websiteQueryAPI}")
    String websiteQueryAPI;

    @Value("${custom.websiteUpdateAPI}")
    String websiteUpdateAPI;

    @Value("${custom.socialQueryAPI}")
    String socialQueryAPI;

    @Value("${custom.socialUpdateAPI}")
    String socialUpdateAPI;

//    @Scheduled(cron = "0 45 0/3 * * *")
//    public void checkNewsSite() {
//        checkWebsite("es_sitename", "es_carriertype", "news");
//    }
//
//    @Scheduled(cron = "0 15 1/3 * * *")
//    public void checkWechat() {
//        checkSocial("es_authors", "es_carriertype", "wechat", "5");
//    }
//
//    @Scheduled(cron = "0 0 2/4 * * *")
//    public void checkArticleSite() {
//        checkWebsite("es_sitename", "es_carriertype", "article");
//    }

}
