通常情况下我们设定的定时任务都是固定的,有时候需要我们动态的配置定时任务,下面看代码
import com.mybatisflex.core.query.QueryWrapper;
import com.yzsec.dsg.web.modules.exportpwd.entity.ExportPwd;
import com.yzsec.dsg.web.modules.exportpwd.entity.table.ExportPwdTableDef;
import com.yzsec.dsg.web.modules.exportpwd.mapper.ExportPwdMapper;
import com.yzsec.dsg.web.modules.exportpwd.mapper.MailConfigMapper;
import com.yzsec.dsg.web.modules.util.MailUtil;
import jakarta.annotation.Resource;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import org.springframework.scheduling.support.CronTrigger;
impor