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("考试服务启动..."); } }
點(diǎn)擊查看更多內(nèi)容
1人點(diǎn)贊
評論
評論
共同學(xué)習(xí),寫下你的評論
評論加載中...
作者其他優(yōu)質(zhì)文章
正在加載中
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦