Shady Nagy
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with
20 additions and
19 deletions
-
src/PublicApi/AuthEndpoints/Authenticate.cs
-
src/PublicApi/CatalogBrandEndpoints/List.cs
-
src/PublicApi/CatalogItemEndpoints/Create.cs
-
src/PublicApi/CatalogItemEndpoints/Delete.cs
-
src/PublicApi/CatalogItemEndpoints/GetById.cs
-
src/PublicApi/CatalogItemEndpoints/ListPaged.cs
-
src/PublicApi/CatalogItemEndpoints/Update.cs
-
src/PublicApi/CatalogTypeEndpoints/List.cs
-
src/PublicApi/PublicApi.csproj
-
src/Web/Web.csproj
|
|
|
@ -1,16 +1,10 @@ |
|
|
|
using Ardalis.ApiEndpoints; |
|
|
|
using Microsoft.AspNetCore.Identity; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Constants; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
|
using Microsoft.eShopWeb.Infrastructure.Identity; |
|
|
|
using Microsoft.IdentityModel.Tokens; |
|
|
|
using Swashbuckle.AspNetCore.Annotations; |
|
|
|
using System; |
|
|
|
using System.IdentityModel.Tokens.Jwt; |
|
|
|
using System.Security.Claims; |
|
|
|
using System.Text; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.AuthEndpoints |
|
|
|
@ -34,7 +28,7 @@ namespace Microsoft.eShopWeb.PublicApi.AuthEndpoints |
|
|
|
OperationId = "auth.authenticate", |
|
|
|
Tags = new[] { "AuthEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<AuthenticateResponse>> HandleAsync(AuthenticateRequest request) |
|
|
|
public override async Task<ActionResult<AuthenticateResponse>> HandleAsync(AuthenticateRequest request, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new AuthenticateResponse(request.CorrelationId()); |
|
|
|
|
|
|
|
|
|
|
|
@ -5,6 +5,7 @@ using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
|
using Swashbuckle.AspNetCore.Annotations; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogBrandEndpoints |
|
|
|
@ -28,7 +29,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogBrandEndpoints |
|
|
|
OperationId = "catalog-brands.List", |
|
|
|
Tags = new[] { "CatalogBrandEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<ListCatalogBrandsResponse>> HandleAsync() |
|
|
|
public override async Task<ActionResult<ListCatalogBrandsResponse>> HandleAsync(CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new ListCatalogBrandsResponse(); |
|
|
|
|
|
|
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using System.IO; |
|
|
|
using System.Threading; |
|
|
|
using Ardalis.ApiEndpoints; |
|
|
|
using Microsoft.AspNetCore.Authentication.JwtBearer; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
@ -32,7 +33,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
OperationId = "catalog-items.create", |
|
|
|
Tags = new[] { "CatalogItemEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<CreateCatalogItemResponse>> HandleAsync(CreateCatalogItemRequest request) |
|
|
|
public override async Task<ActionResult<CreateCatalogItemResponse>> HandleAsync(CreateCatalogItemRequest request, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new CreateCatalogItemResponse(request.CorrelationId()); |
|
|
|
|
|
|
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using Ardalis.ApiEndpoints; |
|
|
|
using System.Threading; |
|
|
|
using Ardalis.ApiEndpoints; |
|
|
|
using Microsoft.AspNetCore.Authentication.JwtBearer; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
@ -27,7 +28,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
OperationId = "catalog-items.Delete", |
|
|
|
Tags = new[] { "CatalogItemEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<DeleteCatalogItemResponse>> HandleAsync([FromRoute]DeleteCatalogItemRequest request) |
|
|
|
public override async Task<ActionResult<DeleteCatalogItemResponse>> HandleAsync([FromRoute]DeleteCatalogItemRequest request, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new DeleteCatalogItemResponse(request.CorrelationId()); |
|
|
|
|
|
|
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
using Ardalis.ApiEndpoints; |
|
|
|
using System.Threading; |
|
|
|
using Ardalis.ApiEndpoints; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
|
@ -25,7 +26,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
OperationId = "catalog-items.GetById", |
|
|
|
Tags = new[] { "CatalogItemEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<GetByIdCatalogItemResponse>> HandleAsync([FromRoute] GetByIdCatalogItemRequest request) |
|
|
|
public override async Task<ActionResult<GetByIdCatalogItemResponse>> HandleAsync([FromRoute] GetByIdCatalogItemRequest request, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new GetByIdCatalogItemResponse(request.CorrelationId()); |
|
|
|
|
|
|
|
|
|
|
|
@ -7,6 +7,7 @@ using Microsoft.eShopWeb.ApplicationCore.Specifications; |
|
|
|
using Swashbuckle.AspNetCore.Annotations; |
|
|
|
using System; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
@ -33,7 +34,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
OperationId = "catalog-items.ListPaged", |
|
|
|
Tags = new[] { "CatalogItemEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<ListPagedCatalogItemResponse>> HandleAsync([FromQuery]ListPagedCatalogItemRequest request) |
|
|
|
public override async Task<ActionResult<ListPagedCatalogItemResponse>> HandleAsync([FromQuery]ListPagedCatalogItemRequest request, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new ListPagedCatalogItemResponse(request.CorrelationId()); |
|
|
|
|
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
|
using Swashbuckle.AspNetCore.Annotations; |
|
|
|
using System.IO; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
@ -32,7 +33,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
|
OperationId = "catalog-items.update", |
|
|
|
Tags = new[] { "CatalogItemEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<UpdateCatalogItemResponse>> HandleAsync(UpdateCatalogItemRequest request) |
|
|
|
public override async Task<ActionResult<UpdateCatalogItemResponse>> HandleAsync(UpdateCatalogItemRequest request, CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new UpdateCatalogItemResponse(request.CorrelationId()); |
|
|
|
|
|
|
|
|
|
|
|
@ -5,6 +5,7 @@ using Microsoft.eShopWeb.ApplicationCore.Entities; |
|
|
|
using Microsoft.eShopWeb.ApplicationCore.Interfaces; |
|
|
|
using Swashbuckle.AspNetCore.Annotations; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading; |
|
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogTypeEndpoints |
|
|
|
@ -28,7 +29,7 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogTypeEndpoints |
|
|
|
OperationId = "catalog-types.List", |
|
|
|
Tags = new[] { "CatalogTypeEndpoints" }) |
|
|
|
] |
|
|
|
public override async Task<ActionResult<ListCatalogTypesResponse>> HandleAsync() |
|
|
|
public override async Task<ActionResult<ListCatalogTypesResponse>> HandleAsync(CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
var response = new ListCatalogTypesResponse(); |
|
|
|
|
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ |
|
|
|
</PropertyGroup> |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Ardalis.ApiEndpoints" Version="1.0.0" /> |
|
|
|
<PackageReference Include="Ardalis.ApiEndpoints" Version="2.0.0" /> |
|
|
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" /> |
|
|
|
<PackageReference Include="MediatR" Version="8.0.2" /> |
|
|
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="8.0.1" /> |
|
|
|
|
|
|
|
@ -20,7 +20,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Ardalis.ApiEndpoints" Version="1.0.0" /> |
|
|
|
<PackageReference Include="Ardalis.ApiEndpoints" Version="2.0.0" /> |
|
|
|
<PackageReference Include="Ardalis.ListStartupServices" Version="1.1.3" /> |
|
|
|
<PackageReference Include="Ardalis.Specification" Version="4.0.0" /> |
|
|
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="7.0.0" /> |
|
|
|
|