GetLeaderboard.cs 796 B

1234567891011121314151617181920212223
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.TrackRecord;
  4. /// <summary>예측 적중률 리더보드 — 채점 표본 10+ 회원 HitRate 내림차순 (D2 M4, 익명 허용).</summary>
  5. internal sealed class GetLeaderboard : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/track-records/leaderboard", async (
  10. ISender sender,
  11. string? period = null,
  12. int page = 1,
  13. CancellationToken ct = default
  14. ) => {
  15. var data = await sender.Send(new Application.Features.Api.TrackRecord.GetLeaderboard.Query(period, page), ct);
  16. return ApiResponse.Ok(data);
  17. })
  18. .WithTags("TrackRecord")
  19. .AllowAnonymous();
  20. }
  21. }