package com.jiayue.insu.inclientqn.job;

import com.jiayue.insu.inclientqn.util.FileUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Value;

/**
 * @description: 检修计划定时下载任务
 * @author: yuanhao
 * @createDate: 2022/6/17
 * @version: 1.0
 */
public class DeleteFileJob implements Job {

    @Value("${deleteFile.path}")
    private String path;

    @Value("${deleteFile.howLongAgo}")
    private int howLongAgo;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        // 删除指定路径和时间的数据
        FileUtils.deleteFiles(path,howLongAgo);
    }
}
