feat(api): В респонс задания добавлено поле ScheduleTypeCode. Заготовка респонса для шаблона с включенным заданием.
This commit is contained in:
45
PARR.API/Contracts/V1/Responses/EsppScheduleResponse.cs
Normal file
45
PARR.API/Contracts/V1/Responses/EsppScheduleResponse.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
namespace PARR.API.Contracts.V1.Responses
|
||||||
|
{
|
||||||
|
// Вот это тот самый респонс
|
||||||
|
public class EsppScheduleResponse
|
||||||
|
{
|
||||||
|
public EsppScheduleTypeScheduleResponse? TypeSchedule { get; set; }
|
||||||
|
|
||||||
|
public List<EsppScheduleValResponse>? Values { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EsppScheduleValResponse
|
||||||
|
{
|
||||||
|
public int Order { get; set; }
|
||||||
|
|
||||||
|
public EsppScheduleTypeResponse? Type { get; set; }
|
||||||
|
|
||||||
|
public EsppScheduleTypeValueResponse? Value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EsppScheduleTypeScheduleResponse
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
public required string Description { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EsppScheduleTypeResponse
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
public required string Description { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class EsppScheduleTypeValueResponse
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public required string Name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -36,6 +36,11 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public required string ScheduleType { get; set; }
|
public required string ScheduleType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Код задания
|
||||||
|
/// </summary>
|
||||||
|
public int ScheduleTypeCode { get; set; }
|
||||||
|
|
||||||
public List<RobotTaskScheduleSchResponse>? Schedule { get; set; }
|
public List<RobotTaskScheduleSchResponse>? Schedule { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,9 @@
|
|||||||
public TnkResponse? Tnk { get; set; }
|
public TnkResponse? Tnk { get; set; }
|
||||||
|
|
||||||
public List<RobotConfigurationResponse>? SyncStatus { get; set; }
|
public List<RobotConfigurationResponse>? SyncStatus { get; set; }
|
||||||
|
|
||||||
|
//TODO: тут сделать биндинг!!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!!
|
||||||
|
public EsppScheduleResponse? Schedule { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//public class TemplateStringResponse
|
//public class TemplateStringResponse
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ namespace PARR.API.MappingProfiles
|
|||||||
.ForMember(d => d.NextStart, o => o.MapFrom(s => EsppScheduleHelpers.GetFirstStart(s.Template!.ApplicationsInWork!.ScheduleStartDate, s.Template!.ApplicationsInWork!.ScheduleGenerationTime)))
|
.ForMember(d => d.NextStart, o => o.MapFrom(s => EsppScheduleHelpers.GetFirstStart(s.Template!.ApplicationsInWork!.ScheduleStartDate, s.Template!.ApplicationsInWork!.ScheduleGenerationTime)))
|
||||||
.ForMember(d => d.ScheduleType, o => o.MapFrom(s =>
|
.ForMember(d => d.ScheduleType, o => o.MapFrom(s =>
|
||||||
s.Template!.ApplicationsInWork!.EsppSchValues!.First()!.EsppSchTypeConfig!.EsppSchTypeSchedule!.Description))
|
s.Template!.ApplicationsInWork!.EsppSchValues!.First()!.EsppSchTypeConfig!.EsppSchTypeSchedule!.Description))
|
||||||
|
.ForMember(d => d.ScheduleTypeCode, o => o.MapFrom(s =>
|
||||||
|
s.Template!.ApplicationsInWork!.EsppSchValues!.First()!.EsppSchTypeConfig!.EsppSchTypeSchedule!.Id))
|
||||||
.ForMember(d => d.Schedule, o => o.MapFrom<RobotTaskScheduleSchResolver>());
|
.ForMember(d => d.Schedule, o => o.MapFrom<RobotTaskScheduleSchResolver>());
|
||||||
// === RobotConfiguration ===
|
// === RobotConfiguration ===
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user