feat(api): в респонс истории робота, добавил инфу о роботе
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
public string? TemplateName { get; set; }
|
public string? TemplateName { get; set; }
|
||||||
|
|
||||||
|
public RobotResponse? Robot { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,8 @@ namespace PARR.API.Controllers.V1
|
|||||||
IQueryable<RobotHistory> query = robotHistoryService.Get()
|
IQueryable<RobotHistory> query = robotHistoryService.Get()
|
||||||
.Include(t => t.RobotConfiguration)
|
.Include(t => t.RobotConfiguration)
|
||||||
.ThenInclude(t => t!.Template)
|
.ThenInclude(t => t!.Template)
|
||||||
|
.Include(t => t.RobotConfiguration)
|
||||||
|
.ThenInclude(t => t!.Robot)
|
||||||
.Include(t => t.RobotHistoryLevel)
|
.Include(t => t.RobotHistoryLevel)
|
||||||
.Include(t => t.StatusTask)
|
.Include(t => t.StatusTask)
|
||||||
.OrderByDescending(t => t.DateCreated);
|
.OrderByDescending(t => t.DateCreated);
|
||||||
@@ -116,6 +118,8 @@ namespace PARR.API.Controllers.V1
|
|||||||
var createdObj = await robotHistoryService.Get()
|
var createdObj = await robotHistoryService.Get()
|
||||||
.Include(t => t.RobotConfiguration)
|
.Include(t => t.RobotConfiguration)
|
||||||
.ThenInclude(t => t!.Template)
|
.ThenInclude(t => t!.Template)
|
||||||
|
.Include(t => t.RobotConfiguration)
|
||||||
|
.ThenInclude(t => t!.Robot)
|
||||||
.Include(t => t.RobotHistoryLevel)
|
.Include(t => t.RobotHistoryLevel)
|
||||||
.Include(t => t.StatusTask)
|
.Include(t => t.StatusTask)
|
||||||
.FirstOrDefaultAsync(t => t.Id == history.Id);
|
.FirstOrDefaultAsync(t => t.Id == history.Id);
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ namespace PARR.API.MappingProfiles
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Robot
|
||||||
|
|
||||||
CreateMap<RobotStatus, RobotStatusResponse>();
|
CreateMap<RobotStatus, RobotStatusResponse>();
|
||||||
|
|
||||||
CreateMap<RobotHistoryLevel, RobotHistoryLevelResponse>();
|
CreateMap<RobotHistoryLevel, RobotHistoryLevelResponse>();
|
||||||
@@ -86,8 +88,10 @@ namespace PARR.API.MappingProfiles
|
|||||||
.ForMember(d => d.TaskId, o => o.MapFrom(s => s.RobotConfigurationId))
|
.ForMember(d => d.TaskId, o => o.MapFrom(s => s.RobotConfigurationId))
|
||||||
.ForMember(d => d.TaskStatus, o => o.MapFrom(s => s.StatusTask))
|
.ForMember(d => d.TaskStatus, o => o.MapFrom(s => s.StatusTask))
|
||||||
.ForMember(d => d.TemplateId, o => o.MapFrom(s => s.RobotConfiguration!.TemplateId))
|
.ForMember(d => d.TemplateId, o => o.MapFrom(s => s.RobotConfiguration!.TemplateId))
|
||||||
.ForMember(d => d.TemplateName, o => o.MapFrom(s => s.RobotConfiguration!.Template!.Name));
|
.ForMember(d => d.TemplateName, o => o.MapFrom(s => s.RobotConfiguration!.Template!.Name))
|
||||||
|
.ForMember(d => d.Robot, o => o.MapFrom(s => s.RobotConfiguration!.Robot));
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region RobotConfiguration
|
#region RobotConfiguration
|
||||||
// --- RobotConfiguration ---
|
// --- RobotConfiguration ---
|
||||||
|
|||||||
Reference in New Issue
Block a user