LockupCalendar.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 LockupCalendar : IEndpoint
  7. {
  8. public void MapEndpoint(IEndpointRouteBuilder app)
  9. {
  10. app.MapGet("api/market/lockup-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.GetLockupCalendar.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. }