| | |
| | | namespace HStation.Service |
| | | { |
| | | /// <summary> |
| | | /// PumpType |
| | | /// AssetsPumpType |
| | | /// 缓存辅助类 |
| | | /// </summary> |
| | | internal class ThreeLinkMainCacheHelper |
| | | internal class AssetsThreelinkMainCacheHelper |
| | | { |
| | | private const string _contentKey = "ThreeLinkManageMap"; |
| | | |
| | |
| | | /// <summary> |
| | | /// 设置缓存 |
| | | /// </summary> |
| | | public static void Set(List<Model.ThreeLinkMain> list, int Minites = 30, int RandomSeconds = 0) |
| | | public static void Set(List<Model.AssetsThreelinkMain> list, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | MemoryCacheHelper.Set(cacheKey, list, Minites * 60 + RandomSeconds); |
| | |
| | | /// 获取缓存 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<Model.ThreeLinkMain> Get() |
| | | public static List<Model.AssetsThreelinkMain> Get() |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.Get<List<Model.ThreeLinkMain>>(cacheKey); |
| | | return MemoryCacheHelper.Get<List<Model.AssetsThreelinkMain>>(cacheKey); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取设置缓存 |
| | | /// </summary> |
| | | public static List<Model.ThreeLinkMain> GetSet(Func<List<Model.ThreeLinkMain>> func, int Minites = 30, int RandomSeconds = 0) |
| | | public static List<Model.AssetsThreelinkMain> GetSet(Func<List<Model.AssetsThreelinkMain>> func, int Minites = 30, int RandomSeconds = 0) |
| | | { |
| | | var cacheKey = GetCacheKey(); |
| | | return MemoryCacheHelper.GetSet(cacheKey, func, Minites * 60 + RandomSeconds); |