update
This commit is contained in:
@@ -1,16 +1,28 @@
|
||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace FrontOffice.BFF.Application.UserOrderCQ.Commands.SubmitShopBuyOrder;
|
||||
public class SubmitShopBuyOrderCommandHandler : IRequestHandler<SubmitShopBuyOrderCommand, SubmitShopBuyOrderResponseDto>
|
||||
|
||||
public class
|
||||
SubmitShopBuyOrderCommandHandler : IRequestHandler<SubmitShopBuyOrderCommand, SubmitShopBuyOrderResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
private readonly ICurrentUserService _currentUserService;
|
||||
|
||||
public SubmitShopBuyOrderCommandHandler(IApplicationContractContext context)
|
||||
public SubmitShopBuyOrderCommandHandler(IApplicationContractContext context, ICurrentUserService currentUserService)
|
||||
{
|
||||
_context = context;
|
||||
_currentUserService = currentUserService;
|
||||
}
|
||||
|
||||
public async Task<SubmitShopBuyOrderResponseDto> Handle(SubmitShopBuyOrderCommand request, CancellationToken cancellationToken)
|
||||
public async Task<SubmitShopBuyOrderResponseDto> Handle(SubmitShopBuyOrderCommand request,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
//TODO: Implement your business logic
|
||||
return new SubmitShopBuyOrderResponseDto();
|
||||
var result = await _context.UserOrder.SubmitShopBuyOrderAsync(new SubmitShopBuyOrderRequest()
|
||||
{
|
||||
UserId = _currentUserService.UserId.Value,
|
||||
TotalAmount = request.TotalAmount
|
||||
}, cancellationToken: cancellationToken);
|
||||
return result.Adapt<SubmitShopBuyOrderResponseDto>();
|
||||
// return new SubmitShopBuyOrderResponseDto();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
|
||||
|
||||
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
|
||||
|
||||
namespace FrontOffice.BFF.Application.UserOrderCQ.Commands.SubmitShopBuyOrder;
|
||||
public class SubmitShopBuyOrderResponseDto
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user