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

104 行
3.2 KiB

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