Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Removed unused using, Reorganized using, moved the class to separate …
Browse files Browse the repository at this point in the history
…file, removed commented code in Catalog.API
  • Loading branch information
vishipayyallore committed Dec 1, 2020
1 parent b8431fa commit 34241c4
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.eShopOnContainers.Services.Basket.API;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;

namespace Basket.FunctionalTests.Base
{
Expand Down
7 changes: 5 additions & 2 deletions src/Services/Catalog/Catalog.API/CatalogSettings.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
namespace Microsoft.eShopOnContainers.Services.Catalog.API
{

public class CatalogSettings
{
public string PicBaseUrl { get;set;}
public string PicBaseUrl { get; set; }

public string EventBusConnection { get; set; }

public bool UseCustomizationData { get; set; }
public bool AzureStorageEnabled { get; set; }

public bool AzureStorageEnabled { get; set; }
}

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model
namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model
{
public static class CatalogItemExtensions
{
Expand Down
7 changes: 2 additions & 5 deletions src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using System;
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Polly;
using System;
using System.Data.SqlClient;

namespace Catalog.API.Extensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Polly;
using System;
using System.Data.SqlClient;
using Microsoft.AspNetCore.Hosting;

namespace Catalog.API.Extensions
{
Expand Down
11 changes: 5 additions & 6 deletions src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CatalogApi;
using CatalogApi;
using Grpc.Core;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Catalog.API;
using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
using Microsoft.eShopOnContainers.Services.Catalog.API.Model;
using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using static CatalogApi.Catalog;

namespace Catalog.API.Grpc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure
{
using Microsoft.EntityFrameworkCore;
using EntityConfigurations;
using Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Model;

public class CatalogContext : DbContext
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services;
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities;
using Microsoft.eShopOnContainers.Services.Catalog.API;
using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
using Microsoft.Extensions.Logging;
using Serilog.Context;
using System;
using System.Data.Common;
using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling
{
using BuildingBlocks.EventBus.Abstractions;
using System.Threading.Tasks;
using BuildingBlocks.EventBus.Events;
using Infrastructure;
using System.Collections.Generic;
using System.Linq;
using global::Catalog.API.IntegrationEvents;
using Infrastructure;
using IntegrationEvents.Events;
using Serilog.Context;
using Microsoft.Extensions.Logging;
using Serilog.Context;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler :
IIntegrationEventHandler<OrderStatusChangedToAwaitingValidationIntegrationEvent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling
{
using BuildingBlocks.EventBus.Abstractions;
using System.Threading.Tasks;
using Infrastructure;
using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events;
using Microsoft.Extensions.Logging;
using Serilog.Context;
using System.Threading.Tasks;

public class OrderStatusChangedToPaidIntegrationEventHandler :
IIntegrationEventHandler<OrderStatusChangedToPaidIntegrationEvent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,4 @@ public OrderStatusChangedToAwaitingValidationIntegrationEvent(int orderId,
}
}

public class OrderStockItem
{
public int ProductId { get; }
public int Units { get; }

public OrderStockItem(int productId, int units)
{
ProductId = productId;
Units = units;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events
{
public class OrderStockItem
{
public int ProductId { get; }
public int Units { get; }

public OrderStockItem(int productId, int units)
{
ProductId = productId;
Units = units;
}
}
}
5 changes: 1 addition & 4 deletions src/Services/Catalog/Catalog.API/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Autofac.Extensions.DependencyInjection;
using Catalog.API.Extensions;
using Catalog.API.Extensions;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
Expand All @@ -12,9 +11,7 @@
using Microsoft.Extensions.Options;
using Serilog;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;

namespace Microsoft.eShopOnContainers.Services.Catalog.API
Expand Down
53 changes: 31 additions & 22 deletions src/Services/Catalog/Catalog.API/Proto/catalog.proto
Original file line number Diff line number Diff line change
@@ -1,60 +1,69 @@
syntax = "proto3";

/* >>
import "google/api/annotations.proto";
<< */


package CatalogApi;

message CatalogItemRequest {
int32 id = 1;
}

message CatalogItemsRequest {
string ids = 1;

int32 pageSize = 2;

int32 pageIndex = 3;
}

message CatalogItemResponse {
int32 id = 1;

string name = 2;
string description=3;
double price=4;
string picture_file_name=5;
string picture_uri=6;
CatalogType catalog_type=8;
CatalogBrand catalog_brand=10;
int32 available_stock=11;
int32 restock_threshold=12;
int32 max_stock_threshold=13;
bool on_reorder=14;

string description=3;

double price=4;

string picture_file_name=5;

string picture_uri=6;

CatalogType catalog_type=8;

CatalogBrand catalog_brand=10;

int32 available_stock=11;

int32 restock_threshold=12;

int32 max_stock_threshold=13;

bool on_reorder=14;
}

message CatalogBrand {
int32 id = 1;

string name = 2;
}

message CatalogType {
int32 id = 1;

string type = 2;
}

message PaginatedItemsResponse {
int32 pageIndex = 1;

int32 pageSize = 2;

int64 count = 3;

repeated CatalogItemResponse data = 4;
}

service Catalog {
rpc GetItemById (CatalogItemRequest) returns (CatalogItemResponse) {
/* >>
option (google.api.http) = {
get: "/api/v1/catalog/items/{id}"
};
<< */
}
rpc GetItemById (CatalogItemRequest) returns (CatalogItemResponse) {}

rpc GetItemsByIds (CatalogItemsRequest) returns (PaginatedItemsResponse) {}
}
1 change: 0 additions & 1 deletion src/Services/Catalog/Catalog.API/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.ServiceBus;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
Expand Down

0 comments on commit 34241c4

Please sign in to comment.