ICacheService.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using Furion.JsonSerialization;
  2. using YBEE.EQM.Core;
  3. namespace YBEE.EQM.Application
  4. {
  5. public interface ICacheService
  6. {
  7. Task AddCacheKey(string cacheKey);
  8. Task DelByPatternAsync(string key);
  9. Task DelCacheKey(string cacheKey);
  10. bool Exists(string cacheKey);
  11. Task<List<string>> GetAllCacheKeys();
  12. Task<T> GetAsync<T>(string cacheKey);
  13. Task<List<int>> GetDataScope(int userId);
  14. Task<List<string>> GetPermission(int userId);
  15. Task RemovePermission(int userId);
  16. Task<string> GetStringAsync(string cacheKey);
  17. Task RemoveAsync(string key);
  18. Task SetAsync(string cacheKey, object value);
  19. Task SetDataScope(int userId, List<int> dataScopes);
  20. Task SetPermission(int userId, List<string> permissions);
  21. Task SetStringAsync(string cacheKey, string value);
  22. Task<List<AntMenuOutput>> GetMenu(int userId);
  23. Task SetMenu(int userId, List<AntMenuOutput> menus);
  24. /// <summary>
  25. /// 获取角色数据范围权限缓存
  26. /// </summary>
  27. /// <param name="userId"></param>
  28. /// <returns></returns>
  29. Task<List<SysRoleOutput>> GetRoleDataScope(int userId);
  30. /// <summary>
  31. /// 删除角色数据范围权限缓存
  32. /// </summary>
  33. /// <param name="userId"></param>
  34. /// <returns></returns>
  35. Task RemoveRoleDataScope(int userId);
  36. /// <summary>
  37. /// 缓存角色数据范围权限
  38. /// </summary>
  39. /// <param name="userId"></param>
  40. /// <param name="roles"></param>
  41. /// <returns></returns>
  42. Task SetRoleDataScope(int userId, List<SysRoleOutput> roles);
  43. }
  44. }