|
|
|
@ -53,7 +53,7 @@ public class ScheduledHefengWeatherService {
|
|
|
|
* //天气图标用法: https://icons.qweather.com/usage/
|
|
|
|
* //天气图标用法: https://icons.qweather.com/usage/
|
|
|
|
* @Param: null
|
|
|
|
* @Param: null
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
//@Scheduled(cron = "0 0 2 * * *")//每个小时执行一次
|
|
|
|
@Scheduled(cron = "0 44 17 * * *")//每个小时执行一次
|
|
|
|
public void scheduled() {
|
|
|
|
public void scheduled() {
|
|
|
|
log.info("scheduled");
|
|
|
|
log.info("scheduled");
|
|
|
|
log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
@ -125,7 +125,7 @@ public class ScheduledHefengWeatherService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
//@Scheduled(cron = "0 0 10,14,18,20,22 * * *")//每天10,14,18,20,22点各执行一次,一天总共执行五次
|
|
|
|
//@Scheduled(cron = "0 0 10,14,18,20,22 * * *")//每天10,14,18,20,22点各执行一次,一天总共执行五次
|
|
|
|
//@Scheduled(cron = "0 0 0,8,12,16 * * *")//每天0,8,12,16点各执行一次,一天总共执行四次
|
|
|
|
//@Scheduled(cron = "0 0 0,8,12,16 * * *")//每天0,8,12,16点各执行一次,一天总共执行四次
|
|
|
|
@Scheduled(cron = "0 15 * * * *")//每个小时执行一次
|
|
|
|
//@Scheduled(cron = "0 15 * * * *")//每个小时执行一次
|
|
|
|
public void scheduledGetRealtimeWeather() {
|
|
|
|
public void scheduledGetRealtimeWeather() {
|
|
|
|
log.info("scheduledGetRealtimeWeather");
|
|
|
|
log.info("scheduledGetRealtimeWeather");
|
|
|
|
log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
@ -141,7 +141,7 @@ public class ScheduledHefengWeatherService {
|
|
|
|
* @Param: null
|
|
|
|
* @Param: null
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
//@Scheduled(cron = "0 0 9 * * *")//每天9点执行一次
|
|
|
|
//@Scheduled(cron = "0 0 9 * * *")//每天9点执行一次
|
|
|
|
@Scheduled(cron = "0 15 * * * *")//每个小时执行一次
|
|
|
|
//@Scheduled(cron = "0 15 * * * *")//每个小时执行一次
|
|
|
|
public void scheduledGetForecastWeather() {
|
|
|
|
public void scheduledGetForecastWeather() {
|
|
|
|
log.info("scheduledGetForecastWeather");
|
|
|
|
log.info("scheduledGetForecastWeather");
|
|
|
|
log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
|