| 12345678910111213141516171819202122232425262728 |
- using Application.Abstractions.Messaging;
- using Web.Api.Common;
- namespace Web.Api.Endpoints.Market;
- /// <summary>거시경제지표 — 지표코드(codes CSV, 미지정 시 전체)별 최근 추이 + 최신값 (KOSIS 수집, 익명 열람). 대시보드용.</summary>
- internal sealed class MacroIndicators : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/market/macro", async (
- ISender sender,
- string? codes = null,
- int limit = 0,
- CancellationToken ct = default
- ) => {
- var codeList = string.IsNullOrWhiteSpace(codes)
- ? []
- : codes.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
- var result = await sender.Send(new Application.Features.Api.Stocks.GetMacroIndicators.Query(codeList, limit), ct);
- return ApiResponse.Ok(result);
- })
- .WithTags("Market")
- .AllowAnonymous();
- }
- }
|