web bff endpoint /api/v1/Basket working in grpc
This commit is contained in:
parent
3fee58e666
commit
260bfcbc45
@ -96,18 +96,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//_httpClient.BaseAddress = new Uri(_urls.Basket + UrlsConfig.BasketOperations.UpdateBasket());
|
|
||||||
|
|
||||||
//var client = GrpcClient.Create<Basket.BasketClient>(_httpClient);
|
|
||||||
//_logger.LogInformation("Grpc update basket currentBasket {@currentBasket}", currentBasket);
|
|
||||||
//var request = MapToCustomerBasketRequest(currentBasket);
|
|
||||||
//_logger.LogInformation("Grpc update basket request {@request}", request);
|
|
||||||
|
|
||||||
//await client.UpdateBasketAsync(request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private BasketData MapToBasketData(CustomerBasketResponse customerBasketRequest)
|
private BasketData MapToBasketData(CustomerBasketResponse customerBasketRequest)
|
||||||
@ -122,16 +110,22 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
|
|||||||
BuyerId = customerBasketRequest.Buyerid
|
BuyerId = customerBasketRequest.Buyerid
|
||||||
};
|
};
|
||||||
|
|
||||||
customerBasketRequest.Items.ToList().ForEach(item => map.Items.Add(new BasketDataItem
|
customerBasketRequest.Items.ToList().ForEach(item =>
|
||||||
{
|
{
|
||||||
Id = item.Id,
|
if (item.Id != null)
|
||||||
OldUnitPrice = (decimal)item.Oldunitprice,
|
{
|
||||||
PictureUrl = item.Pictureurl,
|
map.Items.Add(new BasketDataItem
|
||||||
ProductId = item.Productid,
|
{
|
||||||
ProductName = item.Productname,
|
Id = item.Id,
|
||||||
Quantity = item.Quantity,
|
OldUnitPrice = (decimal)item.Oldunitprice,
|
||||||
UnitPrice = (decimal)item.Unitprice
|
PictureUrl = item.Pictureurl,
|
||||||
}));
|
ProductId = item.Productid,
|
||||||
|
ProductName = item.Productname,
|
||||||
|
Quantity = item.Quantity,
|
||||||
|
UnitPrice = (decimal)item.Unitprice
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
@ -148,16 +142,22 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
|
|||||||
Buyerid = basketData.BuyerId
|
Buyerid = basketData.BuyerId
|
||||||
};
|
};
|
||||||
|
|
||||||
basketData.Items.ToList().ForEach(item => map.Items.Add(new BasketItemResponse
|
basketData.Items.ToList().ForEach(item =>
|
||||||
{
|
{
|
||||||
Id = item.Id,
|
if (item.Id != null)
|
||||||
Oldunitprice = (double)item.OldUnitPrice,
|
{
|
||||||
Pictureurl = item.PictureUrl,
|
map.Items.Add(new BasketItemResponse
|
||||||
Productid = item.ProductId,
|
{
|
||||||
Productname = item.ProductName,
|
Id = item.Id,
|
||||||
Quantity = item.Quantity,
|
Oldunitprice = (double)item.OldUnitPrice,
|
||||||
Unitprice = (double)item.UnitPrice
|
Pictureurl = item.PictureUrl,
|
||||||
}));
|
Productid = item.ProductId,
|
||||||
|
Productname = item.ProductName,
|
||||||
|
Quantity = item.Quantity,
|
||||||
|
Unitprice = (double)item.UnitPrice
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user