Implemented caching on all get endpoints and service layer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using PostFundManagement.Application.Abstractions.Services;
|
||||
using PostFundManagement.Application.Extensions;
|
||||
using PostFundManagement.Application.Services.Governance;
|
||||
using PostFundManagement.Domain;
|
||||
using PostFundManagement.Domain.Abstractions;
|
||||
using PostFundManagement.Domain.Extensions;
|
||||
@@ -14,7 +14,7 @@ public class GetOrganisationsEndpoint : IEndpoint
|
||||
{
|
||||
public void Map(IEndpointRouteBuilder builder)
|
||||
{
|
||||
builder.MapGet("api/governance/organisations", async (GovernanceService service,
|
||||
builder.MapGet("api/governance/organisations", async (IGovernanceService service,
|
||||
int page = 1, int pageSize = 100, CancellationToken cancellationToken = default) =>
|
||||
await service.GetOrganisationsAsync(Pagination.Create(page, pageSize), cancellationToken) switch
|
||||
{
|
||||
@@ -27,6 +27,7 @@ public class GetOrganisationsEndpoint : IEndpoint
|
||||
.Produces<Organisation[]>(StatusCodes.Status200OK)
|
||||
.Produces<Problems>(StatusCodes.Status500InternalServerError)
|
||||
.Produces(StatusCodes.Status401Unauthorized)
|
||||
.WithTags(EndpointTags.Governance);
|
||||
.WithTags(EndpointTags.Governance)
|
||||
.CacheOutput();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user