feat(api): Актуализация JobResponse под фронт; Template метод GetAll ищет по Job а не JobGroup
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Поиск по ИД Задания (JobGroupId)
|
||||
/// Поиск по ИД Задания (JobId)
|
||||
/// </summary>
|
||||
public Guid? JobGroupId { get; set; }
|
||||
public Guid? JobId { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
public class UnitFilterResponse
|
||||
{
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
public required string UnitFilterMask { get; set; }
|
||||
|
||||
public List<FieldFilterResponse>? FieldFilters { get; set; }
|
||||
@@ -46,6 +48,8 @@
|
||||
|
||||
public class FieldFilterResponse
|
||||
{
|
||||
public required Guid Id { get; set; }
|
||||
|
||||
public required FieldResponse Field { get; set; }
|
||||
|
||||
public string? ValueMask { get; set; }
|
||||
|
||||
@@ -69,8 +69,8 @@ namespace PARR.API.Controllers.V1
|
||||
if (!string.IsNullOrEmpty(filter.Mask))
|
||||
query = query.Where(t => EF.Functions.Like(t.Name.ToLower(), SqlHelpers.RegexToLike(filter.Mask)));
|
||||
|
||||
if (filter.JobGroupId.HasValue)
|
||||
query = query.Where(t => t.Job!.GroupId == filter.JobGroupId.Value);
|
||||
if (filter.JobId.HasValue)
|
||||
query = query.Where(t => t.JobId == filter.JobId);
|
||||
|
||||
var templates = await templateService.GetPage(query, paginationFilter).ToListAsync();
|
||||
|
||||
|
||||
@@ -200,8 +200,6 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.ScheduleTypeCode, o => o.MapFrom(s =>
|
||||
s.Template!.Job!.Group!.EsppSchValues!.First()!.EsppSchTypeConfig!.EsppSchTypeSchedule!.Id))
|
||||
.ForMember(d => d.Schedule, o => o.MapFrom<RobotTaskScheduleSchResolver>());
|
||||
// === RobotConfiguration ===
|
||||
#endregion
|
||||
|
||||
CreateMap<Robot, RobotResponse>();
|
||||
|
||||
@@ -211,7 +209,8 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.Robot, o => o.MapFrom(s => s.Robot))
|
||||
.ForMember(d => d.TaskStatus, o => o.MapFrom(s => s.TaskStatus))
|
||||
.ForMember(d => d.RobotStatus, o => o.MapFrom(s => s.RobotStatus));
|
||||
|
||||
// === RobotConfiguration ===
|
||||
#endregion
|
||||
|
||||
#region EsppSch
|
||||
CreateMap<EsppSchTypeSchedule, EsppScheduleTypeScheduleResponse>()
|
||||
@@ -240,6 +239,7 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.Type, o => o.MapFrom(s => s.Type));
|
||||
#endregion EsppSch
|
||||
|
||||
#region AgentHistory
|
||||
CreateMap<AgentHistoryLevel, AgentHistoryLevelResponse>();
|
||||
|
||||
CreateMap<AgentHistory, AgentHistoryResponse>()
|
||||
@@ -247,6 +247,7 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.Level, o => o.MapFrom(s => s.AgentHistoryLevel))
|
||||
.ForMember(d => d.TemplateName, o => o.MapFrom(s => s.Template!.Name));
|
||||
|
||||
#endregion
|
||||
|
||||
#region User
|
||||
|
||||
@@ -303,9 +304,13 @@ namespace PARR.API.MappingProfiles
|
||||
CreateMap<Job, JobBaseResponse>();
|
||||
CreateMap<Job, JobResponse>();
|
||||
|
||||
CreateMap<JobUnitFilter, UnitFilterResponse>();
|
||||
CreateMap<JobUnitFilter, UnitFilterResponse>()
|
||||
.ForMember(d => d.UnitFilterMask, o => o.MapFrom(d => d.UnitFilter));
|
||||
|
||||
CreateMap<FieldFilter, FieldResponse>();
|
||||
|
||||
CreateMap<FieldFilter, FieldFilterResponse>();
|
||||
|
||||
CreateMap<JobRelationshipFilter, RelationshipFilterResponse>()
|
||||
.ForMember(d => d.Field, o => o.MapFrom(s => s.UnitField));
|
||||
|
||||
@@ -319,8 +324,7 @@ namespace PARR.API.MappingProfiles
|
||||
.ForMember(d => d.Name, o => o.MapFrom(s => s.GroupName));
|
||||
|
||||
CreateMap<JobGroup, JobGroupResponse>();
|
||||
//.ForMember(d => d.Schedule, o => o.MapFrom<JobGroupScheduleResolver>())
|
||||
//.ForMember(d => d.JobsCount, o => o.MapFrom(s => s.Jobs.Count()));
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user