GetLeaderboard.cs 769 B

123456789101112131415161718192021222324
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Paper;
  4. /// <summary>모의투자 리더보드 — 수익률/승률/MDD × 주/월/전체 (익명 허용).</summary>
  5. internal sealed class GetLeaderboard : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/paper/leaderboard", async (
  10. string? sort,
  11. string? period,
  12. int? page,
  13. ISender sender,
  14. CancellationToken ct
  15. ) => {
  16. var data = await sender.Send(new Application.Features.Api.Paper.GetLeaderboard.Query(sort, period, page ?? 1), ct);
  17. return ApiResponse.Ok(data);
  18. })
  19. .WithTags("Paper")
  20. .AllowAnonymous();
  21. }
  22. }