| 123456789101112131415161718192021222324252627282930 |
- using Application.Abstractions.Messaging;
- using Web.Api.Common;
- using Web.Api.Extensions;
- namespace Web.Api.Endpoints.Market;
- /// <summary>외화증권 국가별 보관금액 추이 — 서학개미 위젯용. 국가·종목구분·기간 필터 (익명 열람). SEIBro getNationFrsecCusInfo 수집.</summary>
- internal sealed class ForeignCustody : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/market/foreign-custody", async (
- ISender sender,
- string? nation = null,
- string? secnTpcd = null,
- DateOnly? from = null,
- DateOnly? to = null,
- CancellationToken ct = default
- ) => {
- var result = await sender.Send(new Application.Features.Api.Stocks.GetForeignCustody.Query(nation, secnTpcd, from, to), ct);
- return result.Match(
- () => ApiResponse.Ok(result.Value),
- CustomResults.Problem
- );
- })
- .WithTags("Market")
- .AllowAnonymous();
- }
- }
|