平安校园
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

IResourceService.cs 3.4 KiB

4 meses atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. 
  2. //
  3. namespace SafeCampus.System;
  4. /// <summary>
  5. /// 资源服务
  6. /// </summary>
  7. public interface IResourceService : ITransient
  8. {
  9. /// <summary>
  10. /// 获取所有的菜单和模块以及单页面列表,并按分类和排序码排序
  11. /// </summary>
  12. /// <returns>所有的菜单和模块以及单页面列表</returns>
  13. Task<List<SysResource>> GetAllModuleAndMenuAndSpaList();
  14. /// <summary>
  15. /// 根据模块ID获取菜单和单页面列表
  16. /// </summary>
  17. /// <param name="id"></param>
  18. /// <returns></returns>
  19. Task<List<SysResource>> GetMenuAndSpaListByModuleId(long id);
  20. /// <summary>
  21. /// 根据资源ID获取所有下级资源
  22. /// </summary>
  23. /// <param name="resId">资源ID</param>
  24. /// <param name="isContainOneself">是否包含自己</param>
  25. /// <returns>资源列表</returns>
  26. Task<List<SysResource>> GetChildListById(long resId, bool isContainOneself = true);
  27. /// <summary>
  28. /// 根据资源ID获取所有下级资源
  29. /// </summary>
  30. /// <param name="sysResources">资源列表</param>
  31. /// <param name="resId">资源ID</param>
  32. /// <param name="isContainOneself">是否包含自己</param>
  33. /// <returns>资源列表</returns>
  34. List<SysResource> GetChildListById(List<SysResource> sysResources, long resId, bool isContainOneself = true);
  35. /// <summary>
  36. /// 获取ID获取Code列表
  37. /// </summary>
  38. /// <param name="ids">id列表</param>
  39. /// <param name="category">分类</param>
  40. /// <returns>Code列表</returns>
  41. Task<List<string>> GetCodeByIds(List<long> ids, string category);
  42. /// <summary>
  43. /// 获取资源列表
  44. /// </summary>
  45. /// <param name="categoryList">资源分类列表</param>
  46. /// <returns></returns>
  47. Task<List<SysResource>> GetListAsync(List<string>? categoryList = null);
  48. /// <summary>
  49. /// 根据分类获取资源列表
  50. /// </summary>
  51. /// <param name="category">分类名称</param>
  52. /// <returns>资源列表</returns>
  53. Task<List<SysResource>> GetListByCategory(string category);
  54. /// <summary>
  55. /// 根据菜单ID获取菜单
  56. /// </summary>
  57. /// <param name="ids">id列表</param>
  58. /// <param name="category">分类</param>
  59. /// <returns></returns>
  60. Task<List<SysResource>> GetResourcesByIds(List<long> ids, string category);
  61. /// <summary>
  62. /// 获取权限授权树
  63. /// </summary>
  64. /// <param name="routes">路由列表</param>
  65. /// <returns></returns>
  66. List<PermissionTreeSelector> PermissionTreeSelector(List<string> routes);
  67. /// <summary>
  68. /// 刷新缓存
  69. /// </summary>
  70. /// <param name="category">分类名称</param>
  71. /// <returns></returns>
  72. Task RefreshCache(string category = null);
  73. /// <summary>
  74. /// 角色授权资源树
  75. /// </summary>
  76. /// <returns></returns>
  77. Task<List<ResTreeSelector>> ResourceTreeSelector();
  78. /// <summary>
  79. /// 获取上级
  80. /// </summary>
  81. /// <param name="resourceList"></param>
  82. /// <param name="parentId"></param>
  83. /// <returns></returns>
  84. List<SysResource> GetResourceParent(List<SysResource> resourceList, long parentId);
  85. /// <summary>
  86. /// 获取授权菜单类菜单名称
  87. /// </summary>
  88. /// <param name="menuList">菜单列表</param>
  89. /// <param name="menu">当前菜单</param>
  90. /// <returns></returns>
  91. string GetRoleGrantResourceMenuTitle(List<SysResource> menuList, SysResource menu);
  92. }