From b0a694ccba71736f9092f30e45be94689ce92416 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 31 三月 2025 11:13:49 +0800 Subject: [PATCH] 计算模块替换 --- Service/HStation.Service.Assets.Core/05-service/13-Package/07-AssetsPackagePropContent/Cache/AssetsPackagePropContentCacheHelper.cs | 115 ++++++++++++++++++++++++++++----------------------------- 1 files changed, 57 insertions(+), 58 deletions(-) diff --git a/Service/HStation.Service.Assets.Core/05-service/13-Package/07-AssetsPackagePropContent/Cache/AssetsPackagePropContentCacheHelper.cs b/Service/HStation.Service.Assets.Core/05-service/13-Package/07-AssetsPackagePropContent/Cache/AssetsPackagePropContentCacheHelper.cs index 055aeaf..04b6a0b 100644 --- a/Service/HStation.Service.Assets.Core/05-service/13-Package/07-AssetsPackagePropContent/Cache/AssetsPackagePropContentCacheHelper.cs +++ b/Service/HStation.Service.Assets.Core/05-service/13-Package/07-AssetsPackagePropContent/Cache/AssetsPackagePropContentCacheHelper.cs @@ -3,72 +3,71 @@ /// <summary> /// ///</summary> - internal class AssetsPackagePropContentCacheHelper + internal class AssetsPackagePropContentCacheHelper { - - private const string _contentKey = "AssetsPackagePropContentList"; - internal static string GetCacheKey() - { - return CacheHelper.GetCacheKey(_contentKey); - } + private const string _contentKey = "AssetsPackagePropContentList"; - /// <summary> - /// 璁剧疆缂撳瓨 - /// </summary> - public static void Set(List<Model.AssetsPackagePropContent> list, int Minites = 30, int RandomSeconds = 0) - { - var cacheKey = GetCacheKey(); - MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); - } + internal static string GetCacheKey() + { + return CacheHelper.GetCacheKey(_contentKey); + } - /// <summary> - /// 鑾峰彇缂撳瓨 - /// </summary> - /// <returns></returns> - public static List<Model.AssetsPackagePropContent> Get() - { - var cacheKey = GetCacheKey(); - return MemoryCacheHelper.Get<List<Model.AssetsPackagePropContent>>(cacheKey); - } + /// <summary> + /// 璁剧疆缂撳瓨 + /// </summary> + public static void Set(List<Model.AssetsPackagePropContent> list, int Minites = 30, int RandomSeconds = 0) + { + var cacheKey = GetCacheKey(); + MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); + } - /// <summary> - /// 鑾峰彇璁剧疆缂撳瓨 - /// </summary> - public static List<Model.AssetsPackagePropContent> GetSet(Func<List<Model.AssetsPackagePropContent>> func, int Minites = 30, int RandomSeconds = 0) - { - var cacheKey = GetCacheKey(); - return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); - } + /// <summary> + /// 鑾峰彇缂撳瓨 + /// </summary> + /// <returns></returns> + public static List<Model.AssetsPackagePropContent> Get() + { + var cacheKey = GetCacheKey(); + return MemoryCacheHelper.Get<List<Model.AssetsPackagePropContent>>(cacheKey); + } - /// <summary> - /// 绉婚櫎缂撳瓨 - /// </summary> - public static void Remove() - { - var cacheKey = GetCacheKey(); - MemoryCacheHelper.Remove(cacheKey); - } + /// <summary> + /// 鑾峰彇璁剧疆缂撳瓨 + /// </summary> + public static List<Model.AssetsPackagePropContent> GetSet(Func<List<Model.AssetsPackagePropContent>> func, int Minites = 30, int RandomSeconds = 0) + { + var cacheKey = GetCacheKey(); + return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); + } - /// <summary> - /// 鍙戝竷 - /// </summary> - public static void Publish(string key) - { - var cacheKey = GetCacheKey(); - MemoryCacheWipeRelationHelper.Set(key, cacheKey); - } + /// <summary> + /// 绉婚櫎缂撳瓨 + /// </summary> + public static void Remove() + { + var cacheKey = GetCacheKey(); + MemoryCacheHelper.Remove(cacheKey); + } - /// <summary> - /// 瑙﹀彂 - /// </summary> - public static void Trigger() - { - var cacheKey = GetCacheKey(); - MemoryCacheWipeRelationHelper.Trigger(cacheKey); - } + /// <summary> + /// 鍙戝竷 + /// </summary> + public static void Publish(string key) + { + var cacheKey = GetCacheKey(); + MemoryCacheWipeRelationHelper.Set(key, cacheKey); + } + + /// <summary> + /// 瑙﹀彂 + /// </summary> + public static void Trigger() + { + var cacheKey = GetCacheKey(); + MemoryCacheWipeRelationHelper.Trigger(cacheKey); + } } } - - \ No newline at end of file + -- Gitblit v1.9.3