Add category service and product category support

This commit is contained in:
masoodafar-web
2025-11-28 11:00:59 +03:30
parent f8ad0a6845
commit 518285531a
16 changed files with 345 additions and 5 deletions

View File

@@ -21,6 +21,7 @@
<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.Category.Protobuf\FrontOffice.BFF.Category.Protobuf.csproj" />
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.ShopingCart.Protobuf\FrontOffice.BFF.ShopingCart.Protobuf.csproj" />
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.Transaction.Protobuf\FrontOffice.BFF.Transaction.Protobuf.csproj" />
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.UserWallet.Protobuf\FrontOffice.BFF.UserWallet.Protobuf.csproj" />

View File

@@ -0,0 +1,20 @@
using FrontOffice.BFF.Application.CategoryCQ.Queries.GetAllCategories;
using FrontOffice.BFF.Category.Protobuf.Protos.Category;
using FrontOffice.BFF.WebApi.Common.Services;
namespace FrontOffice.BFF.WebApi.Services;
public class CategoriesService : CategoryContract.CategoryContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public CategoriesService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<GetCategoriesResponse> GetAllCategories(GetCategoriesRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetCategoriesRequest, GetAllCategoriesQuery, GetCategoriesResponse>(request, context);
}
}