package com.huihe.exam;
import com.huihe.exam.mapper.ScheduleMapper;
import com.huihe.exam.task.LoadOrgsTask;
import com.huihe.exam.task.SchedulerTask;
import com.huihe.exam.task.TaskAdmin;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.List;
import java.util.TimeZone;
@SpringBootApplication
@MapperScan("com.huihe.exam.mapper")
@EnableScheduling
@EnableAsync
public class ServiceExamApplication {
public static ApplicationContext applicationContext;
private static final Logger LOG = LoggerFactory.getLogger(ServiceExamApplication.class);
public static void main(String[] args) {
ConfigurableApplicationContext context = SpringApplication.run(ServiceExamApplication.class, args);
ServiceExamApplication.applicationContext = context;
LOG.info("设置时区为东八区");
TimeZone timeZone = TimeZone.getTimeZone("GMT+8");
TimeZone.setDefault(timeZone);
LOG.info("处理执行中的定时任务");
ScheduleMapper scheduleMapper = context.getBean(ScheduleMapper.class);
List<SchedulerTask> runningTaskList = scheduleMapper.getRunningTask();
TaskAdmin taskAdmin = context.getBean(TaskAdmin.class);
taskAdmin.handleTasks(runningTaskList);
LOG.info("加载机构和电话号码信息");
LoadOrgsTask task = context.getBean(LoadOrgsTask.class);
task.loadOrgInfo();
LOG.info("考试服务启动...");
}
}點擊查看更多內容
1人點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦