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