IMiddleRepository.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using GxPress.Entity.Middle;
  6. using GxPress.Request.Notice;
  7. using SqlKata;
  8. using Datory;
  9. using GxPress.Request.App.Middle;
  10. using GxPress.Request.Inbox;
  11. namespace GxPress.Repository.Interface
  12. {
  13. public interface IMiddleRepository : IRepository
  14. {
  15. Task<int> InsertAsync(Middle middle);
  16. Task<bool> UpdateAsync(SqlKata.Query query);
  17. Task<bool> UpdateAsync(Middle middle);
  18. Task<IEnumerable<Middle>> FindAsync(SqlKata.Query query);
  19. Task<bool> DeleteAsync(SqlKata.Query query);
  20. Task<Middle> GetMiddleAsync(Query query);
  21. Task<Middle> GetMiddleAsync(int id);
  22. Task<bool> SetSortAsync(MiddleSortRequest request);
  23. Task<bool> SetTopAsync(int id);
  24. /// <summary>
  25. /// 删除
  26. /// </summary>
  27. /// <param name="request"></param>
  28. /// <returns></returns>
  29. Task<bool> DeleteAsync(NoticeDeRequest request);
  30. Task<bool> DeleteAsync(int middleId, int folderTypeId);
  31. /// <summary>
  32. /// 阅读
  33. /// </summary>
  34. /// <param name="id"></param>
  35. /// <returns></returns>
  36. Task<bool> ReadAsync(int id);
  37. /// <summary>
  38. /// 恢复删除
  39. /// </summary>
  40. /// <param name="request"></param>
  41. /// <returns></returns>
  42. Task<bool> RecoverDeleteAsync(NoticeDeRequest request);
  43. Task<bool> UpdateFolderNameAsync(MiddleFolderNameRequest request);
  44. Task<bool> IsFolderAsync(int parentId);
  45. /// <summary>
  46. /// 根据用户ID文件夹ID查询小组数量
  47. /// </summary>
  48. /// <param name="userId"></param>
  49. /// <param name="folderId"></param>
  50. /// <param name="folderTypeId"></param>
  51. /// <returns></returns>
  52. Task<int> FindGroupCountAsync(int userId, int folderId, int folderTypeId);
  53. /// <summary>
  54. ///
  55. /// </summary>
  56. /// <param name="query"></param>
  57. /// <returns></returns>
  58. Task<int> CountAsync(SqlKata.Query query);
  59. /// <summary>
  60. /// 添加
  61. /// </summary>
  62. /// <param name="middle"></param>
  63. /// <returns></returns>
  64. Task<bool> InsertAsync(List<Middle> middles);
  65. Task<IEnumerable<Middle>> GetAllAsync(SqlKata.Query query);
  66. /// <summary>
  67. /// 获取下级数据
  68. /// </summary>
  69. /// <param name="id"></param>
  70. /// <returns></returns>
  71. Task<IEnumerable<Middle>> GetMiddleChildrenAsync(int id);
  72. Task<IEnumerable<Middle>> FindAsync(InboxSearchRequest request);
  73. Task<bool> ExistsAsync(SqlKata.Query query);
  74. Task<int> GetSytemFolderAsync(int userId);
  75. /// <summary>
  76. /// 排除不是文件夹的ID
  77. /// </summary>
  78. /// <param name="ids"></param>
  79. /// <returns></returns>
  80. Task<IEnumerable<int>> GetMiddleIsFolderAsync(IEnumerable<int> ids);
  81. /// <summary>
  82. /// 递归获取父级下面的所有子集
  83. /// </summary>
  84. /// <param name="id"></param>
  85. /// <param name="ids"></param>
  86. /// <returns></returns>
  87. Task<IEnumerable<int>> GetAllMiddleChildrenByParentIdAsync(List<int> ids, List<int> returnIds);
  88. }
  89. }