Browse Source
Update to latest Endpoints package and fix breaking changes (#506)
main
Steve Smith
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with
56 additions and
39 deletions
-
src/BlazorShared/BlazorShared.csproj
-
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
|
|
@ -8,6 +8,7 @@ |
|
|
|
|
|
|
|
|
<ItemGroup> |
|
|
<ItemGroup> |
|
|
<PackageReference Include="BlazorInputFile" Version="0.2.0" /> |
|
|
<PackageReference Include="BlazorInputFile" Version="0.2.0" /> |
|
|
|
|
|
<PackageReference Include="FluentValidation" Version="9.3.0" /> |
|
|
</ItemGroup> |
|
|
</ItemGroup> |
|
|
|
|
|
|
|
|
</Project> |
|
|
</Project> |
|
|
|
|
|
@ -9,7 +9,9 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.AuthEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.AuthEndpoints |
|
|
{ |
|
|
{ |
|
|
public class Authenticate : BaseAsyncEndpoint<AuthenticateRequest, AuthenticateResponse> |
|
|
public class Authenticate : BaseAsyncEndpoint |
|
|
|
|
|
.WithRequest<AuthenticateRequest> |
|
|
|
|
|
.WithResponse<AuthenticateResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly SignInManager<ApplicationUser> _signInManager; |
|
|
private readonly SignInManager<ApplicationUser> _signInManager; |
|
|
private readonly ITokenClaimsService _tokenClaimsService; |
|
|
private readonly ITokenClaimsService _tokenClaimsService; |
|
|
|
|
|
@ -10,7 +10,9 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogBrandEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogBrandEndpoints |
|
|
{ |
|
|
{ |
|
|
public class List : BaseAsyncEndpoint<ListCatalogBrandsResponse> |
|
|
public class List : BaseAsyncEndpoint |
|
|
|
|
|
.WithoutRequest |
|
|
|
|
|
.WithResponse<ListCatalogBrandsResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogBrand> _catalogBrandRepository; |
|
|
private readonly IAsyncRepository<CatalogBrand> _catalogBrandRepository; |
|
|
private readonly IMapper _mapper; |
|
|
private readonly IMapper _mapper; |
|
|
|
|
|
@ -13,7 +13,9 @@ namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|
|
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|
|
public class Create : BaseAsyncEndpoint<CreateCatalogItemRequest, CreateCatalogItemResponse> |
|
|
public class Create : BaseAsyncEndpoint |
|
|
|
|
|
.WithRequest<CreateCatalogItemRequest> |
|
|
|
|
|
.WithResponse<CreateCatalogItemResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
|
|
|
@ -11,7 +11,9 @@ using System.Threading.Tasks; |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
{ |
|
|
{ |
|
|
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|
|
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|
|
public class Delete : BaseAsyncEndpoint<DeleteCatalogItemRequest, DeleteCatalogItemResponse> |
|
|
public class Delete : BaseAsyncEndpoint |
|
|
|
|
|
.WithRequest<DeleteCatalogItemRequest> |
|
|
|
|
|
.WithResponse<DeleteCatalogItemResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
|
|
|
|
|
|
|
|
|
@ -8,7 +8,9 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
{ |
|
|
{ |
|
|
public class GetById : BaseAsyncEndpoint<GetByIdCatalogItemRequest, GetByIdCatalogItemResponse> |
|
|
public class GetById : BaseAsyncEndpoint |
|
|
|
|
|
.WithRequest<GetByIdCatalogItemRequest> |
|
|
|
|
|
.WithResponse<GetByIdCatalogItemResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
|
|
|
@ -12,7 +12,9 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
{ |
|
|
{ |
|
|
public class ListPaged : BaseAsyncEndpoint<ListPagedCatalogItemRequest, ListPagedCatalogItemResponse> |
|
|
public class ListPaged : BaseAsyncEndpoint |
|
|
|
|
|
.WithRequest<ListPagedCatalogItemRequest> |
|
|
|
|
|
.WithResponse<ListPagedCatalogItemResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
|
|
|
@ -12,7 +12,9 @@ using System.Threading.Tasks; |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogItemEndpoints |
|
|
{ |
|
|
{ |
|
|
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|
|
[Authorize(Roles = BlazorShared.Authorization.Constants.Roles.ADMINISTRATORS, AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] |
|
|
public class Update : BaseAsyncEndpoint<UpdateCatalogItemRequest, UpdateCatalogItemResponse> |
|
|
public class Update : BaseAsyncEndpoint |
|
|
|
|
|
.WithRequest<UpdateCatalogItemRequest> |
|
|
|
|
|
.WithResponse<UpdateCatalogItemResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IAsyncRepository<CatalogItem> _itemRepository; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
private readonly IUriComposer _uriComposer; |
|
|
|
|
|
@ -10,7 +10,9 @@ using System.Threading.Tasks; |
|
|
|
|
|
|
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogTypeEndpoints |
|
|
namespace Microsoft.eShopWeb.PublicApi.CatalogTypeEndpoints |
|
|
{ |
|
|
{ |
|
|
public class List : BaseAsyncEndpoint<ListCatalogTypesResponse> |
|
|
public class List : BaseAsyncEndpoint |
|
|
|
|
|
.WithoutRequest |
|
|
|
|
|
.WithResponse<ListCatalogTypesResponse> |
|
|
{ |
|
|
{ |
|
|
private readonly IAsyncRepository<CatalogType> _catalogTypeRepository; |
|
|
private readonly IAsyncRepository<CatalogType> _catalogTypeRepository; |
|
|
private readonly IMapper _mapper; |
|
|
private readonly IMapper _mapper; |
|
|
|
|
|
@ -9,7 +9,7 @@ |
|
|
</PropertyGroup> |
|
|
</PropertyGroup> |
|
|
|
|
|
|
|
|
<ItemGroup> |
|
|
<ItemGroup> |
|
|
<PackageReference Include="Ardalis.ApiEndpoints" Version="2.0.0" /> |
|
|
<PackageReference Include="Ardalis.ApiEndpoints" Version="3.0.0" /> |
|
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" /> |
|
|
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.0" /> |
|
|
<PackageReference Include="MediatR" Version="9.0.0" /> |
|
|
<PackageReference Include="MediatR" Version="9.0.0" /> |
|
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> |
|
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" /> |
|
|
|