|
@@ -6,6 +6,12 @@ using GxPress.Repository.Interface.AppChannel;
|
|
|
using GxPress.Result.AppChannel;
|
|
|
using GxPress.Service.Interface.AppChannel;
|
|
|
using GxPress.Common.Tools;
|
|
|
+using GxPress.Result.Media;
|
|
|
+using GxPress.Request.AppChannel;
|
|
|
+using GxPress.Repository.Interface.Media;
|
|
|
+using System.Linq;
|
|
|
+using GxPress.Common.Page;
|
|
|
+
|
|
|
namespace GxPress.Service.Implement.AppChannel
|
|
|
{
|
|
|
/// <summary>
|
|
@@ -16,11 +22,13 @@ namespace GxPress.Service.Implement.AppChannel
|
|
|
private readonly IChannelCategoryMediaRepository channelCategoryMediaRepository;
|
|
|
private readonly IChannelCategoryRepository channelCategoryRepository;
|
|
|
private readonly IAppChannelRepository appChannelRepository;
|
|
|
- public AppChannelService(IChannelCategoryMediaRepository channelCategoryMediaRepository, IChannelCategoryRepository channelCategoryRepository, IAppChannelRepository appChannelRepository)
|
|
|
+ private readonly IMediaRepository mediaRepository;
|
|
|
+ public AppChannelService(IChannelCategoryMediaRepository channelCategoryMediaRepository, IChannelCategoryRepository channelCategoryRepository, IAppChannelRepository appChannelRepository, IMediaRepository mediaRepository)
|
|
|
{
|
|
|
this.channelCategoryMediaRepository = channelCategoryMediaRepository;
|
|
|
this.channelCategoryRepository = channelCategoryRepository;
|
|
|
this.appChannelRepository = appChannelRepository;
|
|
|
+ this.mediaRepository = mediaRepository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取App频道
|
|
@@ -43,6 +51,25 @@ namespace GxPress.Service.Implement.AppChannel
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 查询 获取频道分类
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<IEnumerable<ChannelCategoryResult>> GetAllAsync(int appChannelId)
|
|
|
+ {
|
|
|
+ return await channelCategoryRepository.GetAllAsync(appChannelId);
|
|
|
+ }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 根据app频道分类id获取媒体分页数据
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<PagedList<MediaCathedraResult>> GetChannelCategoryMediaPageAsync(AppChannelSearchRequest request)
|
|
|
+ {
|
|
|
+ //获取标签
|
|
|
+ var ids = await channelCategoryMediaRepository.GetAllAsync(request.CategoryId);
|
|
|
+ request.Ids = ids.ToList();
|
|
|
+ return await mediaRepository.GetAppChannelsAsync(request);
|
|
|
+ }
|
|
|
}
|
|
|
}
|