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 ... ..."); } }