feat(api): изменены респонсы Job и JobGroup.

This commit is contained in:
Mikhail Kuznetsov
2025-09-09 17:19:41 +10:00
parent 6d021b23e0
commit aa31af8027
11 changed files with 140 additions and 34 deletions

View File

@@ -114,7 +114,7 @@ namespace PARR.API.MappingProfiles
.ForMember(d => d.Field, o => o.MapFrom(s => s.Field))
.ForMember(d => d.Value, o => o.MapFrom(s => s.Value));
CreateMap<Unit, UnitBaseResponse>()
CreateMap<Unit, UnitResponse>()
.Include<Unit, UnitWithAttributesResponse>()
.ForMember(d => d.Name, o => o.MapFrom(s => s.Name));
@@ -300,10 +300,15 @@ namespace PARR.API.MappingProfiles
#endregion
#region Job
CreateMap<Job, JobBaseResponse>()
.Include<Job, JobResponse>();
CreateMap<Job, JobBaseResponse>();
CreateMap<Job, JobResponse>();
CreateMap<JobUnitFilter, UnitFilterResponse>();
CreateMap<FieldFilter, FieldResponse>();
CreateMap<FieldFilter, FieldFilterResponse>();
CreateMap<JobRelationshipFilter, RelationshipFilterResponse>()
.ForMember(d => d.Field, o => o.MapFrom(s => s.UnitField));
#endregion
#region JobGroup
@@ -313,9 +318,9 @@ namespace PARR.API.MappingProfiles
CreateMap<JobGroup, JobGroupBaseResponse>()
.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()));
CreateMap<JobGroup, JobGroupResponse>();
//.ForMember(d => d.Schedule, o => o.MapFrom<JobGroupScheduleResolver>())
//.ForMember(d => d.JobsCount, o => o.MapFrom(s => s.Jobs.Count()));
#endregion

View File

@@ -14,7 +14,7 @@ namespace PARR.API.MappingProfiles.Resolvers
private readonly SettingsFromDb settingsFromDb;
public JobGroupScheduleResolver(
IEsppSchTypeConfigService esppConfigService,
IEsppSchTypeConfigService esppConfigService,
ILogger<JobGroupScheduleResolver> logger,
IMapper mapper,
SettingsFromDb settingsFromDb