From b0d2592ddb49d011835f7cbb452144f9d097acbe Mon Sep 17 00:00:00 2001 From: zpc Date: Tue, 26 Aug 2025 13:18:36 +0800 Subject: [PATCH] 333 --- ZR.Common/Model/TencentMapDto.cs | 13 +++++++++++++ ZR.Common/TencentMapService.cs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ZR.Common/Model/TencentMapDto.cs b/ZR.Common/Model/TencentMapDto.cs index 67a7813..0ac5da1 100644 --- a/ZR.Common/Model/TencentMapDto.cs +++ b/ZR.Common/Model/TencentMapDto.cs @@ -61,8 +61,21 @@ namespace ZR.Common.Model /// [JsonPropertyName("address")] public string Address { get; set; } + + [JsonPropertyName("formatted_addresses")] + public FormattedAddresses formattedAddresses { get; set; } } + + + public class FormattedAddresses + { + public string recommend { get; set; } + public string rough { get; set; } + public string standard_address { get; set; } + } + + /// /// 腾讯地图地理编码API响应 /// diff --git a/ZR.Common/TencentMapService.cs b/ZR.Common/TencentMapService.cs index dfc7896..a1896d2 100644 --- a/ZR.Common/TencentMapService.cs +++ b/ZR.Common/TencentMapService.cs @@ -96,7 +96,7 @@ namespace ZR.Common if (geocoderResponse?.Status == 0 && geocoderResponse.Result != null) { - return geocoderResponse.Result.Address; + return geocoderResponse.Result.formattedAddresses?.standard_address ?? geocoderResponse.Result.Address; } else {