MediaService.StarLable.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using GxPress.Common.Page;
  4. using GxPress.Request.Media;
  5. using GxPress.Result.Media;
  6. namespace GxPress.Service.Implement.Media
  7. {
  8. /// <summary>
  9. /// 明栏
  10. /// </summary>
  11. public partial class MediaService
  12. {
  13. /// <summary>
  14. /// 明栏
  15. /// </summary>
  16. /// <returns></returns>
  17. public async Task<IEnumerable<MediaStarLableResult>> GetMediaStarLableResultAysnc()
  18. {
  19. var result = new List<MediaStarLableResult>();
  20. //获取明栏
  21. var starLable = await attachRepository.GetStarLablesAsync();
  22. foreach (var item in starLable)
  23. {
  24. var request = new MediaStarLableRequest()
  25. {
  26. AttachId = item.Item1
  27. };
  28. var mediaStarLableResult = new MediaStarLableResult()
  29. {
  30. Id = item.Item1,
  31. Name = item.Item2,
  32. Item = await mediaRepository.GetStarLablesAsync(request)
  33. };
  34. result.Add(mediaStarLableResult);
  35. }
  36. return result;
  37. }
  38. /// <summary>
  39. /// 明栏分页
  40. /// </summary>
  41. /// <returns></returns>
  42. public async Task<PagedList<MediaCathedraResult>> GetStarLablePageAsync(MediaStarLableRequest request)
  43. {
  44. return await mediaRepository.GetStarLablePageAsync(request);
  45. }
  46. }
  47. }