Generator Changes at 11/17/2025 11:53:47 PM +03:30

This commit is contained in:
masoodafar-web
2025-11-17 23:57:51 +03:30
parent da07a3da38
commit dba8aecc97
50 changed files with 978 additions and 19 deletions

View File

@@ -0,0 +1,10 @@
namespace CMSMicroservice.WebApi.Common.Mappings;
public class CategoryProfile : IRegister
{
void IRegister.Register(TypeAdapterConfig config)
{
//config.NewConfig<Source,Destination>()
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
}
}

View File

@@ -0,0 +1,10 @@
namespace CMSMicroservice.WebApi.Common.Mappings;
public class PruductCategoryProfile : IRegister
{
void IRegister.Register(TypeAdapterConfig config)
{
//config.NewConfig<Source,Destination>()
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
}
}

View File

@@ -0,0 +1,37 @@
using CMSMicroservice.Protobuf.Protos.Category;
using CMSMicroservice.WebApi.Common.Services;
using CMSMicroservice.Application.CategoryCQ.Commands.CreateNewCategory;
using CMSMicroservice.Application.CategoryCQ.Commands.UpdateCategory;
using CMSMicroservice.Application.CategoryCQ.Commands.DeleteCategory;
using CMSMicroservice.Application.CategoryCQ.Queries.GetCategory;
using CMSMicroservice.Application.CategoryCQ.Queries.GetAllCategoryByFilter;
namespace CMSMicroservice.WebApi.Services;
public class CategoryService : CategoryContract.CategoryContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public CategoryService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<CreateNewCategoryResponse> CreateNewCategory(CreateNewCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<CreateNewCategoryRequest, CreateNewCategoryCommand, CreateNewCategoryResponse>(request, context);
}
public override async Task<Empty> UpdateCategory(UpdateCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<UpdateCategoryRequest, UpdateCategoryCommand>(request, context);
}
public override async Task<Empty> DeleteCategory(DeleteCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<DeleteCategoryRequest, DeleteCategoryCommand>(request, context);
}
public override async Task<GetCategoryResponse> GetCategory(GetCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetCategoryRequest, GetCategoryQuery, GetCategoryResponse>(request, context);
}
public override async Task<GetAllCategoryByFilterResponse> GetAllCategoryByFilter(GetAllCategoryByFilterRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetAllCategoryByFilterRequest, GetAllCategoryByFilterQuery, GetAllCategoryByFilterResponse>(request, context);
}
}

View File

@@ -0,0 +1,37 @@
using CMSMicroservice.Protobuf.Protos.PruductCategory;
using CMSMicroservice.WebApi.Common.Services;
using CMSMicroservice.Application.PruductCategoryCQ.Commands.CreateNewPruductCategory;
using CMSMicroservice.Application.PruductCategoryCQ.Commands.UpdatePruductCategory;
using CMSMicroservice.Application.PruductCategoryCQ.Commands.DeletePruductCategory;
using CMSMicroservice.Application.PruductCategoryCQ.Queries.GetPruductCategory;
using CMSMicroservice.Application.PruductCategoryCQ.Queries.GetAllPruductCategoryByFilter;
namespace CMSMicroservice.WebApi.Services;
public class PruductCategoryService : PruductCategoryContract.PruductCategoryContractBase
{
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
public PruductCategoryService(IDispatchRequestToCQRS dispatchRequestToCQRS)
{
_dispatchRequestToCQRS = dispatchRequestToCQRS;
}
public override async Task<CreateNewPruductCategoryResponse> CreateNewPruductCategory(CreateNewPruductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<CreateNewPruductCategoryRequest, CreateNewPruductCategoryCommand, CreateNewPruductCategoryResponse>(request, context);
}
public override async Task<Empty> UpdatePruductCategory(UpdatePruductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<UpdatePruductCategoryRequest, UpdatePruductCategoryCommand>(request, context);
}
public override async Task<Empty> DeletePruductCategory(DeletePruductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<DeletePruductCategoryRequest, DeletePruductCategoryCommand>(request, context);
}
public override async Task<GetPruductCategoryResponse> GetPruductCategory(GetPruductCategoryRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetPruductCategoryRequest, GetPruductCategoryQuery, GetPruductCategoryResponse>(request, context);
}
public override async Task<GetAllPruductCategoryByFilterResponse> GetAllPruductCategoryByFilter(GetAllPruductCategoryByFilterRequest request, ServerCallContext context)
{
return await _dispatchRequestToCQRS.Handle<GetAllPruductCategoryByFilterRequest, GetAllPruductCategoryByFilterQuery, GetAllPruductCategoryByFilterResponse>(request, context);
}
}