|
@@ -220,5 +220,46 @@ namespace GxPress.Service.Implement.AppHomePage
|
|
|
var teachers = await teacherRepository.GetTeacherResult(request);
|
|
|
return teachers;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 书城
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="request"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<List<AppLabelResult<MediaCathedraResult>>> GetBookCityAsync(ArticleGroupRequest request)
|
|
|
+ {
|
|
|
+ var result = new List<AppLabelResult<MediaCathedraResult>>();
|
|
|
+ //获取中间页面
|
|
|
+ var middleLable = await _middleLableRepository.GetAsync("书城");
|
|
|
+ //获取中间页标签
|
|
|
+ var middleLableNexusIds = await middleLableNexusRepository.GetAllTaskAsync(middleLable.Id);
|
|
|
+ //获取标签
|
|
|
+ var systemLabels = await _systemLabelRepository.GetAllAsync(middleLableNexusIds.Select(n => n.LableId).ToList());
|
|
|
+ foreach (var item in systemLabels)
|
|
|
+ {
|
|
|
+ //获取媒体标签
|
|
|
+ var mediaIds = await _mediaLableRepository.GetMediaIdsAysnc(item.Id);
|
|
|
+ var medias = await mediaRepository.GetNavigationMediaResults(mediaIds, item.PageSize);
|
|
|
+ var list = new List<MediaCathedraResult>();
|
|
|
+ foreach (var mediaModel in medias)
|
|
|
+ {
|
|
|
+ list.Add(new MediaCathedraResult { Id = mediaModel.Id, Title = mediaModel.Title, ImageUrls = StringUtils.AddDomain(mediaModel.ImageUrls), Author = mediaModel.Author, ReadCount = mediaModel.ReadCount, CreatedDate = mediaModel.CreatedDate, CollectCount = mediaModel.CollectCount, MediaType = mediaModel.MediaType });
|
|
|
+ }
|
|
|
+ //获取常规数据
|
|
|
+ var mediaCathedraResult = new AppLabelResult<MediaCathedraResult>()
|
|
|
+ {
|
|
|
+ IsPage = item.IsPage,
|
|
|
+ Id = item.Id,
|
|
|
+ LabelName = item.LabelName,
|
|
|
+ ResourceType = 40,
|
|
|
+ Items = list,
|
|
|
+ Method = item.IsPage ? "post" : "",
|
|
|
+ ActionUrl = item.IsPage ? request.ActionUrl : ""
|
|
|
+ };
|
|
|
+ result.Add(mediaCathedraResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|