SchedulerTask.java
543 Bytes
package com.viontech.job;
import java.io.IOException;
import com.viontech.service.impl.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @author zhaibolin
*/
@Component
public class SchedulerTask {
@Autowired
private WeatherService weatherService;
@Scheduled(cron = "${schedules}")
private void process() throws IOException {
weatherService.getWeatherInfo();
}
}