content: 
  package com.platform.modules.quartz.config;
  
  import lombok.RequiredArgsConstructor;
  import com.platform.modules.quartz.domain.QuartzJob;
  import com.platform.modules.quartz.repository.QuartzJobRepository;
  import com.platform.modules.quartz.utils.QuartzManage;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.springframework.boot.ApplicationArguments;
  import org.springframework.boot.ApplicationRunner;
  import org.springframework.stereotype.Component;
  import java.util.List;
  
  /**
   * @author AllDataDC
   * @date 2023-01-27
   */
  @Component
  @RequiredArgsConstructor
  public class JobRunner implements ApplicationRunner {
      private static final Logger log = LoggerFactory.getLogger(JobRunner.class);
      private final QuartzJobRepository quartzJobRepository;
      private final QuartzManage quartzManage;
  
      /**
       * 项目启动时重新激活启用的定时任务
       *
       * @param applicationArguments /
       */
      @Override
      public void run(ApplicationArguments applicationArguments) {
          List<QuartzJob> quartzJobs = quartzJobRepository.findByIsPauseIsFalse();
          quartzJobs.forEach(quartzManage::addJob);
          log.info("Timing task injection complete");
      }
  }
  