package com.xxl.job.executor.jobhandler;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.executor.report.service.IByteDanceVideoReportDailyService;
import com.xxl.job.executor.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class BytedanceVideoDailyReportLoadJob {
    @XxlJob("bytedanceVideoDailyReportLoadJob")
    public void execute() throws Exception {
        for(int i=0;i<3;i++){
            Date getDate = DateUtils.addDay(new Date(), -i);
            String date = DateUtils.formatDate(getDate);
            videoReportDailyService.videoInfoList(date, date);
        }
    }

    @Autowired
    private IByteDanceVideoReportDailyService videoReportDailyService;
}
