package com.example.getweather.job; import com.example.getweather.service.GetWeatherGeovisearth; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import javax.annotation.Resource; @Slf4j @Service @EnableScheduling public class DownloadGeovisearth { @Resource private GetWeatherGeovisearth getWeatherGeovisearth; //中科星图气象源数据下载定时任务 //@Scheduled(fixedDelay = 600000000) @Scheduled(cron = "0 20 6,12 * * ?") public void download() { getWeatherGeovisearth.download(); } }