Browse Source

Swamy/remove unused using and refactoring entity classes (#1371)

* Removed Unused Usings

* Code Refactoring for readbility. Added spaces and moved the classes to separate file
pull/1390/head
Viswanatha Swamy 4 years ago
committed by GitHub
parent
commit
736320b920
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 214 additions and 151 deletions
  1. +8
    -4
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Config/UrlsConfig.cs
  2. +0
    -4
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/HomeController.cs
  3. +7
    -6
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs
  4. +2
    -6
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/AddBasketItemRequest.cs
  5. +1
    -12
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs
  6. +21
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketDataItem.cs
  7. +17
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs
  8. +7
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderItemData.cs
  9. +16
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemData.cs
  10. +1
    -10
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs
  11. +1
    -6
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs
  12. +13
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequestItemData.cs
  13. +0
    -2
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Program.cs
  14. +1
    -3
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs
  15. +0
    -1
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs
  16. +4
    -5
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs
  17. +1
    -2
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs
  18. +12
    -4
      src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs
  19. +0
    -3
      src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs
  20. +0
    -4
      src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/HomeController.cs
  21. +0
    -3
      src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs
  22. +7
    -7
      src/ApiGateways/Web.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs
  23. +4
    -6
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/AddBasketItemRequest.cs
  24. +1
    -12
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs
  25. +21
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketDataItem.cs
  26. +2
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/CatalogItem.cs
  27. +17
    -2
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/OrderData.cs
  28. +8
    -6
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/OrderItemData.cs
  29. +16
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketItemData.cs
  30. +2
    -15
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs
  31. +2
    -10
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs
  32. +11
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketRequestItemData.cs
  33. +3
    -4
      src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs
  34. +3
    -5
      src/ApiGateways/Web.Bff.Shopping/aggregator/Services/CatalogService.cs
  35. +4
    -4
      src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs
  36. +1
    -4
      src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs
  37. +0
    -1
      src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs

+ 8
- 4
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Config/UrlsConfig.cs View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config
{ {
@ -10,12 +7,14 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config
public class CatalogOperations public class CatalogOperations
{ {
public static string GetItemById(int id) => $"/api/v1/catalog/items/{id}"; public static string GetItemById(int id) => $"/api/v1/catalog/items/{id}";
public static string GetItemsById(IEnumerable<int> ids) => $"/api/v1/catalog/items?ids={string.Join(',', ids)}"; public static string GetItemsById(IEnumerable<int> ids) => $"/api/v1/catalog/items?ids={string.Join(',', ids)}";
} }
public class BasketOperations public class BasketOperations
{ {
public static string GetItemById(string id) => $"/api/v1/basket/{id}"; public static string GetItemById(string id) => $"/api/v1/basket/{id}";
public static string UpdateBasket() => "/api/v1/basket"; public static string UpdateBasket() => "/api/v1/basket";
} }
@ -25,10 +24,15 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config
} }
public string Basket { get; set; } public string Basket { get; set; }
public string Catalog { get; set; } public string Catalog { get; set; }
public string Orders { get; set; } public string Orders { get; set; }
public string GrpcBasket { get; set; } public string GrpcBasket { get; set; }
public string GrpcCatalog { get; set; } public string GrpcCatalog { get; set; }
public string GrpcOrdering { get; set; } public string GrpcOrdering { get; set; }
} }
} }

+ 0
- 4
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Controllers/HomeController.cs View File

@ -1,8 +1,4 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Controllers namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Controllers
{ {


+ 7
- 6
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs View File

@ -1,10 +1,11 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Filters
using Microsoft.AspNetCore.Authorization;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Filters
{ {
using Microsoft.AspNetCore.Authorization;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
namespace Basket.API.Infrastructure.Filters namespace Basket.API.Infrastructure.Filters
{ {


+ 2
- 6
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/AddBasketItemRequest.cs View File

@ -1,13 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{ {
public class AddBasketItemRequest public class AddBasketItemRequest
{ {
public int CatalogItemId { get; set; } public int CatalogItemId { get; set; }
public string BasketId { get; set; } public string BasketId { get; set; }
public int Quantity { get; set; } public int Quantity { get; set; }


+ 1
- 12
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs View File

@ -2,6 +2,7 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{ {
public class BasketData public class BasketData
{ {
public string BuyerId { get; set; } public string BuyerId { get; set; }
@ -10,7 +11,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
public BasketData() public BasketData()
{ {
} }
public BasketData(string buyerId) public BasketData(string buyerId)
@ -19,15 +19,4 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
} }
} }
public class BasketDataItem
{
public string Id { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; }
public string PictureUrl { get; set; }
}
} }

+ 21
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketDataItem.cs View File

@ -0,0 +1,21 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{
public class BasketDataItem
{
public string Id { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; }
public string PictureUrl { get; set; }
}
}

+ 17
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs View File

@ -3,23 +3,39 @@ using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{ {
public class OrderData public class OrderData
{ {
public string OrderNumber { get; set; } public string OrderNumber { get; set; }
public DateTime Date { get; set; } public DateTime Date { get; set; }
public string Status { get; set; } public string Status { get; set; }
public decimal Total { get; set; } public decimal Total { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string City { get; set; } public string City { get; set; }
public string Street { get; set; } public string Street { get; set; }
public string State { get; set; } public string State { get; set; }
public string Country { get; set; } public string Country { get; set; }
public string ZipCode { get; set; } public string ZipCode { get; set; }
public string CardNumber { get; set; } public string CardNumber { get; set; }
public string CardHolderName { get; set; } public string CardHolderName { get; set; }
public bool IsDraft { get; set; } public bool IsDraft { get; set; }
public DateTime CardExpiration { get; set; } public DateTime CardExpiration { get; set; }
public string CardExpirationShort { get; set; } public string CardExpirationShort { get; set; }
public string CardSecurityNumber { get; set; } public string CardSecurityNumber { get; set; }
public int CardTypeId { get; set; } public int CardTypeId { get; set; }
@ -28,4 +44,5 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>(); public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>();
} }
} }

+ 7
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderItemData.cs View File

@ -1,12 +1,19 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{ {
public class OrderItemData public class OrderItemData
{ {
public int ProductId { get; set; } public int ProductId { get; set; }
public string ProductName { get; set; } public string ProductName { get; set; }
public decimal UnitPrice { get; set; } public decimal UnitPrice { get; set; }
public decimal Discount { get; set; } public decimal Discount { get; set; }
public int Units { get; set; } public int Units { get; set; }
public string PictureUrl { get; set; } public string PictureUrl { get; set; }
} }
} }

+ 16
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemData.cs View File

@ -0,0 +1,16 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{
public class UpdateBasketItemData
{
public string BasketItemId { get; set; }
public int NewQty { get; set; }
public UpdateBasketItemData()
{
NewQty = 0;
}
}
}

+ 1
- 10
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs View File

@ -2,6 +2,7 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{ {
public class UpdateBasketItemsRequest public class UpdateBasketItemsRequest
{ {
@ -15,14 +16,4 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
} }
} }
public class UpdateBasketItemData
{
public string BasketItemId { get; set; }
public int NewQty { get; set; }
public UpdateBasketItemData()
{
NewQty = 0;
}
}
} }

+ 1
- 6
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs View File

@ -2,6 +2,7 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{ {
public class UpdateBasketRequest public class UpdateBasketRequest
{ {
public string BuyerId { get; set; } public string BuyerId { get; set; }
@ -9,10 +10,4 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
public IEnumerable<UpdateBasketRequestItemData> Items { get; set; } public IEnumerable<UpdateBasketRequestItemData> Items { get; set; }
} }
public class UpdateBasketRequestItemData
{
public string Id { get; set; } // Basket id
public int ProductId { get; set; } // Catalog item id
public int Quantity { get; set; } // Quantity
}
} }

+ 13
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequestItemData.cs View File

@ -0,0 +1,13 @@
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
{
public class UpdateBasketRequestItemData
{
public string Id { get; set; } // Basket id
public int ProductId { get; set; } // Catalog item id
public int Quantity { get; set; } // Quantity
}
}

+ 0
- 2
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Program.cs View File

@ -1,10 +1,8 @@
using Microsoft.AspNetCore; using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Serilog; using Serilog;
using System.IO; using System.IO;
using System.Net;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
{ {


+ 1
- 3
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs View File

@ -1,14 +1,12 @@
using Grpc.Net.Client; using Grpc.Net.Client;
using GrpcBasket;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GrpcBasket;
using Grpc.Core;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
{ {


+ 0
- 1
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs View File

@ -1,5 +1,4 @@
using CatalogApi; using CatalogApi;
using Grpc.Net.Client;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;


+ 4
- 5
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs View File

@ -1,9 +1,8 @@
using System.Net.Http;
using System.Threading.Tasks;
using System;
using Grpc.Core;
using Serilog;
using Grpc.Core;
using Grpc.Net.Client; using Grpc.Net.Client;
using Serilog;
using System;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
{ {


+ 1
- 2
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs View File

@ -1,4 +1,4 @@
using Grpc.Net.Client;
using GrpcOrdering;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -6,7 +6,6 @@ using Microsoft.Extensions.Options;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GrpcOrdering;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
{ {


+ 12
- 4
src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs View File

@ -1,17 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config
{ {
public class UrlsConfig public class UrlsConfig
{ {
public class CatalogOperations public class CatalogOperations
{ {
// grpc call under REST must go trough port 80 // grpc call under REST must go trough port 80
public static string GetItemById(int id) => $"/api/v1/catalog/items/{id}"; public static string GetItemById(int id) => $"/api/v1/catalog/items/{id}";
public static string GetItemById(string ids) => $"/api/v1/catalog/items/ids/{string.Join(',', ids)}"; public static string GetItemById(string ids) => $"/api/v1/catalog/items/ids/{string.Join(',', ids)}";
// REST call standard must go through port 5000 // REST call standard must go through port 5000
public static string GetItemsById(IEnumerable<int> ids) => $":5000/api/v1/catalog/items?ids={string.Join(',', ids)}"; public static string GetItemsById(IEnumerable<int> ids) => $":5000/api/v1/catalog/items?ids={string.Join(',', ids)}";
} }
@ -19,6 +20,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config
public class BasketOperations public class BasketOperations
{ {
public static string GetItemById(string id) => $"/api/v1/basket/{id}"; public static string GetItemById(string id) => $"/api/v1/basket/{id}";
public static string UpdateBasket() => "/api/v1/basket"; public static string UpdateBasket() => "/api/v1/basket";
} }
@ -28,10 +30,16 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config
} }
public string Basket { get; set; } public string Basket { get; set; }
public string Catalog { get; set; } public string Catalog { get; set; }
public string Orders { get; set; } public string Orders { get; set; }
public string GrpcBasket { get; set; } public string GrpcBasket { get; set; }
public string GrpcCatalog { get; set; } public string GrpcCatalog { get; set; }
public string GrpcOrdering { get; set; } public string GrpcOrdering { get; set; }
} }
} }

+ 0
- 3
src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/BasketController.cs View File

@ -3,12 +3,9 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services;
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;
using Serilog;
using Newtonsoft.Json;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers
{ {


+ 0
- 4
src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/HomeController.cs View File

@ -1,8 +1,4 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers
{ {


+ 0
- 3
src/ApiGateways/Web.Bff.Shopping/aggregator/Controllers/OrderController.cs View File

@ -2,9 +2,6 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net; using System.Net;
using System.Threading.Tasks; using System.Threading.Tasks;


+ 7
- 7
src/ApiGateways/Web.Bff.Shopping/aggregator/Filters/AuthorizeCheckOperationFilter.cs View File

@ -1,11 +1,11 @@
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters
{
using Microsoft.AspNetCore.Authorization;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters
{
namespace Basket.API.Infrastructure.Filters namespace Basket.API.Infrastructure.Filters
{ {
public class AuthorizeCheckOperationFilter : IOperationFilter public class AuthorizeCheckOperationFilter : IOperationFilter


+ 4
- 6
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/AddBasketItemRequest.cs View File

@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class AddBasketItemRequest public class AddBasketItemRequest
{ {
public int CatalogItemId { get; set; } public int CatalogItemId { get; set; }
public string BasketId { get; set; } public string BasketId { get; set; }
public int Quantity { get; set; } public int Quantity { get; set; }
@ -17,4 +14,5 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
Quantity = 1; Quantity = 1;
} }
} }
} }

+ 1
- 12
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs View File

@ -2,6 +2,7 @@
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class BasketData public class BasketData
{ {
public string BuyerId { get; set; } public string BuyerId { get; set; }
@ -10,7 +11,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
public BasketData() public BasketData()
{ {
} }
public BasketData(string buyerId) public BasketData(string buyerId)
@ -19,15 +19,4 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
} }
} }
public class BasketDataItem
{
public string Id { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; }
public string PictureUrl { get; set; }
}
} }

+ 21
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketDataItem.cs View File

@ -0,0 +1,21 @@
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{
public class BasketDataItem
{
public string Id { get; set; }
public int ProductId { get; set; }
public string ProductName { get; set; }
public decimal UnitPrice { get; set; }
public decimal OldUnitPrice { get; set; }
public int Quantity { get; set; }
public string PictureUrl { get; set; }
}
}

+ 2
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/CatalogItem.cs View File

@ -1,5 +1,6 @@
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class CatalogItem public class CatalogItem
{ {
public int Id { get; set; } public int Id { get; set; }
@ -10,4 +11,5 @@
public string PictureUri { get; set; } public string PictureUri { get; set; }
} }
} }

+ 17
- 2
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/OrderData.cs View File

@ -1,27 +1,41 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class OrderData public class OrderData
{ {
public string OrderNumber { get; set; } public string OrderNumber { get; set; }
public DateTime Date { get; set; } public DateTime Date { get; set; }
public string Status { get; set; } public string Status { get; set; }
public decimal Total { get; set; } public decimal Total { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string City { get; set; } public string City { get; set; }
public string Street { get; set; } public string Street { get; set; }
public string State { get; set; } public string State { get; set; }
public string Country { get; set; } public string Country { get; set; }
public string ZipCode { get; set; } public string ZipCode { get; set; }
public string CardNumber { get; set; } public string CardNumber { get; set; }
public string CardHolderName { get; set; } public string CardHolderName { get; set; }
public bool IsDraft { get; set; } public bool IsDraft { get; set; }
public DateTime CardExpiration { get; set; } public DateTime CardExpiration { get; set; }
public string CardExpirationShort { get; set; } public string CardExpirationShort { get; set; }
public string CardSecurityNumber { get; set; } public string CardSecurityNumber { get; set; }
public int CardTypeId { get; set; } public int CardTypeId { get; set; }
@ -30,4 +44,5 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>(); public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>();
} }
} }

+ 8
- 6
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/OrderItemData.cs View File

@ -1,17 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class OrderItemData public class OrderItemData
{ {
public int ProductId { get; set; } public int ProductId { get; set; }
public string ProductName { get; set; } public string ProductName { get; set; }
public decimal UnitPrice { get; set; } public decimal UnitPrice { get; set; }
public decimal Discount { get; set; } public decimal Discount { get; set; }
public int Units { get; set; } public int Units { get; set; }
public string PictureUrl { get; set; } public string PictureUrl { get; set; }
} }
} }

+ 16
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketItemData.cs View File

@ -0,0 +1,16 @@
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{
public class UpdateBasketItemData
{
public string BasketItemId { get; set; }
public int NewQty { get; set; }
public UpdateBasketItemData()
{
NewQty = 0;
}
}
}

+ 2
- 15
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs View File

@ -1,13 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class UpdateBasketItemsRequest public class UpdateBasketItemsRequest
{ {
public string BasketId { get; set; } public string BasketId { get; set; }
public ICollection<UpdateBasketItemData> Updates { get; set; } public ICollection<UpdateBasketItemData> Updates { get; set; }
@ -18,14 +15,4 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
} }
} }
public class UpdateBasketItemData
{
public string BasketItemId { get; set; }
public int NewQty { get; set; }
public UpdateBasketItemData()
{
NewQty = 0;
}
}
} }

+ 2
- 10
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs View File

@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{ {
public class UpdateBasketRequest public class UpdateBasketRequest
{ {
public string BuyerId { get; set; } public string BuyerId { get; set; }
@ -12,10 +10,4 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
public IEnumerable<UpdateBasketRequestItemData> Items { get; set; } public IEnumerable<UpdateBasketRequestItemData> Items { get; set; }
} }
public class UpdateBasketRequestItemData
{
public string Id { get; set; } // Basket id
public int ProductId { get; set; } // Catalog item id
public int Quantity { get; set; } // Quantity
}
} }

+ 11
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Models/UpdateBasketRequestItemData.cs View File

@ -0,0 +1,11 @@
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
{
public class UpdateBasketRequestItemData
{
public string Id { get; set; } // Basket id
public int ProductId { get; set; } // Catalog item id
public int Quantity { get; set; } // Quantity
}
}

+ 3
- 4
src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs View File

@ -1,12 +1,11 @@
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
using GrpcBasket;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Grpc.Net.Client;
using System.Linq; using System.Linq;
using GrpcBasket;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
{ {


+ 3
- 5
src/ApiGateways/Web.Bff.Shopping/aggregator/Services/CatalogService.cs View File

@ -1,15 +1,13 @@
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
using CatalogApi;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using CatalogApi;
using Grpc.Net.Client;
using System;
using static CatalogApi.Catalog; using static CatalogApi.Catalog;
using System.Linq;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
{ {


+ 4
- 4
src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs View File

@ -1,8 +1,8 @@
using System.Threading.Tasks;
using System;
using Grpc.Core;
using Serilog;
using Grpc.Core;
using Grpc.Net.Client; using Grpc.Net.Client;
using Serilog;
using System;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
{ {


+ 1
- 4
src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs View File

@ -1,14 +1,11 @@
using Grpc.Net.Client;
using GrpcOrdering;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System;
using System.Linq; using System.Linq;
using System.Net.Http; using System.Net.Http;
using System.Threading.Tasks; using System.Threading.Tasks;
using GrpcOrdering;
using Grpc.Core;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
{ {


+ 0
- 1
src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs View File

@ -5,7 +5,6 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters.Basket.API.Infrastructure.Filters; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters.Basket.API.Infrastructure.Filters;
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure;


Loading…
Cancel
Save