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