feat(api): в HostResponse добавлен объект EkStatus
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace PARR.API.Contracts.V1.Responses
|
||||
namespace PARR.API.Contracts.V1.Responses
|
||||
{
|
||||
public class EkStatusResponse
|
||||
{
|
||||
public int Code { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,16 @@
|
||||
|
||||
public required string IP { get; set; }
|
||||
|
||||
//TODO: Удалить поле Status, использовать EkStatus
|
||||
public string? Status { get; set; }
|
||||
|
||||
public EkStatusResponse? EkStatus { get; set; }
|
||||
|
||||
public string? WorkGroupName { get; set; }
|
||||
|
||||
public WorkGroupResponse? WorkGroup { get; set; }
|
||||
|
||||
//TODO: Удалить поле ResponseArea, использовать EkResponseArea
|
||||
public string? ResponseArea { get; set; }
|
||||
|
||||
public ResponseAreaResponse? EkResponseArea { get; set; }
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace PARR.API.MappingProfiles
|
||||
.Include<DAL.Models.Host, HostTemplateResponse>()
|
||||
.Include<DAL.Models.Host, HostWithApplicationsResponse>()
|
||||
.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.WorkGroupName, o => o.MapFrom(s => s.WorkGroup!.Name))
|
||||
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.WorkGroup))
|
||||
|
||||
Reference in New Issue
Block a user