| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | private int port; |
| | | @Value("${ftp.url}") |
| | | private String url; |
| | | |
| | | @Resource |
| | | RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | |
| | | @RequestMapping("/hello") |
| | |
| | | TestDate td = new TestDate(); |
| | | Map weather; |
| | | if (code == null) { |
| | | weather = td.getWeather("510400"); |
| | | return ResultData.success(redisTemplate.opsForValue().get("weather") + ""); |
| | | } else { |
| | | weather = td.getWeather(code); |
| | | return ResultData.success(td.getWeather(code)); |
| | | } |
| | | return ResultData.success(weather); |
| | | } |
| | | |
| | | |