StockDisclosures.cs 867 B

12345678910111213141516171819202122232425
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Stocks;
  4. /// <summary>특정 종목(6자리 코드)의 전자공시(DART) 목록 — 접수일 내림차순 페이징 (익명 열람). OpenDART 수집.</summary>
  5. internal sealed class StockDisclosures : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/stocks/{code:regex(^\\d{{6}}$)}/disclosures", async (
  10. string code,
  11. ISender sender,
  12. int page = 1,
  13. ushort perPage = 20,
  14. CancellationToken ct = default
  15. ) => {
  16. var result = await sender.Send(new Application.Features.Api.Stocks.GetStockDisclosures.Query(code, page, perPage), ct);
  17. return ApiResponse.Ok(result);
  18. })
  19. .WithTags("Stocks")
  20. .AllowAnonymous();
  21. }
  22. }