| 123456789101112131415161718192021222324252627282930313233343536 |
- using MediatR;
- using Web.Api.Common;
- namespace Web.Api.Endpoints.Crypto;
- internal sealed class CryptoOrderbook : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/crypto/{symbol}/orderbook", async (
- string symbol,
- ISender sender,
- CancellationToken ct
- ) =>
- {
- return ApiResponse.Ok(
- await sender.Send(new Application.Features.Api.Crypto.Orderbook.Get.Query(symbol), ct)
- );
- })
- .WithTags("Crypto")
- .AllowAnonymous();
- app.MapGet("api/crypto/{symbol}/orderbook/live", async (
- string symbol,
- ISender sender,
- CancellationToken ct
- ) =>
- {
- return ApiResponse.Ok(
- await sender.Send(new Application.Features.Api.Crypto.Orderbook.GetLive.Query(symbol), ct)
- );
- })
- .WithTags("Crypto")
- .AllowAnonymous();
- }
- }
|