package org.springblade.qinzhesync.task; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.digest.DigestUtils; import org.springblade.qinzhesync.service.QinzheSyncService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @Slf4j @Component @EnableScheduling public class QincheViewSyncTask { @Autowired private QinzheSyncService service; // 每5秒执行一次 //@Scheduled(fixedRate = 1000000) //@Scheduled(cron = "0 1 0 * * ?") // 每天上午0点1分执行 //@Scheduled(cron = "0 */5 * * * ?") @Scheduled(cron = "0 1 0 * * ?") //test public void executeSync() { service.syncData(); } }