| 12345678910111213141516171819202122232425262728293031323334 |
- using System.Security.Claims;
- using Application.Abstractions.Messaging;
- using Domain.Entities.Paper.ValueObject;
- using Web.Api.Common;
- using Web.Api.Extensions;
- namespace Web.Api.Endpoints.Paper;
- /// <summary>모의투자 — 주문·체결 내역.</summary>
- internal sealed class GetOrders : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/paper/orders", async (
- PaperOrderStatus? status,
- int? page,
- ushort? perPage,
- ClaimsPrincipal user,
- ISender sender,
- CancellationToken ct
- ) => {
- var memberID = user.GetRequiredMemberID();
- var data = await sender.Send(new Application.Features.Api.Paper.GetOrders.Query(
- memberID,
- status,
- page is > 0 ? page.Value : 1,
- perPage is > 0 ? perPage.Value : (ushort)20
- ), ct);
- return ApiResponse.Ok(data);
- })
- .WithTags("Paper")
- .RequireAuthorization();
- }
- }
|