|
@@ -84,14 +84,14 @@ public class TencentLocationHandler implements LocationHandler {
|
|
|
.filter(name -> !StringUtils.isEmpty(name)).collect(Collectors.joining("·"))
|
|
|
);
|
|
|
address.setProvince(
|
|
|
- Area.builder().id((long) region.getProvince().getCode()).name(location.getProvince()).build()
|
|
|
+ Area.builder().id(region.getProvince().getCode()).name(location.getProvince()).build()
|
|
|
);
|
|
|
Region city = region.getCity();
|
|
|
if (city != null) {
|
|
|
- address.setCity(Area.builder().id((long) city.getCode()).name(location.getCity()).build());
|
|
|
+ address.setCity(Area.builder().id(city.getCode()).name(location.getCity()).build());
|
|
|
}
|
|
|
if (region.getType() == Region.Type.DISTRICT) {
|
|
|
- address.setDistrict(Area.builder().id((long) region.getCode()).name(location.getDistrict()).build());
|
|
|
+ address.setDistrict(Area.builder().id(region.getCode()).name(location.getDistrict()).build());
|
|
|
}
|
|
|
return address;
|
|
|
}
|
|
@@ -105,4 +105,9 @@ public class TencentLocationHandler implements LocationHandler {
|
|
|
public Address location2address(@NonNull String location) {
|
|
|
return this.execute(LOCATION2ADDRESS_URL, location);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Address location2address(double longitude, double latitude) {
|
|
|
+ return this.location2address(longitude + "," + latitude);
|
|
|
+ }
|
|
|
}
|