package com.tax.file.job;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.tax.file.service.async.clear.ClearPastDataTask;
import com.yxcheng.token.utils.UUIDGenerator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class ClearPastDataJob implements SimpleJob {
    private static final Logger logger = LoggerFactory.getLogger(ClearPastDataJob.class);

    @Autowired
    private ClearPastDataTask clearPastDataTask;

    @Override
    public void execute(ShardingContext shardingContext) {
        String uuidFlag = UUIDGenerator.generate();
        logger.info(uuidFlag + " ClearPastDataJob is start");
        clearPastDataTask.clearPastData(uuidFlag);
        logger.info(uuidFlag + " ClearPastDataJob is end");
    }
}
