SriBonds.cs 1.1 KB

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