22 lines
602 B
C#
22 lines
602 B
C#
namespace Yes.Blog.Endpoints.Migrators
|
|
{
|
|
public class MigrateDownEndpoint : MigratorEndpointScheme, IEndpoint
|
|
{
|
|
public void Map(IEndpointRouteBuilder app) => app.MapGet("/down", Handle).AllowAnonymous();
|
|
|
|
public record Request(long Version);
|
|
|
|
private async Task<Microsoft.AspNetCore.Http.IResult> Handle(
|
|
[AsParameters] Request request,
|
|
IMediator mediator,
|
|
IMapper mapper,
|
|
CancellationToken cancellationToken)
|
|
{
|
|
var command = new MigrateDownCommand(request.Version);
|
|
var response = await mediator.Send(command, cancellationToken);
|
|
|
|
return Results.Ok("down");
|
|
}
|
|
}
|
|
}
|