Generator Changes at 11/17/2025 11:53:47 PM +03:30
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user