|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using HealthMonitor.Util.Models;
-
- namespace HealthMonitor.Core.Cache
- {
- public interface IDurableEntityManager
- {
- /// <summary>
- /// 判断实体类型是否支持持久化到缓存,若支持则返回缓存操作对象
- /// </summary>
- /// <param name="entityType"></param>
- /// <returns></returns>
- IEntityCacheHandler GetCacheHandler(Type entityType);
-
- /// <summary>
- /// 获取缓存键
- /// </summary>
- /// <param name="entityType">实体类型</param>
- /// <param name="id"></param>
- /// <returns></returns>
- string CalcCacheKey(Type entityType, string id);
-
- /// <summary>
- /// 获取缓存键
- /// </summary>
- /// <param name="entityType">实体类型</param>
- /// <param name="conditions">查询条件</param>
- /// <returns></returns>
- string CalcCacheKey(Type entityType, GeneralParam conditions);
-
- /// <summary>
- /// 获取缓存键(历史表)
- /// </summary>
- /// <param name="entityType">实体类型</param>
- /// <param name="id"></param>
- /// <param name="imei">设备serialno</param>
- /// <param name="date">查询的历史日期</param>
- /// <returns></returns>
- string CalcHistoryCacheKey(Type entityType, string id, string imei, DateTime? date = null);
-
- /// <summary>
- /// 获取缓存键(历史表)
- /// </summary>
- /// <param name="entityType">实体类型</param>
- /// <param name="conditions">查询条件</param>
- /// <param name="imei">设备serialno</param>
- /// <param name="date">查询的历史日期</param>
- /// <returns></returns>
- string CalcHistoryCacheKey(Type entityType, GeneralParam conditions, string imei, DateTime? date = null);
-
- /// <summary>
- /// 清理所有缓存实体的失效(超时)映射关系
- /// </summary>
- void CleanUpEntitiesMapper();
- }
- }
|