package cn.com.suntree.cmp.service;
import cn.com.suntree.cmp.utils.CommonUtil;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.TriggerContext;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
import java.util.Date;
@Component
@Log4j2
public class MyDynamicTask implements SchedulingConfigurer {//实现SchedulingConfigurer 接口
@Autowired
CommonUtil commonUtil;
@Autowired
TaskService taskService;
private static String cron;
@Override
public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {//重写该方法
spring boot Scheduled动态配置
最新推荐文章于 2024-07-07 07:45:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)