feat(api): в HostResponse добавлена информация о компонентном составе

This commit is contained in:
Mikhail Trubnikov
2023-11-30 10:17:02 +10:00
parent 5cfa2a852f
commit 1222c102f0
7 changed files with 64 additions and 22 deletions

View File

@@ -38,6 +38,7 @@ namespace PARR.API.Controllers.V1
IQueryable<DAL.Models.Host> query = hostService.Get()
.Include(s => s.EkStatus)
.Include(s => s.ResponseArea)
.Include(t => t.ApplicationsInHosts).ThenInclude(t => t.Application).ThenInclude(t => t!.ApplicationType)
.OrderBy(t => t.Ek);
if (!string.IsNullOrEmpty(request.Mask))
@@ -48,8 +49,8 @@ namespace PARR.API.Controllers.V1
if (!hosts.Any())
return NoContent();
var hostResponse = mapper.Map<List<HostResponse>>(hosts);
var paginationResponse = new PagedResponse<HostResponse>(hostResponse, true).GetPaginatedProps(paginationFilter, query);
var hostResponse = mapper.Map<List<HostWithApplicationsResponse>>(hosts);
var paginationResponse = new PagedResponse<HostWithApplicationsResponse>(hostResponse, true).GetPaginatedProps(paginationFilter, query);
return Ok(paginationResponse);
}