| 1234567891011121314151617181920212223242526 |
- using Web.Api.Common;
- using Application.Abstractions.Messaging;
- namespace Web.Api.Endpoints.Store;
- /// <summary>상점 — 상품 상세 (Frontend 사용자).</summary>
- internal sealed class ProductsGet : IEndpoint
- {
- public void MapEndpoint(IEndpointRouteBuilder app)
- {
- app.MapGet("api/store/products/{id:int}", async (
- int id,
- ISender sender,
- CancellationToken ct
- ) => {
- var result = await sender.Send(new Application.Features.Api.Store.Products.Get.Query(id), ct);
- if (result.IsFailure)
- {
- return CustomResults.Problem(result);
- }
- return ApiResponse.Ok(result.Value);
- })
- .WithTags("Store")
- .AllowAnonymous();
- }
- }
|