Add Products Protobuf project and update references

This commit is contained in:
masoodafar-web
2025-11-17 22:54:13 +03:30
parent 2446b2b76b
commit 37be756df0
8 changed files with 31 additions and 9 deletions

View File

@@ -2,7 +2,9 @@ using CMSMicroservice.Protobuf.Protos.Package;
using CMSMicroservice.Protobuf.Protos.Products;
namespace FrontOffice.BFF.Application.ProductsCQ.Queries.GetAllProductsByFilter;
public class GetAllProductsByFilterQueryHandler : IRequestHandler<GetAllProductsByFilterQuery, GetAllProductsByFilterResponseDto>
public class
GetAllProductsByFilterQueryHandler : IRequestHandler<GetAllProductsByFilterQuery, GetAllProductsByFilterResponseDto>
{
private readonly IApplicationContractContext _context;
@@ -11,9 +13,11 @@ public class GetAllProductsByFilterQueryHandler : IRequestHandler<GetAllProducts
_context = context;
}
public async Task<GetAllProductsByFilterResponseDto> Handle(GetAllProductsByFilterQuery request, CancellationToken cancellationToken)
public async Task<GetAllProductsByFilterResponseDto> Handle(GetAllProductsByFilterQuery request,
CancellationToken cancellationToken)
{
var result= await _context.Package.GetAllPackageByFilterAsync(request.Adapt<GetAllPackageByFilterRequest>(), cancellationToken: cancellationToken);
return result.Adapt<GetAllProductsByFilterResponseDto>();
var result = await _context.Product.GetAllProductsByFilterAsync(request.Adapt<GetAllProductsByFilterRequest>(),
cancellationToken: cancellationToken);
return result.Adapt<GetAllProductsByFilterResponseDto>();
}
}
}

View File

@@ -20,6 +20,7 @@
<ItemGroup>
<ProjectReference Include="..\FrontOffice.BFF.Application\FrontOffice.BFF.Application.csproj" />
<ProjectReference Include="..\FrontOffice.BFF.Infrastructure\FrontOffice.BFF.Infrastructure.csproj" />
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.Products.Protobuf\FrontOffice.BFF.Products.Protobuf.csproj" />
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.Transaction.Protobuf\FrontOffice.BFF.Transaction.Protobuf.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -1,7 +1,8 @@
using CMSMicroservice.Protobuf.Protos.Products;
using FrontOffice.BFF.WebApi.Common.Services;
using FrontOffice.BFF.Application.ProductsCQ.Queries.GetProducts;
using FrontOffice.BFF.Application.ProductsCQ.Queries.GetAllProductsByFilter;
using FrontOffice.BFF.Products.Protobuf.Protos.Products;
namespace FrontOffice.BFF.WebApi.Services;
public class ProductsService : ProductsContract.ProductsContractBase
{

View File

@@ -22,6 +22,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontOffice.BFF.UserOrder.P
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontOffice.BFF.Transaction.Protobuf", "Protobufs\FrontOffice.BFF.Transaction.Protobuf\FrontOffice.BFF.Transaction.Protobuf.csproj", "{F59861D9-01D6-44C9-85A9-E6050D55D290}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FrontOffice.BFF.Products.Protobuf", "Protobufs\FrontOffice.BFF.Products.Protobuf\FrontOffice.BFF.Products.Protobuf.csproj", "{CB77669F-5B48-4AC6-B20E-A928660E93F8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -64,6 +66,10 @@ Global
{F59861D9-01D6-44C9-85A9-E6050D55D290}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F59861D9-01D6-44C9-85A9-E6050D55D290}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F59861D9-01D6-44C9-85A9-E6050D55D290}.Release|Any CPU.Build.0 = Release|Any CPU
{CB77669F-5B48-4AC6-B20E-A928660E93F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB77669F-5B48-4AC6-B20E-A928660E93F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB77669F-5B48-4AC6-B20E-A928660E93F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB77669F-5B48-4AC6-B20E-A928660E93F8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -74,5 +80,6 @@ Global
{D70F0C9A-E954-4A67-B23D-9BE22721BD5D} = {CA9BF4D6-6729-4011-888E-48F5F739B469}
{663CDDFA-E15F-4356-AE01-2311C9B83D52} = {CA9BF4D6-6729-4011-888E-48F5F739B469}
{F59861D9-01D6-44C9-85A9-E6050D55D290} = {CA9BF4D6-6729-4011-888E-48F5F739B469}
{CB77669F-5B48-4AC6-B20E-A928660E93F8} = {CA9BF4D6-6729-4011-888E-48F5F739B469}
EndGlobalSection
EndGlobal

View File

@@ -22,4 +22,13 @@
<ItemGroup>
<Protobuf Include="Protos\products.proto" ProtoRoot="Protos\" GrpcServices="Both" />
</ItemGroup>
<Target Name="PushToFoursatNuget" AfterTargets="Pack">
<PropertyGroup>
<NugetPackagePath>$(PackageOutputPath)$(PackageId).$(Version).nupkg</NugetPackagePath>
<PushCommand>dotnet nuget push **/*.nupkg --source https://git.afrino.co/api/packages/FourSat/nuget/index.json --api-key 061a5cb15517c6da39c16cfce8556c55ae104d0d --skip-duplicate &amp;&amp; del "$(NugetPackagePath)"</PushCommand>
</PropertyGroup>
<Exec Command="$(PushCommand)" />
</Target>
</Project>

View File

@@ -1,5 +1,5 @@
using FluentValidation;
using FrontOfficeMicroservice.Protobuf.Protos.Products;
using FrontOffice.BFF.Products.Protobuf.Protos.Products;
namespace FrontOfficeMicroservice.Protobuf.Validator.Products;
public class GetAllProductsByFilterFilterValidator : AbstractValidator<GetAllProductsByFilterFilter>

View File

@@ -1,5 +1,5 @@
using FluentValidation;
using FrontOfficeMicroservice.Protobuf.Protos.Products;
using FrontOffice.BFF.Products.Protobuf.Protos.Products;
namespace FrontOfficeMicroservice.Protobuf.Validator.Products;
public class GetAllProductsByFilterRequestValidator : AbstractValidator<GetAllProductsByFilterRequest>

View File

@@ -1,5 +1,5 @@
using FluentValidation;
using FrontOfficeMicroservice.Protobuf.Protos.Products;
using FrontOffice.BFF.Products.Protobuf.Protos.Products;
namespace FrontOfficeMicroservice.Protobuf.Validator.Products;
public class GetProductsRequestValidator : AbstractValidator<GetProductsRequest>