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; @Slf4j
@Component
public class CsdnSchedule { @Autowired private CsdnService csdnService;
@Scheduled(cron = "0 0 8,10,12,14,16,18,20 * * ?")
public void execute() { log.info("Scheduled task is running ... ..."); csdnService.multiTriplet(); log.info("Scheduled task is finish ... ..."); } }