| | |
| | | import com.xiaopeng.api.dto.map.OrderRouteAndFareDto; |
| | | import com.xiaopeng.api.dto.map.RouteAndFareDto; |
| | | import com.xiaopeng.api.feignClient.order.XpOrderClient; |
| | | import com.xiaopeng.api.vo.map.WeatherVo; |
| | | import com.xiaopeng.api.dto.WeatherDTO; |
| | | import com.xiaopeng.api.vo.map.PointByIpVo; |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | |
| | | |
| | | @ApiOperation(value = "获取天气信息", tags = {"内部-调价"}) |
| | | @GetMapping("/logan/inner/weatherInfo") |
| | | public R<WeatherVo> weather(@RequestParam String city) throws IOException { |
| | | public R<WeatherDTO> weather(@RequestParam String city) throws IOException { |
| | | |
| | | try (CloseableHttpClient httpClient = HttpClients.createDefault()) { |
| | | HttpGet httpGet = new HttpGet(String.format(WEATHER_URL, key, city)); |
| | |
| | | if (entity != null) { |
| | | String resp = EntityUtils.toString(entity, StandardCharsets.UTF_8); |
| | | System.out.println(resp); |
| | | return R.ok(om.readValue(resp, WeatherVo.class)); |
| | | return R.ok(om.readValue(resp, WeatherDTO.class)); |
| | | } |
| | | return R.fail("获取天气信息失败"); |
| | | } |