Indices.cs 697 B

12345678910111213141516171819202122
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Market;
  4. /// <summary>대표 시장지수 — 최신 거래일의 코스피/코스닥(+KRX 100). 헤더 티커 + /market 용 (익명 열람).</summary>
  5. internal sealed class Indices : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/market/indices", async (
  10. ISender sender,
  11. CancellationToken ct
  12. ) => {
  13. var result = await sender.Send(new Application.Features.Api.Stocks.GetIndices.Query(), ct);
  14. return ApiResponse.Ok(result);
  15. })
  16. .WithTags("Market")
  17. .AllowAnonymous();
  18. }
  19. }