package cn.com.ctop.job.bytedance.handler;

import cn.com.ctop.toutiao.modules.report.service.IByteDanceVideoReportDailyService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.jeecg.common.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class BytedanceVideoReportCleanJob {
    @Autowired
    private IByteDanceVideoReportDailyService videoReportDailyService;

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