Update
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
using CMSMicroservice.Protobuf.Protos.Package;
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
using FMSMicroservice.Protobuf.Protos.FileInfo;
|
||||
|
||||
namespace BackOffice.BFF.Application.Common.Interfaces;
|
||||
@@ -6,12 +11,15 @@ namespace BackOffice.BFF.Application.Common.Interfaces;
|
||||
public interface IApplicationContractContext
|
||||
{
|
||||
#region FM
|
||||
|
||||
FileInfoContract.FileInfoContractClient FileInfos { get; }
|
||||
|
||||
#endregion
|
||||
#region CMS
|
||||
PackageContract.PackageContractClient Packages { get; }
|
||||
RoleContract.RoleContractClient Roles { get; }
|
||||
UserAddressContract.UserAddressContractClient UserAddress { get; }
|
||||
UserContract.UserContractClient Users { get; }
|
||||
UserOrderContract.UserOrderContractClient UserOrders { get; }
|
||||
UserRoleContract.UserRoleContractClient UserRoles { get; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
|
||||
namespace BackOffice.BFF.Application.RoleCQ.Commands.CreateNewRole;
|
||||
public class CreateNewRoleCommandHandler : IRequestHandler<CreateNewRoleCommand, CreateNewRoleResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class CreateNewRoleCommandHandler : IRequestHandler<CreateNewRoleCommand,
|
||||
|
||||
public async Task<CreateNewRoleResponseDto> Handle(CreateNewRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewRoleResponseDto();
|
||||
var response = await _context.Roles.CreateNewRoleAsync(request.Adapt<CreateNewRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<CreateNewRoleResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
|
||||
namespace BackOffice.BFF.Application.RoleCQ.Commands.DeleteRole;
|
||||
public class DeleteRoleCommandHandler : IRequestHandler<DeleteRoleCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class DeleteRoleCommandHandler : IRequestHandler<DeleteRoleCommand, Unit>
|
||||
|
||||
public async Task<Unit> Handle(DeleteRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.Roles.DeleteRoleAsync(request.Adapt<DeleteRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
|
||||
namespace BackOffice.BFF.Application.RoleCQ.Commands.UpdateRole;
|
||||
public class UpdateRoleCommandHandler : IRequestHandler<UpdateRoleCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class UpdateRoleCommandHandler : IRequestHandler<UpdateRoleCommand, Unit>
|
||||
|
||||
public async Task<Unit> Handle(UpdateRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.Roles.UpdateRoleAsync(request.Adapt<UpdateRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.RoleCQ.Queries.GetAllRoleByFilter;
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
|
||||
namespace BackOffice.BFF.Application.RoleCQ.Queries.GetAllRoleByFilter;
|
||||
public class GetAllRoleByFilterQueryHandler : IRequestHandler<GetAllRoleByFilterQuery, GetAllRoleByFilterResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetAllRoleByFilterQueryHandler : IRequestHandler<GetAllRoleByFilter
|
||||
|
||||
public async Task<GetAllRoleByFilterResponseDto> Handle(GetAllRoleByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllRoleByFilterResponseDto();
|
||||
var response = await _context.Roles.GetAllRoleByFilterAsync(request.Adapt<GetAllRoleByFilterRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetAllRoleByFilterResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.RoleCQ.Queries.GetRole;
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
|
||||
namespace BackOffice.BFF.Application.RoleCQ.Queries.GetRole;
|
||||
public class GetRoleQueryHandler : IRequestHandler<GetRoleQuery, GetRoleResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetRoleQueryHandler : IRequestHandler<GetRoleQuery, GetRoleResponse
|
||||
|
||||
public async Task<GetRoleResponseDto> Handle(GetRoleQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetRoleResponseDto();
|
||||
var response = await _context.Roles.GetRoleAsync(request.Adapt<GetRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetRoleResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserAddressCQ.Commands.CreateNewUserAddress;
|
||||
public class CreateNewUserAddressCommandHandler : IRequestHandler<CreateNewUserAddressCommand, CreateNewUserAddressResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class CreateNewUserAddressCommandHandler : IRequestHandler<CreateNewUserA
|
||||
|
||||
public async Task<CreateNewUserAddressResponseDto> Handle(CreateNewUserAddressCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewUserAddressResponseDto();
|
||||
var response = await _context.UserAddress.CreateNewUserAddressAsync(request.Adapt<CreateNewUserAddressRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<CreateNewUserAddressResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserAddressCQ.Commands.DeleteUserAddress;
|
||||
public class DeleteUserAddressCommandHandler : IRequestHandler<DeleteUserAddressCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class DeleteUserAddressCommandHandler : IRequestHandler<DeleteUserAddress
|
||||
|
||||
public async Task<Unit> Handle(DeleteUserAddressCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.UserAddress.DeleteUserAddressAsync(request.Adapt<DeleteUserAddressRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserAddressCQ.Commands.UpdateUserAddress;
|
||||
public class UpdateUserAddressCommandHandler : IRequestHandler<UpdateUserAddressCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class UpdateUserAddressCommandHandler : IRequestHandler<UpdateUserAddress
|
||||
|
||||
public async Task<Unit> Handle(UpdateUserAddressCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.UserAddress.UpdateUserAddressAsync(request.Adapt<UpdateUserAddressRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserAddressCQ.Queries.GetAllUserAddressByFilter;
|
||||
public class GetAllUserAddressByFilterQueryHandler : IRequestHandler<GetAllUserAddressByFilterQuery, GetAllUserAddressByFilterResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetAllUserAddressByFilterQueryHandler : IRequestHandler<GetAllUserA
|
||||
|
||||
public async Task<GetAllUserAddressByFilterResponseDto> Handle(GetAllUserAddressByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllUserAddressByFilterResponseDto();
|
||||
var response = await _context.UserAddress.GetAllUserAddressByFilterAsync(request.Adapt<GetAllUserAddressByFilterRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetAllUserAddressByFilterResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserAddressCQ.Queries.GetUserAddress;
|
||||
public class GetUserAddressQueryHandler : IRequestHandler<GetUserAddressQuery, GetUserAddressResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetUserAddressQueryHandler : IRequestHandler<GetUserAddressQuery, G
|
||||
|
||||
public async Task<GetUserAddressResponseDto> Handle(GetUserAddressQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserAddressResponseDto();
|
||||
var response = await _context.UserAddress.GetUserAddressAsync(request.Adapt<GetUserAddressRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetUserAddressResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
|
||||
public class CreateNewUserCommandHandler : IRequestHandler<CreateNewUserCommand, CreateNewUserResponseDto>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class CreateNewUserCommandHandler : IRequestHandler<CreateNewUserCommand,
|
||||
|
||||
public async Task<CreateNewUserResponseDto> Handle(CreateNewUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewUserResponseDto();
|
||||
var response = await _context.Users.CreateNewUserAsync(request.Adapt<CreateNewUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<CreateNewUserResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Commands.DeleteUser;
|
||||
public class DeleteUserCommandHandler : IRequestHandler<DeleteUserCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class DeleteUserCommandHandler : IRequestHandler<DeleteUserCommand, Unit>
|
||||
|
||||
public async Task<Unit> Handle(DeleteUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.Users.DeleteUserAsync(request.Adapt<DeleteUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Commands.UpdateUser;
|
||||
public class UpdateUserCommandHandler : IRequestHandler<UpdateUserCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class UpdateUserCommandHandler : IRequestHandler<UpdateUserCommand, Unit>
|
||||
|
||||
public async Task<Unit> Handle(UpdateUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.Users.UpdateUserAsync(request.Adapt<UpdateUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilterQuery, GetAllUserByFilterResponseDto>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class GetAllUserByFilterQueryHandler : IRequestHandler<GetAllUserByFilter
|
||||
|
||||
public async Task<GetAllUserByFilterResponseDto> Handle(GetAllUserByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllUserByFilterResponseDto();
|
||||
var response = await _context.Users.GetAllUserByFilterAsync(request.Adapt<GetAllUserByFilterRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetAllUserByFilterResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponseDto>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class GetUserQueryHandler : IRequestHandler<GetUserQuery, GetUserResponse
|
||||
|
||||
public async Task<GetUserResponseDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserResponseDto();
|
||||
var response = await _context.Users.GetUserAsync(request.Adapt<GetUserRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetUserResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.CreateNewUserOrder;
|
||||
public class CreateNewUserOrderCommandHandler : IRequestHandler<CreateNewUserOrderCommand, CreateNewUserOrderResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class CreateNewUserOrderCommandHandler : IRequestHandler<CreateNewUserOrd
|
||||
|
||||
public async Task<CreateNewUserOrderResponseDto> Handle(CreateNewUserOrderCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewUserOrderResponseDto();
|
||||
var response = await _context.UserOrders.CreateNewUserOrderAsync(request.Adapt<CreateNewUserOrderRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<CreateNewUserOrderResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.DeleteUserOrder;
|
||||
public class DeleteUserOrderCommandHandler : IRequestHandler<DeleteUserOrderCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class DeleteUserOrderCommandHandler : IRequestHandler<DeleteUserOrderComm
|
||||
|
||||
public async Task<Unit> Handle(DeleteUserOrderCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.UserOrders.DeleteUserOrderAsync(request.Adapt<DeleteUserOrderRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.UpdateUserOrder;
|
||||
public class UpdateUserOrderCommandHandler : IRequestHandler<UpdateUserOrderCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class UpdateUserOrderCommandHandler : IRequestHandler<UpdateUserOrderComm
|
||||
|
||||
public async Task<Unit> Handle(UpdateUserOrderCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.UserOrders.UpdateUserOrderAsync(request.Adapt<UpdateUserOrderRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter;
|
||||
public class GetAllUserOrderByFilterQueryHandler : IRequestHandler<GetAllUserOrderByFilterQuery, GetAllUserOrderByFilterResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetAllUserOrderByFilterQueryHandler : IRequestHandler<GetAllUserOrd
|
||||
|
||||
public async Task<GetAllUserOrderByFilterResponseDto> Handle(GetAllUserOrderByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllUserOrderByFilterResponseDto();
|
||||
var response = await _context.UserOrders.GetAllUserOrderByFilterAsync(request.Adapt<GetAllUserOrderByFilterRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetAllUserOrderByFilterResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.GetUserOrder;
|
||||
public class GetUserOrderQueryHandler : IRequestHandler<GetUserOrderQuery, GetUserOrderResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetUserOrderQueryHandler : IRequestHandler<GetUserOrderQuery, GetUs
|
||||
|
||||
public async Task<GetUserOrderResponseDto> Handle(GetUserOrderQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserOrderResponseDto();
|
||||
var response = await _context.UserOrders.GetUserOrderAsync(request.Adapt<GetUserOrderRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetUserOrderResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserRoleCQ.Commands.CreateNewUserRole;
|
||||
public class CreateNewUserRoleCommandHandler : IRequestHandler<CreateNewUserRoleCommand, CreateNewUserRoleResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class CreateNewUserRoleCommandHandler : IRequestHandler<CreateNewUserRole
|
||||
|
||||
public async Task<CreateNewUserRoleResponseDto> Handle(CreateNewUserRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new CreateNewUserRoleResponseDto();
|
||||
var response = await _context.UserRoles.CreateNewUserRoleAsync(request.Adapt<CreateNewUserRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<CreateNewUserRoleResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserRoleCQ.Commands.DeleteUserRole;
|
||||
public class DeleteUserRoleCommandHandler : IRequestHandler<DeleteUserRoleCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,9 @@ public class DeleteUserRoleCommandHandler : IRequestHandler<DeleteUserRoleComman
|
||||
|
||||
public async Task<Unit> Handle(DeleteUserRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.UserRoles.DeleteUserRoleAsync(request.Adapt<DeleteUserRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserRoleCQ.Commands.UpdateUserRole;
|
||||
public class UpdateUserRoleCommandHandler : IRequestHandler<UpdateUserRoleCommand, Unit>
|
||||
{
|
||||
@@ -10,7 +12,8 @@ public class UpdateUserRoleCommandHandler : IRequestHandler<UpdateUserRoleComman
|
||||
|
||||
public async Task<Unit> Handle(UpdateUserRoleCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new Unit();
|
||||
await _context.UserRoles.UpdateUserRoleAsync(request.Adapt<UpdateUserRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return Unit.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserRoleCQ.Queries.GetAllUserRoleByFilter;
|
||||
public class GetAllUserRoleByFilterQueryHandler : IRequestHandler<GetAllUserRoleByFilterQuery, GetAllUserRoleByFilterResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetAllUserRoleByFilterQueryHandler : IRequestHandler<GetAllUserRole
|
||||
|
||||
public async Task<GetAllUserRoleByFilterResponseDto> Handle(GetAllUserRoleByFilterQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetAllUserRoleByFilterResponseDto();
|
||||
var response = await _context.UserRoles.GetAllUserRoleByFilterAsync(request.Adapt<GetAllUserRoleByFilterRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetAllUserRoleByFilterResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
|
||||
namespace BackOffice.BFF.Application.UserRoleCQ.Queries.GetUserRole;
|
||||
public class GetUserRoleQueryHandler : IRequestHandler<GetUserRoleQuery, GetUserRoleResponseDto>
|
||||
{
|
||||
@@ -10,7 +13,8 @@ public class GetUserRoleQueryHandler : IRequestHandler<GetUserRoleQuery, GetUser
|
||||
|
||||
public async Task<GetUserRoleResponseDto> Handle(GetUserRoleQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new GetUserRoleResponseDto();
|
||||
var response = await _context.UserRoles.GetUserRoleAsync(request.Adapt<GetUserRoleRequest>(), cancellationToken: cancellationToken);
|
||||
|
||||
return response.Adapt<GetUserRoleResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using CMSMicroservice.Protobuf.Protos.Package;
|
||||
using CMSMicroservice.Protobuf.Protos.Role;
|
||||
using CMSMicroservice.Protobuf.Protos.User;
|
||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.UserRole;
|
||||
using FMSMicroservice.Protobuf.Protos.FileInfo;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
@@ -30,13 +35,14 @@ public class ApplicationContractContext : IApplicationContractContext
|
||||
}
|
||||
|
||||
#region FM
|
||||
|
||||
//public FileLogContract.FileLogContractClient FileManagements => GetService<FileLogContract.FileLogContractClient>();
|
||||
|
||||
public FileInfoContract.FileInfoContractClient FileInfos => GetService<FileInfoContract.FileInfoContractClient>();
|
||||
#endregion
|
||||
#region CMS
|
||||
public PackageContract.PackageContractClient Packages => GetService<PackageContract.PackageContractClient>();
|
||||
public FileInfoContract.FileInfoContractClient FileInfos => GetService<FileInfoContract.FileInfoContractClient>();
|
||||
|
||||
public RoleContract.RoleContractClient Roles => GetService<RoleContract.RoleContractClient>();
|
||||
public UserAddressContract.UserAddressContractClient UserAddress => GetService<UserAddressContract.UserAddressContractClient>();
|
||||
public UserContract.UserContractClient Users => GetService<UserContract.UserContractClient>();
|
||||
public UserOrderContract.UserOrderContractClient UserOrders => GetService<UserOrderContract.UserOrderContractClient>();
|
||||
public UserRoleContract.UserRoleContractClient UserRoles => GetService<UserRoleContract.UserRoleContractClient>();
|
||||
#endregion
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
|
||||
Reference in New Issue
Block a user