123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using GxPress.Common.Page;
- using GxPress.Request.Media;
- using GxPress.Result.Media;
- namespace GxPress.Service.Implement.Media
- {
- /// <summary>
- /// 明栏
- /// </summary>
- public partial class MediaService
- {
- /// <summary>
- /// 明栏
- /// </summary>
- /// <returns></returns>
- public async Task<IEnumerable<MediaStarLableResult>> GetMediaStarLableResultAysnc()
- {
- var result = new List<MediaStarLableResult>();
- //获取明栏
- var starLable = await systemLabelRepository.GetStarLableAllAsync();
- foreach (var item in starLable)
- {
- var meidas = await systemLableMediaRepository.GetMediaIdsAsync(item.Id, 0);
- var request = new MediaStarLableRequest()
- {
- Page=1,
- PerPage=item.PageSize,
- MediaIds = meidas.ToList()
- };
- var mediaStarLableResult = new MediaStarLableResult()
- {
- Id = item.Id,
- Name = item.LabelName,
- Item = await mediaRepository.GetStarLablesAsync(request)
- };
- result.Add(mediaStarLableResult);
- }
- return result;
- }
- /// <summary>
- /// 明栏分页
- /// </summary>
- /// <returns></returns>
- public async Task<PagedList<MediaCathedraResult>> GetStarLablePageAsync(MediaStarLableRequest request)
- {
- var meidas = await systemLableMediaRepository.GetMediaIdsAsync(request.Id, 0);
- request.MediaIds = meidas.ToList();
- return await mediaRepository.GetStarLablePageAsync(request);
- }
- }
- }
|