From c96fbe6b0aeb413a17c429133ee6d81d138144b9 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期二, 09 六月 2026 10:58:52 +0800
Subject: [PATCH] Merge branch '1.0' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi into 1.0
---
xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
index dee2018..409dcef 100644
--- a/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
+++ b/xp-robotaxi-map-boot/src/main/java/com/xiaopeng/map/controller/XpMapController.java
@@ -13,6 +13,7 @@
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;
@@ -30,7 +31,6 @@
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;
@@ -272,21 +272,18 @@
- @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) {
--
Gitblit v1.7.1