import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
public class TimeSendEmail {
// @Scheduled(cron = "0 0 8 1 * ?") // 每月1号的8点触发
// @Scheduled(cron = "0/5 * * * * ? ") // 每5秒触发一次
// @Scheduled(cron = "0 0 8 * * ?") // 每天上午8点触发
@Scheduled(cron = "0 0 8 ? * MON") // 每周一八点触发一次
public void Scheduled(){
SendEmail.queryNurse();
}
}
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
public class TimeSendEmail {
// @Scheduled(cron = "0 0 8 1 * ?") // 每月1号的8点触发
// @Scheduled(cron = "0/5 * * * * ? ") // 每5秒触发一次
// @Scheduled(cron = "0 0 8 * * ?") // 每天上午8点触发
@Scheduled(cron = "0 0 8 ? * MON") // 每周一八点触发一次
public void Scheduled(){
SendEmail.queryNurse();
}
}