package com.tax.file.monitor;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import com.tax.file.service.async.monitor.ApplyMonitorService;
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 ApplyMonitorJob  implements SimpleJob {
    private  final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private ApplyMonitorService applyMonitorService;

    @Override
    public void execute(ShardingContext shardingContext) {
        String uuidFlag = UUIDGenerator.generate();

        logger.info(uuidFlag + " applyMonitor is start");
        applyMonitorService.applyMonitor(uuidFlag);
        applyMonitorService.applyTokenMonitor(uuidFlag);
        logger.info(uuidFlag + " applyMonitor is end");
    }
}
