😎优化行政区划代码

This commit is contained in:
zuohuaijun 2024-11-25 02:35:32 +08:00
parent a9491ea08b
commit f75abc9d4a

View File

@ -17,9 +17,6 @@ public class SysRegionService : IDynamicApiController, ITransient
private readonly SqlSugarRepository<SysRegion> _sysRegionRep;
private readonly SysConfigService _sysConfigService;
// Url地址-高德
private readonly string _url = "https://restapi.amap.com/v3/config/district?subdistrict";
public SysRegionService(SqlSugarRepository<SysRegion> sysRegionRep, SysConfigService sysConfigService)
{
_sysRegionRep = sysRegionRep;
@ -177,7 +174,7 @@ public class SysRegionService : IDynamicApiController, ITransient
if (syncLevel < 1 || syncLevel > 5)
syncLevel = 3; // 默认区县级
var res = await $"{_url}{syncLevel}&key={key}".GetAsync();
var res = await $"https://restapi.amap.com/v3/config/district?subdistrict={syncLevel}&key={key}".GetAsync();
if (!res.IsSuccessStatusCode) return;
var gdResponse = JSON.Deserialize<GDResponse<List<GDRegionResponse>>>(res.Content.ReadAsStringAsync().Result);