IGroupRepository.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Request.App.Group;
  4. using GxPress.Result.App.Group;
  5. using GxPress.Result.App.GroupUser;
  6. using Datory;
  7. using GxPress.Entity;
  8. using GxPress.Request.App.Topic;
  9. using GxPress.Result.Job;
  10. using GxPress.Common.Page;
  11. namespace GxPress.Repository.Interface
  12. {
  13. public interface IGroupRepository : IRepository
  14. {
  15. Task<int> InsertAsync(GroupInRequest request);
  16. Task<bool> UpdateAsync(GroupUpRequest request);
  17. Task<bool> DeleteAsync(int id);
  18. Task<bool> DeleteAsync(SqlKata.Query query);
  19. Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request);
  20. Task<GroupDetailResult> GroupDetailAsync(GroupDetailRequest request);
  21. /// <summary>
  22. /// 获取用户未读取话题数量
  23. /// </summary>
  24. /// <param name="userId"></param>
  25. /// <param name="groupId"></param>
  26. /// <returns></returns>
  27. Task<int> GetUReadCountAsync(int userId, int groupId);
  28. /// <summary>
  29. /// 获取小组的共享话题数量
  30. /// </summary>
  31. /// <param name="groupId"></param>
  32. /// <returns></returns>
  33. Task<int> SharingCountAsync(int groupId);
  34. Task<Entity.Group> GetAsync(int id);
  35. /// <summary>
  36. /// 是否免打扰
  37. /// </summary>
  38. /// <param name="groupId"></param>
  39. /// <returns></returns>
  40. Task<bool> SetGroupIsAdminAsync(int groupId);
  41. /// <summary>
  42. /// 是否禁言
  43. /// </summary>
  44. /// <param name="groupId"></param>
  45. /// <returns></returns>
  46. Task<bool> SetGroupIsWordsAsync(int groupId);
  47. /// <summary>
  48. /// 获取小组详情
  49. /// </summary>
  50. /// <param name="guId"></param>
  51. /// <returns></returns>
  52. Task<GroupDetailResult> GroupDetailByGuIdAsync(string guId, int userId);
  53. Task<IEnumerable<GroupUser>> GetAllAsync(SqlKata.Query query);
  54. /// <summary>
  55. /// 搜索小组成员
  56. /// </summary>
  57. /// <param name="request"></param>
  58. /// <returns></returns>
  59. Task<IEnumerable<GroupUserListResult>> SearchGroupUserAsync(TopicDetailListRequest request);
  60. Task<List<JobGroupResult>> ElasticSearchGroup();
  61. /// <summary>
  62. /// 根据广场类别查询小组
  63. /// </summary>
  64. /// <param name="categoryId"></param>
  65. /// <returns></returns>
  66. Task<IEnumerable<SearchGroupDetailResult>> GetAllAsync(int categoryId, int userId);
  67. /// <summary>
  68. /// 用户小组列表
  69. /// </summary>
  70. /// <param name="userId"></param>
  71. /// <returns></returns>
  72. Task<IEnumerable<UserGroupList>> GetAllByUserIdAsync(int userId);
  73. /// <summary>
  74. /// 或者最近使用的小组
  75. /// </summary>
  76. /// <param name="userId"></param>
  77. /// <returns></returns>
  78. Task<IEnumerable<LatelyGroupDetailResult>> GetLatelyGroupDetailResultAsync(int userId);
  79. /// <summary>
  80. /// 小组列表 搜索专用
  81. /// </summary>
  82. /// <param name="userId"></param>
  83. /// <returns></returns>
  84. Task<IEnumerable<UserGroupResult>> GetUserGroupListAsync(int userId);
  85. /// <summary>
  86. /// 修改小组
  87. /// </summary>
  88. /// <param name="request"></param>
  89. /// <returns></returns>
  90. Task<bool> UpdateAsync(Entity.Group group);
  91. /// <summary>
  92. /// 获取小组列表
  93. /// </summary>
  94. /// <returns></returns>
  95. Task<IEnumerable<GroupDetailResult>> GetGroupDetailResults(string keyWor);
  96. /// <summary>
  97. /// 小组广场搜索
  98. /// </summary>
  99. /// <param name="keyWord"></param>
  100. /// <param name="userId"></param>
  101. /// <returns></returns>
  102. Task<IEnumerable<SearchGroupDetailResult>> GetSearchGroupAsync(string keyWord, int userId);
  103. /// <summary>
  104. /// 是否添加到通讯录
  105. /// </summary>
  106. /// <param name="groupId"></param>
  107. /// <param name="userId"></param>
  108. /// <returns></returns>
  109. Task<bool> UpdateContactsAsync(int groupId, int userId);
  110. }
  111. }