MeetingCalendar.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. using Application.Abstractions.Messaging;
  2. using Web.Api.Common;
  3. using Web.Api.Extensions;
  4. namespace Web.Api.Endpoints.Market;
  5. /// <summary>주총 캘린더 — 기간(총회일 from/to) 주주총회 일정 목록. 종목명·총회종류·전자투표·안건수 포함 (익명 열람). SEIBro 기업행위 수집.</summary>
  6. internal sealed class MeetingCalendar : IEndpoint
  7. {
  8. public void MapEndpoint(IEndpointRouteBuilder app)
  9. {
  10. app.MapGet("api/market/meeting-calendar", async (
  11. ISender sender,
  12. DateOnly? from = null,
  13. DateOnly? to = null,
  14. int page = 1,
  15. ushort perPage = 30,
  16. CancellationToken ct = default
  17. ) => {
  18. var result = await sender.Send(new Application.Features.Api.Stocks.GetMeetingCalendar.Query(from, to, page, perPage), ct);
  19. return result.Match(
  20. () => ApiResponse.Ok(result.Value),
  21. CustomResults.Problem
  22. );
  23. })
  24. .WithTags("Market")
  25. .AllowAnonymous();
  26. }
  27. }