DownloadXmo.java 719 B

1234567891011121314151617181920212223242526
  1. package com.example.getweather.job;
  2. import com.example.getweather.service.GetWeatherXmo;
  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 DownloadXmo {
  12. @Resource
  13. private GetWeatherXmo getWeatherXmo;
  14. //曦谋数据接入。 2025-02-10 应窦哥要求 小时气象源切换为xmo
  15. //每天1点下载数据
  16. //@Scheduled(fixedDelay = 600000000)
  17. @Scheduled(cron = "0 0 7,13 * * ?")
  18. public void download() {
  19. getWeatherXmo.download();
  20. }
  21. }