ICommentRepository.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Threading.Tasks;
  5. using GxPress.Common.Page;
  6. using GxPress.Entity;
  7. using GxPress.Request.Comment;
  8. using GxPress.Result.Comment;
  9. using Datory;
  10. namespace GxPress.Repository.Interface
  11. {
  12. public interface ICommentRepository : IRepository
  13. {
  14. /// <summary>
  15. /// 添加文章评论
  16. /// </summary>
  17. /// <param name="request"></param>
  18. /// <returns></returns>
  19. Task<int> CommentInAsync(CommentInRequest request);
  20. Task<PagedList<CommentPageResult>> GetPagedList(CommentSearchPageRequest request);
  21. Task<int> GetCountAsync(CommentSearchPageRequest request);
  22. Task<IEnumerable<CommentPageResult>> GetPageListAsync(CommentSearchPageRequest request);
  23. Task<List<CommentReplyResult>>
  24. GetCommentReplyResultByPid(int pid, List<CommentReplyResult> commentReplyResults);
  25. /// <summary>
  26. /// 删除评论
  27. /// </summary>
  28. /// <param name="request"></param>
  29. /// <returns></returns>
  30. Task<bool> DeleteCommentAsync(CommentDeleteRequest request);
  31. /// <summary>
  32. /// 获取文章的评论条数
  33. /// </summary>
  34. /// <param name="articleId"></param>
  35. /// <returns></returns>
  36. Task<int> GetCommentCountAsync(int articleId);
  37. Task<Comment> GetAsync(SqlKata.Query query);
  38. Task<bool> UpdateAsync(Comment comment);
  39. Task<int> CountAsync(SqlKata.Query query);
  40. Task<bool> UpdateCommentAsync(CommentUpdateRequest request);
  41. /// <summary>
  42. /// 后台评论分页列表
  43. /// </summary>
  44. /// <param name="request"></param>
  45. /// <returns></returns>
  46. Task<PagedList<CommentResult>> GetAllAsync(CommentSearchRequest request);
  47. }
  48. }