| | |
| | | package com.yssh.controller; |
| | | |
| | | import com.yssh.entity.Location; |
| | | import com.yssh.entity.Weather; |
| | | import com.yssh.service.WeatherService; |
| | | import com.yssh.utils.CacheUtils; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wMeng |
| | | * @ClassName YsshWeatherController |
| | | * @Description TODO |
| | | * @date 2022/10/30 13:21 |
| | | * @Version 1.0 |
| | | */ |
| | | @Api(tags="天气") |
| | | @RestController |
| | | @RequestMapping("/weather") |
| | |
| | | } |
| | | |
| | | //List<Weather> list = weatherService.query(begin, end); |
| | | String key = CacheUtils.getMd5("weatherService.query_" + begin + "_" + end); |
| | | String key = CacheUtils.getMd5("weatherService.query." + begin + "." + end); |
| | | List<Weather> list = CacheUtils.getListByKey(key); |
| | | if (null == list) { |
| | | list = weatherService.query(begin, end); |