平安校园
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

71 行
1.8 KiB

  1. //
  2. namespace SafeCampus.Cache;
  3. /// <summary>
  4. /// 缓存服务
  5. /// </summary>
  6. public partial interface ISimpleCacheService
  7. {
  8. /// <summary>
  9. /// 添加一条数据到HashMap
  10. /// </summary>
  11. /// <typeparam name="T"></typeparam>
  12. /// <param name="key">键</param>
  13. /// <param name="hashKey">hash列表里的Key</param>
  14. /// <param name="value">值</param>
  15. void HashAdd<T>(string key, string hashKey, T value);
  16. /// <summary>
  17. /// 添加多条数据到HashMap
  18. /// </summary>
  19. /// <typeparam name="T"></typeparam>
  20. /// <param name="key">键</param>
  21. /// <param name="dic">键值对字典</param>
  22. /// <returns></returns>
  23. bool HashSet<T>(string key, Dictionary<string, T> dic);
  24. /// <summary>
  25. /// 从HashMap中删除数据
  26. /// </summary>
  27. /// <typeparam name="T"></typeparam>
  28. /// <param name="key">键</param>
  29. /// <param name="fields">hash键列表</param>
  30. /// <returns>执行结果</returns>
  31. int HashDel<T>(string key, params string[] fields);
  32. /// <summary>
  33. /// 根据键获取hash列表中的值
  34. /// </summary>
  35. /// <typeparam name="T"></typeparam>
  36. /// <param name="key">键</param>
  37. /// <param name="fields">hash键列表</param>
  38. /// <returns>数据列表</returns>
  39. List<T> HashGet<T>(string key, params string[] fields);
  40. /// <summary>
  41. /// 根据键获取hash列表中的值
  42. /// </summary>
  43. /// <typeparam name="T"></typeparam>
  44. /// <param name="key">键</param>
  45. /// <param name="field">hash键</param>
  46. /// <returns></returns>
  47. T HashGetOne<T>(string key, string field);
  48. /// <summary>
  49. /// 获取所有键值对
  50. /// </summary>
  51. /// <typeparam name="T"></typeparam>
  52. /// <param name="key">键</param>
  53. /// <returns>数据字典</returns>
  54. IDictionary<string, T> HashGetAll<T>(string key);
  55. }