CsdnSchedule.java 630 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package com.kwan.springbootkwan.schedule;


import com.kwan.springbootkwan.service.CsdnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
@Slf4j
public class CsdnSchedule {

    @Autowired
    private CsdnService csdnService;

    @Scheduled(cron = "0 0 10,15,21 * * ?")
    public void execute() {
        log.info("Scheduled task is running ... ...");
        csdnService.multiTriplet();
        log.info("Scheduled task is finish ... ...");
    }
}