|
@@ -23,11 +23,11 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
private readonly ISystemLabelRepository _systemLabelRepository;
|
|
|
private readonly IMediaRepository _mediaRepository;
|
|
|
private readonly IMediaLableRepository _mediaLableRepository;
|
|
|
+ private readonly IMiddleLableNexusRepository middleLableNexusRepository;
|
|
|
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, ITeacherRepository teacherRepository)
|
|
|
+ public NavigationService(INavigationRepository _repository, IMapper _mapper, IMiddleLableRepository _middleLableRepository, ISystemLabelRepository _systemLabelRepository, IMediaRepository _mediaRepository, IMediaLableRepository _mediaLableRepository, ISlideRepository slideRepository, ISpecialLabelRepository specialLabelRepository, ITeacherRepository teacherRepository, IMiddleLableNexusRepository middleLableNexusRepository)
|
|
|
{
|
|
|
this._navigationrepository = _repository;
|
|
|
this._middleLableRepository = _middleLableRepository;
|
|
@@ -38,6 +38,7 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
this._mapper = _mapper;
|
|
|
this.specialLabelRepository = specialLabelRepository;
|
|
|
this.teacherRepository = teacherRepository;
|
|
|
+ this.middleLableNexusRepository = middleLableNexusRepository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 获取导航栏数据
|
|
@@ -51,10 +52,10 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
{
|
|
|
//获取中间页面
|
|
|
var middleLable = await _middleLableRepository.GetAsync(navigation.MiddleLableId);
|
|
|
- if (string.IsNullOrEmpty(middleLable.LabelId))
|
|
|
- return result;
|
|
|
result = _mapper.Map<MiddleLableResult>(middleLable);
|
|
|
result.NavigationLabelMediaResults = new List<NavigationLabelMediaResult>();
|
|
|
+ //获取中间页标签
|
|
|
+ var middleLableNexusIds = await middleLableNexusRepository.GetAllTaskAsync(navigation.MiddleLableId);
|
|
|
//获取轮播
|
|
|
if (middleLable.IsSlide)
|
|
|
{
|
|
@@ -66,7 +67,7 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
}
|
|
|
}
|
|
|
//获取标签
|
|
|
- var systemLabels = await _systemLabelRepository.GetAllAsync(StringUtils.StringCollectionToIntList(middleLable.LabelId).ToList());
|
|
|
+ var systemLabels = await _systemLabelRepository.GetAllAsync(middleLableNexusIds.ToList());
|
|
|
foreach (var item in systemLabels)
|
|
|
{
|
|
|
//获取常规数据
|
|
@@ -125,8 +126,8 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
var result = new MiddleLableResult();
|
|
|
//获取中间页面
|
|
|
var middleLable = await _middleLableRepository.GetAsync(middleLableId);
|
|
|
- if (string.IsNullOrEmpty(middleLable.LabelId))
|
|
|
- return result;
|
|
|
+ //获取中间页标签
|
|
|
+ var middleLableNexusIds = await middleLableNexusRepository.GetAllTaskAsync(middleLableId);
|
|
|
result = _mapper.Map<MiddleLableResult>(middleLable);
|
|
|
result.NavigationLabelMediaResults = new List<NavigationLabelMediaResult>();
|
|
|
//获取轮播
|
|
@@ -140,7 +141,7 @@ namespace GxPress.Service.Implement.Navigation
|
|
|
}
|
|
|
}
|
|
|
//获取标签
|
|
|
- var systemLabels = await _systemLabelRepository.GetAllAsync(StringUtils.StringCollectionToIntList(middleLable.LabelId).ToList());
|
|
|
+ var systemLabels = await _systemLabelRepository.GetAllAsync(middleLableNexusIds.ToList());
|
|
|
foreach (var item in systemLabels)
|
|
|
{
|
|
|
//获取常规数据
|