Springboot-定时任务

package com.stefanie.sun.bean.TimeTest;

import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@EnableScheduling
@EnableAsync
@Component
public class TimeTest {

    @Scheduled(cron = "0 26 15 * * ?")
    public void first(){
        System.out.print("15:26定时任务已触发");
    }
}

 

posted @ 2020-06-16 15:27  趙楊  阅读(136)  评论(0编辑  收藏  举报