|
@@ -28,8 +28,9 @@ namespace GxPress.Service.Implement.AppHomePage
|
|
|
private readonly ISystemLabelRepository _systemLabelRepository;
|
|
|
private readonly IMediaLableRepository _mediaLableRepository;
|
|
|
private readonly IMiddleLableNexusRepository middleLableNexusRepository;
|
|
|
+ private readonly ISystemLableMediaRepository systemLableMediaRepository;
|
|
|
private readonly ITeacherRepository teacherRepository;
|
|
|
- public AppHomePageService(IArticleGroupRepository articleGroupRepository, IMediaRepository mediaRepository, IMiddleLableRepository _middleLableRepository, ISystemLabelRepository _systemLabelRepository, IMiddleLableNexusRepository middleLableNexusRepository, IMediaLableRepository _mediaLableRepository, IMapper _mapper, ITeacherRepository teacherRepository)
|
|
|
+ public AppHomePageService(IArticleGroupRepository articleGroupRepository, IMediaRepository mediaRepository, IMiddleLableRepository _middleLableRepository, ISystemLabelRepository _systemLabelRepository, IMiddleLableNexusRepository middleLableNexusRepository, IMediaLableRepository _mediaLableRepository, IMapper _mapper, ITeacherRepository teacherRepository, ISystemLableMediaRepository systemLableMediaRepository)
|
|
|
{
|
|
|
this.articleGroupRepository = articleGroupRepository;
|
|
|
this.mediaRepository = mediaRepository;
|
|
@@ -39,6 +40,7 @@ namespace GxPress.Service.Implement.AppHomePage
|
|
|
this._mediaLableRepository = _mediaLableRepository;
|
|
|
this._mapper = _mapper;
|
|
|
this.teacherRepository = teacherRepository;
|
|
|
+ this.systemLableMediaRepository = systemLableMediaRepository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 大咖讲座
|
|
@@ -122,6 +124,22 @@ namespace GxPress.Service.Implement.AppHomePage
|
|
|
return result;
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 获取每日微课
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<PagedList<MediaCathedraResult>> GetDayWeBookAsync(MediaDayWeBookRequest request)
|
|
|
+ {
|
|
|
+ var result = new PagedList<MediaCathedraResult>();
|
|
|
+ var systemLabel = await _systemLabelRepository.GetByNameAsync(request.Name);
|
|
|
+ var mediaLableIdRequest = new MediaLableIdRequest();
|
|
|
+ mediaLableIdRequest.Page = request.Page;
|
|
|
+ mediaLableIdRequest.PerPage = request.PerPage;
|
|
|
+ var ids = await systemLableMediaRepository.GetMediaIdsAsync(systemLabel.Id);
|
|
|
+ mediaLableIdRequest.Ids = ids.ToList();
|
|
|
+ return await mediaRepository.GetMediaByLableIdAsync(mediaLableIdRequest);
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 会员特供
|
|
|
/// </summary>
|
|
|
/// <param name="request"></param>
|
|
@@ -143,7 +161,7 @@ namespace GxPress.Service.Implement.AppHomePage
|
|
|
{
|
|
|
//获取媒体标签
|
|
|
var mediaIds = await _mediaLableRepository.GetMediaIdsAysnc(item.Id);
|
|
|
- var medias = await mediaRepository.GetNavigationMediaResults(mediaIds, item.PageSize);
|
|
|
+ var medias = await mediaRepository.GetNavigationMediaResults(mediaIds, 1, item.PageSize);
|
|
|
var list = new List<MediaCathedraResult>();
|
|
|
foreach (var mediaModel in medias)
|
|
|
{
|
|
@@ -238,7 +256,7 @@ namespace GxPress.Service.Implement.AppHomePage
|
|
|
{
|
|
|
//获取媒体标签
|
|
|
var mediaIds = await _mediaLableRepository.GetMediaIdsAysnc(item.Id);
|
|
|
- var medias = await mediaRepository.GetNavigationMediaResults(mediaIds, item.PageSize);
|
|
|
+ var medias = await mediaRepository.GetNavigationMediaResults(mediaIds, 1, item.PageSize);
|
|
|
var list = new List<MediaCathedraResult>();
|
|
|
foreach (var mediaModel in medias)
|
|
|
{
|