INoteRepository.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using Datory;
  6. using GxPress.Common.Page;
  7. using GxPress.Request.App.Note;
  8. using GxPress.Request.Web;
  9. using GxPress.Result.App.Note;
  10. using GxPress.Result.Web;
  11. namespace GxPress.Repository.Interface.Note
  12. {
  13. public interface INoteRepository : IRepository
  14. {
  15. /// <summary>
  16. /// 获取笔记
  17. /// </summary>
  18. /// <param name="id"></param>
  19. /// <returns></returns>
  20. Task<Entity.Note.Note> GetAsync(int id);
  21. /// <summary>
  22. /// 添加笔记
  23. /// </summary>
  24. /// <param name="note"></param>
  25. /// <returns></returns>
  26. Task<int> InsertAsync(Entity.Note.Note note);
  27. /// <summary>
  28. /// 修改笔记
  29. /// </summary>
  30. /// <param name="note"></param>
  31. /// <returns></returns>
  32. Task<bool> UpdateAsync(Entity.Note.Note note);
  33. /// <summary>
  34. /// 获取笔记分页
  35. /// </summary>
  36. /// <param name="request"></param>
  37. /// <returns></returns>
  38. Task<PagedList<NotePageListRequest>> NotePageListAsync(NoteSearchPageListRequest request);
  39. Task<bool> DeleteAsync(SqlKata.Query query);
  40. Task<bool> DeleteAsync(int id);
  41. Task<bool> UpdateAsync(SqlKata.Query query);
  42. /// <summary>
  43. ///查询个人摘录
  44. /// </summary>
  45. /// <param name="request"></param>
  46. /// <returns></returns>
  47. Task<PagedList<NoteUserExtractResult>> GetAllByUserId(NoteUserRequest request);
  48. /// <summary>
  49. /// web页面查询话题
  50. /// </summary>
  51. /// <param name="request"></param>
  52. /// <returns></returns>
  53. Task<PagedList<NoteTopicResult>> GetTopicNoteAsync(NoteSearchPageListRequest request);
  54. /// <summary>
  55. /// 笔记没有文件夹分页
  56. /// </summary>
  57. /// <param name="request"></param>
  58. /// <returns></returns>
  59. Task<PagedList<NoteNotFolderPageResult>> GetNoteNotFolderPageResult(NoteSearchPageListRequest request);
  60. /// <summary>
  61. /// 设置置顶
  62. /// </summary>
  63. /// <param name="noteId"></param>
  64. /// <returns></returns>
  65. Task<bool> SetIsTopAsync(int noteId);
  66. /// <summary>
  67. /// 获取用户最近使用的文件夹
  68. /// </summary>
  69. /// <param name="userId"></param>
  70. /// <returns></returns>
  71. Task<IEnumerable<int>> GetLatelyFolderIdAsync(int userId, bool isTopic);
  72. /// <summary>
  73. /// 获取笔记/话题草稿分页
  74. /// </summary>
  75. /// <param name="request"></param>
  76. /// <returns></returns>
  77. Task<PagedList<NoteNotFolderPageResult>> NoteTopicDraftPageListAsync(NoteSearchPageListRequest request);
  78. /// <summary>
  79. /// 获取用户是否存在草稿
  80. /// </summary>
  81. /// <param name="userId"></param>
  82. /// <returns></returns>
  83. Task<bool> IsExistsDraftAsync(int userId, bool isTopic);
  84. /// <summary>
  85. /// 获取用户最新的草稿Id
  86. /// </summary>
  87. /// <param name="userId"></param>
  88. /// <returns></returns>
  89. Task<int> GetNoteIdByDraftAsync(int userId, bool isTopic);
  90. /// <summary>
  91. /// 获取用户最新的草稿Id
  92. /// </summary>
  93. /// <param name="userId"></param>
  94. /// <returns></returns>
  95. Task<int> GetDraftCountAsync(int userId, bool isTopic);
  96. /// <summary>
  97. /// 清空草稿箱
  98. /// </summary>
  99. /// <param name="userId"></param>
  100. /// <param name="typeValue"></param>
  101. /// <returns></returns>
  102. Task<bool> ClearDraftAsync(int userId, int typeValue);
  103. Task<IEnumerable<Entity.Note.Note>> GetAllAsync(SqlKata.Query query);
  104. }
  105. }