InterestRates.cs 901 B

12345678910111213141516171819202122232425
  1. using Application.Abstractions.Messaging;
  2. using Domain.Entities.Stocks.ValueObject;
  3. using Web.Api.Common;
  4. namespace Web.Api.Endpoints.Market;
  5. /// <summary>금리 목록 — 종류별(대출/국제) 지정일(미지정 시 최신 거래일)의 항목별 금리 (수출입은행 AP02/AP03 수집, 익명 열람).</summary>
  6. internal sealed class InterestRates : IEndpoint
  7. {
  8. public void MapEndpoint(IEndpointRouteBuilder app)
  9. {
  10. app.MapGet("api/market/interest-rates", async (
  11. ISender sender,
  12. RateType type = RateType.International,
  13. DateOnly? date = null,
  14. CancellationToken ct = default
  15. ) => {
  16. var result = await sender.Send(new Application.Features.Api.Stocks.GetInterestRates.Query(type, date), ct);
  17. return ApiResponse.Ok(result);
  18. })
  19. .WithTags("Market")
  20. .AllowAnonymous();
  21. }
  22. }