package com.jiayue.ipp.idp.job;

import com.jiayue.ipp.idp.api.CallBackPassApi;
import com.jiayue.ipp.idp.api.CallForecastPowerUltraShortTermApi;
import com.jiayue.ipp.idp.api.CallPowerStationStatusDataApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @Author: tl
 * @Date: 2023/7/11 13:25
 */
@Slf4j
@Service
@EnableScheduling
public class ApiJob {

    @Autowired
    private CallBackPassApi callBackPassApi;
    @Autowired
    private CallForecastPowerUltraShortTermApi callForecastPowerUltraShortTermApi;
    @Autowired
    private CallPowerStationStatusDataApi callPowerStationStatusDataApi;

    @Scheduled(cron = "30 0,15,30,45 * * * ? ")
    public void ultraShortTermApi(){
        callForecastPowerUltraShortTermApi.executeForecast();
    }


//    @Scheduled(fixedRate = 60000l)
//    public void powerStationStatusDataApi() throws Exception {
//        callPowerStationStatusDataApi.packageData();
//    }

}
