| | |
| | | import com.xiaopeng.api.vo.operation.RouteVo; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.common.redis.service.RedisService; |
| | | import com.xiaopeng.map.config.MapApiProperties; |
| | | import com.xiaopeng.map.mangodb.model.GeoPoint; |
| | | import com.xiaopeng.map.mangodb.service.XpGeoFencingPolygonService; |
| | | import com.xiaopeng.map.service.XpElectronicFenceAreaService; |
| | |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.bson.Document; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.geo.Point; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.geo.GeoJsonPolygon; |
| | |
| | | |
| | | |
| | | |
| | | @Value("${map.urls.weather:https://restapi.amap.com/v3/weather/weatherInfo?key=%s&city=%s}") |
| | | String WEATHER_URL; |
| | | |
| | | @Autowired |
| | | ObjectMapper om; |
| | | |
| | | @Value("${map.apikey:66ae577f63898dae3016d599fda57221}") |
| | | String key; |
| | | @Autowired |
| | | private MapApiProperties mapApiProperties; |
| | | |
| | | @ApiOperation(value = "获取天气信息", tags = {"内部-调价"}) |
| | | @PostMapping("/logan/inner/weatherInfo") |
| | | public R<WeatherDTO> wether(@RequestParam("cityCode") String cityCode) { |
| | | try{ |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | HttpGet httpGet = new HttpGet(String.format(WEATHER_URL, key, cityCode)); |
| | | HttpGet httpGet = new HttpGet(String.format(mapApiProperties.getUrls().getWeather(), mapApiProperties.getApiKey(), cityCode)); |
| | | CloseableHttpResponse response = httpClient.execute(httpGet); |
| | | HttpEntity entity = response.getEntity(); |
| | | if (entity != null) { |