SriBonds.cs 925 B

1234567891011121314151617181920212223242526
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Market;
  4. /// <summary>사회책임투자채권 목록 — 지정일(미지정 시 최신 스냅샷) 페이징, 선택 채권종류 필터 (익명 열람). KRX 사회책임투자채권 수집.</summary>
  5. internal sealed class SriBonds : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/market/esg/sri-bonds", async (
  10. ISender sender,
  11. DateOnly? date = null,
  12. string? bondType = null,
  13. int page = 1,
  14. ushort perPage = 20,
  15. CancellationToken ct = default
  16. ) => {
  17. var result = await sender.Send(new Application.Features.Api.Stocks.GetSriBonds.Query(date, bondType, page, perPage), ct);
  18. return ApiResponse.Ok(result);
  19. })
  20. .WithTags("Market")
  21. .AllowAnonymous();
  22. }
  23. }