feat(api): в HostResponse добавлен объект EkStatus

This commit is contained in:
Mikhail Trubnikov
2024-06-19 14:11:58 +10:00
parent 27f963371e
commit 8722be0d87
3 changed files with 7 additions and 4 deletions

View File

@@ -1,10 +1,8 @@
using System.ComponentModel.DataAnnotations; namespace PARR.API.Contracts.V1.Responses
namespace PARR.API.Contracts.V1.Responses
{ {
public class EkStatusResponse public class EkStatusResponse
{ {
public int Code { get; set; } public int Code { get; set; }
public string Name { get; set; } = string.Empty; public required string Name { get; set; }
} }
} }

View File

@@ -8,12 +8,16 @@
public required string IP { get; set; } public required string IP { get; set; }
//TODO: Удалить поле Status, использовать EkStatus
public string? Status { get; set; } public string? Status { get; set; }
public EkStatusResponse? EkStatus { get; set; }
public string? WorkGroupName { get; set; } public string? WorkGroupName { get; set; }
public WorkGroupResponse? WorkGroup { get; set; } public WorkGroupResponse? WorkGroup { get; set; }
//TODO: Удалить поле ResponseArea, использовать EkResponseArea
public string? ResponseArea { get; set; } public string? ResponseArea { get; set; }
public ResponseAreaResponse? EkResponseArea { get; set; } public ResponseAreaResponse? EkResponseArea { get; set; }

View File

@@ -87,6 +87,7 @@ namespace PARR.API.MappingProfiles
.Include<DAL.Models.Host, HostTemplateResponse>() .Include<DAL.Models.Host, HostTemplateResponse>()
.Include<DAL.Models.Host, HostWithApplicationsResponse>() .Include<DAL.Models.Host, HostWithApplicationsResponse>()
.ForMember(d => d.Status, o => o.MapFrom(s => s.EkStatus!.Name)) .ForMember(d => d.Status, o => o.MapFrom(s => s.EkStatus!.Name))
.ForMember(d => d.EkStatus, o => o.MapFrom(s => s.EkStatus))
.ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.ResponseArea!.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.WorkGroupName, o => o.MapFrom(s => s.WorkGroup!.Name))
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.WorkGroup)) .ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.WorkGroup))