|
@@ -3,11 +3,13 @@ using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
using AutoMapper;
|
|
|
using GxPress.Common.Tools;
|
|
|
+using GxPress.EnumConst;
|
|
|
using GxPress.Repository.Interface;
|
|
|
using GxPress.Repository.Interface.Media;
|
|
|
using GxPress.Repository.Interface.Navigation;
|
|
|
using GxPress.Repository.Interface.SpecialLabel;
|
|
|
using GxPress.Repository.Interface.SystemLabel;
|
|
|
+using GxPress.Repository.Interface.Teacher;
|
|
|
using GxPress.Result.Navigation;
|
|
|
using GxPress.Service.Interface.Navigation;
|
|
|
|
|
@@ -23,8 +25,9 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
private readonly IMediaLableRepository _mediaLableRepository;
|
|
|
private readonly ISlideRepository slideRepository;
|
|
|
private readonly ISpecialLabelRepository specialLabelRepository;
|
|
|
+ private readonly ITeacherRepository teacherRepository;
|
|
|
|
|
|
- public NavigationService(INavigationRepository _repository, IMapper _mapper, IMiddleLableRepository _middleLableRepository, ISystemLabelRepository _systemLabelRepository, IMediaRepository _mediaRepository, IMediaLableRepository _mediaLableRepository, ISlideRepository slideRepository, ISpecialLabelRepository specialLabelRepository)
|
|
|
+ public NavigationService(INavigationRepository _repository, IMapper _mapper, IMiddleLableRepository _middleLableRepository, ISystemLabelRepository _systemLabelRepository, IMediaRepository _mediaRepository, IMediaLableRepository _mediaLableRepository, ISlideRepository slideRepository, ISpecialLabelRepository specialLabelRepository, ITeacherRepository teacherRepository)
|
|
|
{
|
|
|
this._navigationrepository = _repository;
|
|
|
this._middleLableRepository = _middleLableRepository;
|
|
@@ -34,6 +37,7 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
this.slideRepository = slideRepository;
|
|
|
this._mapper = _mapper;
|
|
|
this.specialLabelRepository = specialLabelRepository;
|
|
|
+ this.teacherRepository = teacherRepository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取导航栏数据
|
|
@@ -81,12 +85,20 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
Remark = item.Remark,
|
|
|
IsShowLabelName = item.IsShowLabelName
|
|
|
};
|
|
|
- // 特殊 130,示范课堂140,品牌专区1(150),品牌专区2(160)
|
|
|
+ // 特殊 130,示范课堂140,品牌专区1(150),品牌专区2(160),170 直播 180 名师
|
|
|
var specialInts = systemLabels.Where(n => n.ResourceType >= 130).Select(n => n.ResourceType);
|
|
|
if (specialInts.Contains(item.ResourceType))
|
|
|
{
|
|
|
//获取特殊
|
|
|
navigationLabelMediaResult.IsSpecial = true;
|
|
|
+ //名师
|
|
|
+ if (item.ResourceType == SpecialConst.Teacher.GetHashCode())
|
|
|
+ {
|
|
|
+ navigationLabelMediaResult.IsTeacher = true;
|
|
|
+ navigationLabelMediaResult.TeacherResults = await teacherRepository.GetTeacherResult();
|
|
|
+ result.NavigationLabelMediaResults.Add(navigationLabelMediaResult);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
navigationLabelMediaResult.SpecialLabelResults = await specialLabelRepository.GetAllAsync(item.ResourceType);
|
|
|
foreach (var specialLabelResult in navigationLabelMediaResult.SpecialLabelResults)
|
|
|
specialLabelResult.ImageUrls = StringUtils.AddDomain(specialLabelResult.ImageUrls);
|