feat(api): HostResponse, добавлено поле EkResponseArea
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
public string? ResponseArea { get; set; }
|
||||
|
||||
public ResponseAreaResponse? EkResponseArea { get; set; }
|
||||
|
||||
public DateTimeOffset? LastLogon { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace PARR.API.Controllers.V1
|
||||
var paginationFilter = mapper.Map<PaginationFilter>(paginationQuery);
|
||||
|
||||
IQueryable<DAL.Models.Host> query = hostService.Get()
|
||||
.Include(t=>t.WorkGroup)
|
||||
.Include(t=>t.WorkGroup).ThenInclude(t=>t!.ResponseArea)
|
||||
.Include(s => s.EkStatus)
|
||||
.Include(s => s.ResponseArea)
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(t => t.Application).ThenInclude(t => t!.ApplicationType)
|
||||
@@ -69,7 +69,7 @@ namespace PARR.API.Controllers.V1
|
||||
public async Task<IActionResult> GetById([FromRoute] Guid id)
|
||||
{
|
||||
var host = await hostService.Get()
|
||||
.Include(t => t.WorkGroup)
|
||||
.Include(t => t.WorkGroup).ThenInclude(t => t!.ResponseArea)
|
||||
.Include(s => s.EkStatus)
|
||||
.Include(s => s.ResponseArea)
|
||||
.Include(t => t.ApplicationsInHosts).ThenInclude(t => t.Application).ThenInclude(t => t!.ApplicationType)
|
||||
|
||||
@@ -88,8 +88,9 @@ namespace PARR.API.MappingProfiles
|
||||
.Include<DAL.Models.Host, HostWithApplicationsResponse>()
|
||||
.ForMember(d => d.Status, o => o.MapFrom(s => s.EkStatus!.Name))
|
||||
.ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.ResponseArea!.Name))
|
||||
.ForMember(d => d.WorkGroupName, o => o.MapFrom(s => s.WorkGroup.Name))
|
||||
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.WorkGroup));
|
||||
.ForMember(d => d.WorkGroupName, o => o.MapFrom(s => s.WorkGroup!.Name))
|
||||
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.WorkGroup))
|
||||
.ForMember(d => d.EkResponseArea, o => o.MapFrom(s => s.ResponseArea));
|
||||
|
||||
CreateMap<DAL.Models.Host, HostTemplateResponse>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user