File was renamed from src/main/java/com/moral/task/ForecastWeatherInsertTask.java |
| | |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.moral.service.ForecastWeatherService; |
| | | import com.moral.service.WeatherService; |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | | |
| | | @Component |
| | | public class ForecastWeatherInsertTask { |
| | | private static transient Logger logger = LoggerFactory.getLogger(ForecastWeatherInsertTask.class); |
| | | public class WeatherInsertTask { |
| | | private static transient Logger logger = LoggerFactory.getLogger(WeatherInsertTask.class); |
| | | |
| | | @Resource |
| | | private ForecastWeatherService forecastWeatherService; |
| | | private WeatherService weatherService; |
| | | |
| | | @XxlJob("realWeatherHour") |
| | | public ReturnT insertRealWeather(String param) throws ParseException { |
| | | int count = weatherService.insertRealWeather(); |
| | | if (count > 0) { |
| | | return new ReturnT(200, "插入成功"); |
| | | }else { |
| | | return new ReturnT(500, "插入失败"); |
| | | } |
| | | } |
| | | |
| | | @XxlJob("forecastWeatherHour") |
| | | public ReturnT insertForecastWeather(String param) throws ParseException { |
| | | int count = forecastWeatherService.insertForecastWeather(); |
| | | int count = weatherService.insertForecastWeather(); |
| | | if (count > 0) { |
| | | return new ReturnT(200, "插入成功"); |
| | | }else { |
| | |
| | | |
| | | @XxlJob("forecastWeatherHourNew") |
| | | public ReturnT insertForecastWeatherNew(String param) throws ParseException { |
| | | int count = forecastWeatherService.insertForecastWeatherNew(); |
| | | int count = weatherService.insertForecastWeatherNew(); |
| | | if (count > 0) { |
| | | return new ReturnT(200, "插入成功"); |
| | | }else { |