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.token.TokenCheckTask;
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;

/**
 * @ProjectName: tax-sys
 * @Package: com.tax.file.job
 * @ClassName: TokenCheckJob
 * @Author: ddx
 * @Description: ${description}
 * @Date: 2021-05-14 17:25
 * @Version: 1.0
 */
@Component
public class TokenCheckJob implements SimpleJob {
    private static final Logger logger = LoggerFactory.getLogger(TokenCheckJob.class);

    @Autowired
    TokenCheckTask tokenCheckTask;

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