From 85c91244cd46b9ceda793741f7a3af3097dc80bd Mon Sep 17 00:00:00 2001 From: yxw <17074267@qq.com> Date: Wed, 31 Dec 2025 18:16:37 +0800 Subject: [PATCH] chore --- Atomx.Common/Constants/CacheKeys.cs | 2 +- Atomx.Data/CacheServices/AreaCacheService.cs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Atomx.Common/Constants/CacheKeys.cs b/Atomx.Common/Constants/CacheKeys.cs index 12cb4be..46c70c4 100644 --- a/Atomx.Common/Constants/CacheKeys.cs +++ b/Atomx.Common/Constants/CacheKeys.cs @@ -93,7 +93,7 @@ /// /// 国家数据缓存树形结构 /// - public const string CountryTree = "Area.CountryTree"; + public const string CountryTree = "Area.CountryTree."; /// /// 国家数据缓存 diff --git a/Atomx.Data/CacheServices/AreaCacheService.cs b/Atomx.Data/CacheServices/AreaCacheService.cs index ab2e39b..6ed96a7 100644 --- a/Atomx.Data/CacheServices/AreaCacheService.cs +++ b/Atomx.Data/CacheServices/AreaCacheService.cs @@ -39,12 +39,14 @@ namespace Atomx.Data.CacheServices /// /// List GetAreaTreeAsync(long countryId); + + } public partial class CacheService : ICacheService { public async Task> GetAreaTreeAsync(long countryId, bool? reload = false) { - var cacheData = await GetCacheAsync>(CacheKeys.CountryTree); + var cacheData = await GetCacheAsync>($"{CacheKeys.CountryTree}{countryId}"); if (cacheData == null || reload.HasValue && reload.Value) { var state = _dbContext.StateProvinces.Where(p => p.CountryId == countryId).ToList(); @@ -64,7 +66,7 @@ namespace Atomx.Data.CacheServices }).ToList(); await SetCacheAsync(CacheKeys.Country, cacheData); } - return cacheData; + return cacheData; } public async Task> GetCountry(bool? reload = false)