Moved all the namespace to globalusings
This commit is contained in:
parent
6546b63aa4
commit
0fe244cc80
@ -1,13 +1,8 @@
|
||||
using Autofac;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Ordering.SignalrHub.IntegrationEvents;
|
||||
using System.Reflection;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.AutofacModules;
|
||||
|
||||
namespace Ordering.SignalrHub.AutofacModules
|
||||
{
|
||||
public class ApplicationModule
|
||||
public class ApplicationModule
|
||||
: Autofac.Module
|
||||
{
|
||||
{
|
||||
|
||||
public string QueriesConnectionString { get; }
|
||||
|
||||
@ -22,5 +17,4 @@ namespace Ordering.SignalrHub.AutofacModules
|
||||
.AsClosedTypesOf(typeof(IIntegrationEventHandler<>));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,7 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog.Context;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents
|
||||
public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToAwaitingValidationIntegrationEvent>
|
||||
{
|
||||
public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToAwaitingValidationIntegrationEvent>
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
private readonly ILogger<OrderStatusChangedToAwaitingValidationIntegrationEventHandler> _logger;
|
||||
|
||||
@ -32,5 +25,4 @@ namespace Ordering.SignalrHub.IntegrationEvents
|
||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,7 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
using Serilog.Context;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
public class OrderStatusChangedToCancelledIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToCancelledIntegrationEvent>
|
||||
{
|
||||
public class OrderStatusChangedToCancelledIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToCancelledIntegrationEvent>
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
private readonly ILogger<OrderStatusChangedToCancelledIntegrationEventHandler> _logger;
|
||||
|
||||
@ -33,5 +25,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,15 +1,7 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
using Serilog.Context;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
public class OrderStatusChangedToPaidIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToPaidIntegrationEvent>
|
||||
{
|
||||
public class OrderStatusChangedToPaidIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToPaidIntegrationEvent>
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
private readonly ILogger<OrderStatusChangedToPaidIntegrationEventHandler> _logger;
|
||||
|
||||
@ -33,5 +25,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,7 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
using Serilog.Context;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
public class OrderStatusChangedToShippedIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToShippedIntegrationEvent>
|
||||
{
|
||||
public class OrderStatusChangedToShippedIntegrationEventHandler : IIntegrationEventHandler<OrderStatusChangedToShippedIntegrationEvent>
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
private readonly ILogger<OrderStatusChangedToShippedIntegrationEventHandler> _logger;
|
||||
|
||||
@ -33,5 +25,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,8 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
using Serilog.Context;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
{
|
||||
public class OrderStatusChangedToStockConfirmedIntegrationEventHandler :
|
||||
public class OrderStatusChangedToStockConfirmedIntegrationEventHandler :
|
||||
IIntegrationEventHandler<OrderStatusChangedToStockConfirmedIntegrationEvent>
|
||||
{
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
private readonly ILogger<OrderStatusChangedToStockConfirmedIntegrationEventHandler> _logger;
|
||||
|
||||
@ -34,5 +26,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,7 @@
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
using Serilog.Context;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
{
|
||||
public class OrderStatusChangedToSubmittedIntegrationEventHandler :
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
public class OrderStatusChangedToSubmittedIntegrationEventHandler :
|
||||
IIntegrationEventHandler<OrderStatusChangedToSubmittedIntegrationEvent>
|
||||
{
|
||||
{
|
||||
private readonly IHubContext<NotificationsHub> _hubContext;
|
||||
private readonly ILogger<OrderStatusChangedToSubmittedIntegrationEventHandler> _logger;
|
||||
|
||||
@ -34,5 +25,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.EventHandling
|
||||
.SendAsync("UpdatedOrderState", new { OrderId = @event.OrderId, Status = @event.OrderStatus });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,9 +1,6 @@
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents;
|
||||
public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public int OrderId { get; }
|
||||
public string OrderStatus { get; }
|
||||
public string BuyerName { get; }
|
||||
@ -14,5 +11,5 @@ namespace Ordering.SignalrHub.IntegrationEvents
|
||||
OrderStatus = orderStatus;
|
||||
BuyerName = buyerName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
public record OrderStatusChangedToCancelledIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public record OrderStatusChangedToCancelledIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public int OrderId { get; }
|
||||
public string OrderStatus { get; }
|
||||
public string BuyerName { get; }
|
||||
@ -14,5 +12,5 @@ namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
OrderStatus = orderStatus;
|
||||
BuyerName = buyerName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public int OrderId { get; }
|
||||
public string OrderStatus { get; }
|
||||
public string BuyerName { get; }
|
||||
@ -15,5 +13,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
OrderStatus = orderStatus;
|
||||
BuyerName = buyerName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
public record OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public record OrderStatusChangedToShippedIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public int OrderId { get; }
|
||||
public string OrderStatus { get; }
|
||||
public string BuyerName { get; }
|
||||
@ -14,5 +12,5 @@ namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
OrderStatus = orderStatus;
|
||||
BuyerName = buyerName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
public record OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public record OrderStatusChangedToStockConfirmedIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public int OrderId { get; }
|
||||
public string OrderStatus { get; }
|
||||
public string BuyerName { get; }
|
||||
@ -14,5 +12,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
OrderStatus = orderStatus;
|
||||
BuyerName = buyerName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,7 @@
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
|
||||
namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
public record OrderStatusChangedToSubmittedIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public record OrderStatusChangedToSubmittedIntegrationEvent : IntegrationEvent
|
||||
{
|
||||
public int OrderId { get; }
|
||||
public string OrderStatus { get; }
|
||||
public string BuyerName { get; }
|
||||
@ -14,5 +12,4 @@ namespace Ordering.SignalrHub.IntegrationEvents.Events
|
||||
OrderStatus = orderStatus;
|
||||
BuyerName = buyerName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,8 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub;
|
||||
|
||||
namespace Ordering.SignalrHub
|
||||
[Authorize]
|
||||
public class NotificationsHub : Hub
|
||||
{
|
||||
[Authorize]
|
||||
public class NotificationsHub : Hub
|
||||
{
|
||||
|
||||
public override async Task OnConnectedAsync()
|
||||
{
|
||||
@ -20,5 +15,4 @@ namespace Ordering.SignalrHub
|
||||
await Groups.RemoveFromGroupAsync(Context.ConnectionId, Context.User.Identity.Name);
|
||||
await base.OnDisconnectedAsync(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,4 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Serilog;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Ordering.SignalrHub;
|
||||
|
||||
var configuration = GetConfiguration();
|
||||
var configuration = GetConfiguration();
|
||||
|
||||
Log.Logger = CreateSerilogLogger(configuration);
|
||||
|
||||
|
@ -1,31 +1,7 @@
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using HealthChecks.UI.Client;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||
using Microsoft.Azure.ServiceBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Diagnostics.HealthChecks;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Ordering.SignalrHub.AutofacModules;
|
||||
using Ordering.SignalrHub.IntegrationEvents;
|
||||
using Ordering.SignalrHub.IntegrationEvents.EventHandling;
|
||||
using Ordering.SignalrHub.IntegrationEvents.Events;
|
||||
using RabbitMQ.Client;
|
||||
using System;
|
||||
using System.IdentityModel.Tokens.Jwt;
|
||||
using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopOnContainers.Services.Ordering.SignalrHub;
|
||||
|
||||
namespace Ordering.SignalrHub
|
||||
public class Startup
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
@ -240,10 +216,10 @@ namespace Ordering.SignalrHub
|
||||
|
||||
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class CustomExtensionMethods
|
||||
{
|
||||
public static class CustomExtensionMethods
|
||||
{
|
||||
public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var hcBuilder = services.AddHealthChecks();
|
||||
@ -270,5 +246,4 @@ namespace Ordering.SignalrHub
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user