Backup and Clean Push Service and implement new Structure of Push Service ...

This commit is contained in:
2025-11-14 16:40:45 +03:30
parent cfcb2d12b4
commit 3bd4b8d562
40 changed files with 333 additions and 2560 deletions
+3 -40
View File
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Builder;
@@ -15,9 +14,7 @@ using xExceptions.Constants;
using xPushService.Configurations;
using xPushService.Constants;
using xPushService.Helpers;
using xPushService.Interfaces;
using xPushService.Providers;
using xPushService.Store;
namespace xPushService.DI
{
@@ -70,6 +67,7 @@ namespace xPushService.DI
ServiceLifetime lifeTime = ServiceLifetime.Singleton
)
{
//
AddPushService(
services,
config.GetXPushServiceConfiguration(),
@@ -88,6 +86,7 @@ namespace xPushService.DI
ServiceLifetime lifeTime = ServiceLifetime.Singleton
)
{
//
AddPushService(
services,
config,
@@ -159,7 +158,7 @@ namespace xPushService.DI
helper.GetHubs().ForEach(hubDescriptor =>
{
//
var hubRoute = config.BaseRoute + "/" + hubDescriptor.Route; // Path.Combine (config.BaseRoute, hubDescriptor.Route);
var hubRoute = config.BaseRoute + "/" + hubDescriptor.Route;
hubRoutes.Add(hubRoute);
Console.WriteLine($"XPushService HubRoute: {hubRoute}");
@@ -253,42 +252,6 @@ namespace xPushService.DI
// Register XPushService Configuration ...
services.AddSingleton<XPushServiceConfiguration>(config);
//
#region Try to Register Stores ...
//
var groupStore = services.GetRegisteredService<IXPushGroupStore>();
if (groupStore.IsNull())
{
//
Log($"there is no provided PushGroupStore, try to register XPushGroupInMemoryStore ...");
var storeEvents = services.GetRegisteredService<IXPushGroupStoreEvents>();
groupStore = new XPushGroupInMemoryStore(storeEvents);
services.AddSingleton<IXPushGroupStore>(groupStore);
}
//
var connectionStore = services.GetRegisteredService<IXPushConnectionStore>();
if (connectionStore.IsNull())
{
//
Log($"there is no provided XPushConnectionStore, try to register XPushConnectionInMemoryStore ...");
var storeEvents = services.GetRegisteredService<IXPushConnectionStoreEvents>();
connectionStore = new XPushConnectionInMemoryStore(storeEvents);
services.AddSingleton<IXPushConnectionStore>(connectionStore);
}
//
var webRtcConnectionStore = services.GetRegisteredService<IXWebRTCConnectionStore>();
if (webRtcConnectionStore.IsNull())
{
//
Log($"there is no provided XWebRTCConnectionStore, try to register XWebRTCConnectionInMemoryStore ...");
var storeEvents = services.GetRegisteredService<IXWebRTCConnectionStoreEvents>();
webRtcConnectionStore = new XWebRTCConnectionInMemoryStore(storeEvents);
services.AddSingleton<IXWebRTCConnectionStore>(webRtcConnectionStore);
}
#endregion
//
// Register SignalR ...
var builder = services.AddSignalR();