Add validators and services for Product Galleries and Product Tags

- Implemented Create, Delete, Get, and Update validators for Product Galleries.
- Added Create, Delete, Get, and Update validators for Product Tags.
- Created service classes for handling Discount Categories, Discount Orders, Discount Products, Discount Shopping Cart, Product Categories, Product Galleries, and Product Tags.
- Each service class integrates with CQRS for command and query handling.
- Established mapping profiles for Product Galleries.
This commit is contained in:
masoodafar-web
2025-12-04 02:40:49 +03:30
parent 40d54d08fc
commit f0f48118e7
436 changed files with 33159 additions and 2005 deletions
@@ -0,0 +1,37 @@
using CMSMicroservice.Protobuf.Protos.ProductGalleries;
using CMSMicroservice.WebApi.Common.Services;
using CMSMicroservice.Application.ProductGalleriesCQ.Commands.CreateNewProductGalleries;
using CMSMicroservice.Application.ProductGalleriesCQ.Commands.UpdateProductGalleries;
using CMSMicroservice.Application.ProductGalleriesCQ.Commands.DeleteProductGalleries;
using CMSMicroservice.Application.ProductGalleriesCQ.Queries.GetProductGalleries;
using CMSMicroservice.Application.ProductGalleriesCQ.Queries.GetAllProductGalleriesByFilter;
namespace CMSMicroservice.WebApi.Services;
public class ProductGalleriesService : ProductGalleriesContract.ProductGalleriesContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public ProductGalleriesService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<CreateNewProductGalleriesResponse> CreateNewProductGalleries(CreateNewProductGalleriesRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<CreateNewProductGalleriesRequest, CreateNewProductGalleriesCommand, CreateNewProductGalleriesResponse>(request, context);
}
public override async Task<Empty> UpdateProductGalleries(UpdateProductGalleriesRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<UpdateProductGalleriesRequest, UpdateProductGalleriesCommand>(request, context);
}
public override async Task<Empty> DeleteProductGalleries(DeleteProductGalleriesRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<DeleteProductGalleriesRequest, DeleteProductGalleriesCommand>(request, context);
}
public override async Task<GetProductGalleriesResponse> GetProductGalleries(GetProductGalleriesRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetProductGalleriesRequest, GetProductGalleriesQuery, GetProductGalleriesResponse>(request, context);
}
public override async Task<GetAllProductGalleriesByFilterResponse> GetAllProductGalleriesByFilter(GetAllProductGalleriesByFilterRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetAllProductGalleriesByFilterRequest, GetAllProductGalleriesByFilterQuery, GetAllProductGalleriesByFilterResponse>(request, context);
}
}