IMediaRepository.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using Datory;
  4. using GxPress.Common.Page;
  5. using GxPress.Request.ArticleGroup;
  6. using GxPress.Request.Media;
  7. using GxPress.Result.Media;
  8. namespace GxPress.Repository.Interface.Media
  9. {
  10. public interface IMediaRepository : IRepository
  11. {
  12. Task<MediaResult> GetAsync(int id);
  13. Task<Entity.tede2.Media.Media> GetAsync(string autoNumber);
  14. /// <summary>
  15. /// 删除
  16. /// </summary>
  17. /// <param name="id"></param>
  18. /// <returns></returns>
  19. Task<bool> DeleteAsync(int id);
  20. /// <summary>
  21. /// 添加媒体
  22. /// </summary>
  23. /// <param name="result"></param>
  24. /// <returns></returns>
  25. Task<bool> InsertAsync(MediaResult result);
  26. Task<bool> UpdateAsync(MediaResult result);
  27. Task<bool> UpdateAsync(SqlKata.Query query);
  28. Task<PagedList<Entity.tede2.Media.Media>> GetAllAsync(MediaSearchRequest request);
  29. Task<int> CountAsync(string beginTime, string endTiem);
  30. Task<int> CountAsync(SqlKata.Query query);
  31. /// <summary>
  32. /// 获取书籍
  33. /// </summary>
  34. /// <param name="mediaId"></param>
  35. /// <returns></returns>
  36. Task<BookMediaResult> GetBookMediaResultAsync(int mediaId);
  37. /// <summary>
  38. /// 获取书籍
  39. /// </summary>
  40. /// <param name="mediaId"></param>
  41. /// <returns></returns>
  42. Task<VideoMediaResult> GetVideoMediaResultAsync(int mediaId);
  43. Task<IEnumerable<NavigationMediaResult>> GetNavigationMediaResults(IEnumerable<int> mediaLables,int pageSize=10);
  44. /// <summary>
  45. /// 猜你喜欢
  46. /// </summary>
  47. /// <param name="mediaIds"></param>
  48. /// <returns></returns>
  49. Task<IEnumerable<NavigationMediaResult>> GetlikeMediaResults();
  50. /// <summary>
  51. /// 推荐
  52. /// </summary>
  53. /// <param name="mediaIds"></param>
  54. /// <returns></returns>
  55. Task<IEnumerable<NavigationMediaResult>> GetRecommendMediaResults();
  56. /// <summary>
  57. /// 排行榜
  58. /// </summary>
  59. /// <param name="request"></param>
  60. /// <returns></returns>
  61. Task<IEnumerable<RankingListResult>> GetRankingListResults(RankingListRequest request);
  62. /// <summary>
  63. /// 获取笔记摘录媒体
  64. /// </summary>
  65. /// <param name="query"></param>
  66. /// <returns></returns>
  67. Task<MediaNoteResult> GetAsync(SqlKata.Query query);
  68. /// <summary>
  69. /// 大咖讲座
  70. /// </summary>
  71. /// <returns></returns>
  72. Task<IEnumerable<MediaCathedraResult>> GetMediasByTeacherAsync(ArticleGroupRequest request);
  73. }
  74. }