Disclosures.cs 853 B

12345678910111213141516171819202122232425
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. namespace Web.Api.Endpoints.Stocks;
  4. /// <summary>전자공시(DART) 최신 공시 목록 — corpCls(Y/K/N/E) 선택 필터 + 접수일 내림차순 페이징 (익명 열람). OpenDART 수집.</summary>
  5. internal sealed class Disclosures : IEndpoint
  6. {
  7. public void MapEndpoint(IEndpointRouteBuilder app)
  8. {
  9. app.MapGet("api/disclosures", async (
  10. ISender sender,
  11. string? corpCls = null,
  12. int page = 1,
  13. ushort perPage = 20,
  14. CancellationToken ct = default
  15. ) => {
  16. var result = await sender.Send(new Application.Features.Api.Stocks.GetDisclosures.Query(corpCls, page, perPage), ct);
  17. return ApiResponse.Ok(result);
  18. })
  19. .WithTags("Stocks")
  20. .AllowAnonymous();
  21. }
  22. }