平安校园
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

IRelationService.cs 3.2 KiB

4 mesi fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. 
  2. //
  3. namespace SafeCampus.System;
  4. /// <summary>
  5. /// 关系服务
  6. /// </summary>
  7. public interface IRelationService : ITransient
  8. {
  9. /// <summary>
  10. /// 根据分类获取关系表信息
  11. /// </summary>
  12. /// <param name="category">分类名称</param>
  13. /// <returns>关系表</returns>
  14. Task<List<SysRelation>> GetRelationByCategory(string category);
  15. /// <summary>
  16. /// 通过对象ID和分类获取关系列表
  17. /// </summary>
  18. /// <param name="objectId">对象ID</param>
  19. /// <param name="category">分类</param>
  20. /// <returns></returns>
  21. Task<List<SysRelation>> GetRelationListByObjectIdAndCategory(long objectId, string category);
  22. /// <summary>
  23. /// 通过对象ID列表和分类获取关系列表
  24. /// </summary>
  25. /// <param name="objectIds">对象ID</param>
  26. /// <param name="category">分类</param>
  27. /// <returns></returns>
  28. Task<List<SysRelation>> GetRelationListByObjectIdListAndCategory(List<long> objectIds, string category);
  29. /// <summary>
  30. /// 通过目标ID和分类获取关系列表
  31. /// </summary>
  32. /// <param name="targetId">目标ID</param>
  33. /// <param name="category">分类</param>
  34. /// <returns></returns>
  35. Task<List<SysRelation>> GetRelationListByTargetIdAndCategory(string targetId, string category);
  36. /// <summary>
  37. /// 通过目标ID列表和分类获取关系列表
  38. /// </summary>
  39. /// <param name="targetIds"></param>
  40. /// <param name="category"></param>
  41. /// <returns></returns>
  42. Task<List<SysRelation>> GetRelationListByTargetIdListAndCategory(List<string> targetIds, string category);
  43. /// <summary>
  44. /// 获取关系表用户工作台
  45. /// </summary>
  46. /// <param name="userId">用户ID</param>
  47. /// <returns>关系表数据</returns>
  48. Task<SysRelation> GetWorkbench(long userId);
  49. /// <summary>
  50. /// 更新缓存
  51. /// </summary>
  52. /// <param name="category">分类</param>
  53. /// <returns></returns>
  54. Task RefreshCache(string category);
  55. /// <summary>
  56. /// 保存关系
  57. /// </summary>
  58. /// <param name="category">分类</param>
  59. /// <param name="objectId">对象ID</param>
  60. /// <param name="targetId">目标ID</param>
  61. /// <param name="extJson">拓展信息</param>
  62. /// <param name="clear">是否清除老的数据</param>
  63. /// <param name="refreshCache">是否刷新缓存</param>
  64. /// <returns></returns>
  65. Task SaveRelation(string category, long objectId, string targetId,
  66. string extJson, bool clear, bool refreshCache = true);
  67. /// <summary>
  68. /// 批量保存关系
  69. /// </summary>
  70. /// <param name="category">分类</param>
  71. /// <param name="objectId">对象ID</param>
  72. /// <param name="targetIds">目标ID列表</param>
  73. /// <param name="extJsons">拓展信息列表</param>
  74. /// <param name="clear">是否清除老的数据</param>
  75. /// <returns></returns>
  76. Task SaveRelationBatch(string category, long objectId, List<string> targetIds,
  77. List<string> extJsons, bool clear);
  78. /// <summary>
  79. /// 获取用户模块ID
  80. /// </summary>
  81. /// <param name="roleIdList"></param>
  82. /// <param name="userId"></param>
  83. /// <returns></returns>
  84. Task<List<long>> GetUserModuleId(List<long> roleIdList, long userId);
  85. }