springboot定时任务(简单实现)
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
@Configuration
@EnableScheduling
public class TestTask {
@Scheduled(cron = "0 0/1 * * * ?")
public void TestTask() {
//业务代码实现
}
}
还没有评论,来说两句吧...