using GxPress.Service.Interface.SystemLabel; using GxPress.Repository.Interface.SystemLabel; using System.Threading.Tasks; using GxPress.Common.Page; using GxPress.Result.SystemLabel; namespace GxPress.Service.Implement.SystemLabel { public class SystemLabelService : ISystemLabelService { private readonly ISystemLabelRepository systemLabelRepository; private readonly ISystemLableMediaRepository systemLableMediaRepository; public SystemLabelService(ISystemLabelRepository systemLabelRepository, ISystemLableMediaRepository systemLableMediaRepository) { this.systemLabelRepository = systemLabelRepository; this.systemLableMediaRepository = systemLableMediaRepository; } public async Task> GetAllAsync(Common.Page.PageParameter request) { var result = await systemLabelRepository.GetAllAsync(request); foreach (var item in result.Items) { item.MediaIds = await systemLableMediaRepository.GetMediaIdsAsync(item.Id); } return result; } } }