package com.qmth.themis.task.quartz;

import com.qmth.themis.business.service.ThemisCacheService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description: 考试列表
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2023/10/27
 */
@Component
public class ExamListJob extends QuartzJobBean {
    private final static Logger log = LoggerFactory.getLogger(ExamListJob.class);

    @Resource
    ThemisCacheService themisCacheService;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        log.info("ExamListJob,context:{}", context);
        //每小时统计当前考试列表和机构考试列表
        themisCacheService.setCurrentExamListCache();
        themisCacheService.setOrgExamListCache();
    }
}
