1
This commit is contained in:
18
Yes.Blog/Endpoints/Admins/Statistics/GetStatsEndpoint.cs
Normal file
18
Yes.Blog/Endpoints/Admins/Statistics/GetStatsEndpoint.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Yes.Blog.Endpoints.Admins.Statistics
|
||||
{
|
||||
public class GetStatsEndpoint : AdminEndpointScheme, IEndpoint
|
||||
{
|
||||
public void Map(IEndpointRouteBuilder app) => app.MapGet("/Stats", Handle);
|
||||
|
||||
|
||||
private async Task<IResult> Handle(IMediator mediator, IMapper mapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var query = new GetStatsQuery();
|
||||
var response = await mediator.Send(query, cancellationToken);
|
||||
|
||||
|
||||
return Result.Ok(response);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user