package com.chenyang.nse.bussiness.init;

import com.chenyang.nse.bussiness.service.core.SchedulerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

public class QuartzConfigInitListener implements ApplicationListener<ContextRefreshedEvent> {
   @Autowired
   private SchedulerService schedulerService;

   public void onApplicationEvent(ContextRefreshedEvent arg0) {
      if (arg0.getApplicationContext().getParent() == null) {
         this.schedulerService.initProjectStart();
         this.schedulerService.initDeletefileStart();
         this.schedulerService.generateTicket();
      }

   }
}
