feat(api): в WorkGroupResponse добавлена ResponseArea
This commit is contained in:
9
PARR.API/Contracts/V1/Responses/ResponseAreaResponse.cs
Normal file
9
PARR.API/Contracts/V1/Responses/ResponseAreaResponse.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
namespace PARR.API.Contracts.V1.Responses
|
||||||
|
{
|
||||||
|
public class ResponseAreaResponse
|
||||||
|
{
|
||||||
|
public int Code { get; set; }
|
||||||
|
|
||||||
|
public required string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,5 +5,7 @@
|
|||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
public required string Name { get; set; }
|
public required string Name { get; set; }
|
||||||
|
|
||||||
|
public ResponseAreaResponse? ResponseArea { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
var paginationFilter = mapper.Map<PaginationFilter>(paginationQuery);
|
var paginationFilter = mapper.Map<PaginationFilter>(paginationQuery);
|
||||||
|
|
||||||
IQueryable<WorkGroup> query = workGroupService.Get()
|
IQueryable<WorkGroup> query = workGroupService.Get()
|
||||||
|
.Include(t => t.ResponseArea)
|
||||||
.OrderBy(t => t.Name);
|
.OrderBy(t => t.Name);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(filter.Name))
|
if (!string.IsNullOrEmpty(filter.Name))
|
||||||
@@ -69,7 +70,7 @@ namespace PARR.API.Controllers.V1
|
|||||||
[HttpGet(ApiRoutes.WorkGroup.Get)]
|
[HttpGet(ApiRoutes.WorkGroup.Get)]
|
||||||
public async Task<IActionResult> Get([FromRoute] Guid id)
|
public async Task<IActionResult> Get([FromRoute] Guid id)
|
||||||
{
|
{
|
||||||
var workGroup = await workGroupService.GetAsync(id);
|
var workGroup = await workGroupService.Get().Include(t => t.ResponseArea).FirstOrDefaultAsync(t => t.Id == id);
|
||||||
|
|
||||||
if (workGroup == null)
|
if (workGroup == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|||||||
@@ -261,6 +261,10 @@ namespace PARR.API.MappingProfiles
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region ResponseArea
|
||||||
|
CreateMap<ResponseArea, ResponseAreaResponse>();
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
CreateMap<EkStatus, EkStatusResponse>();
|
CreateMap<EkStatus, EkStatusResponse>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user