SystemLabelService.cs 1.1 KB

1234567891011121314151617181920212223242526272829
  1. using GxPress.Service.Interface.SystemLabel;
  2. using GxPress.Repository.Interface.SystemLabel;
  3. using System.Threading.Tasks;
  4. using GxPress.Common.Page;
  5. using GxPress.Result.SystemLabel;
  6. namespace GxPress.Service.Implement.SystemLabel
  7. {
  8. public class SystemLabelService : ISystemLabelService
  9. {
  10. private readonly ISystemLabelRepository systemLabelRepository;
  11. private readonly ISystemLableMediaRepository systemLableMediaRepository;
  12. public SystemLabelService(ISystemLabelRepository systemLabelRepository, ISystemLableMediaRepository systemLableMediaRepository)
  13. {
  14. this.systemLabelRepository = systemLabelRepository;
  15. this.systemLableMediaRepository = systemLableMediaRepository;
  16. }
  17. public async Task<PagedList<SystemLabelResult>> GetAllAsync(Common.Page.PageParameter request)
  18. {
  19. var result = await systemLabelRepository.GetAllAsync(request);
  20. foreach (var item in result.Items)
  21. {
  22. item.MediaIds = await systemLableMediaRepository.GetMediaIdsAsync(item.Id);
  23. }
  24. return result;
  25. }
  26. }
  27. }