DownloadGeovisearth.java 697 B

12345678910111213141516171819202122232425
  1. package com.example.getweather.job;
  2. import com.example.getweather.service.GetWeatherGeovisearth;
  3. import lombok.extern.slf4j.Slf4j;
  4. import org.springframework.scheduling.annotation.EnableScheduling;
  5. import org.springframework.scheduling.annotation.Scheduled;
  6. import org.springframework.stereotype.Service;
  7. import javax.annotation.Resource;
  8. @Slf4j
  9. @Service
  10. @EnableScheduling
  11. public class DownloadGeovisearth {
  12. @Resource
  13. private GetWeatherGeovisearth getWeatherGeovisearth;
  14. //中科星图气象源数据下载定时任务
  15. //@Scheduled(fixedDelay = 600000000)
  16. @Scheduled(cron = "0 20 6,12 * * ?")
  17. public void download() {
  18. getWeatherGeovisearth.download();
  19. }
  20. }