From da4f03502a165f96d2e236996a3343d761c5a31a Mon Sep 17 00:00:00 2001 From: movingsam Date: Sun, 1 Mar 2026 17:47:48 +0800 Subject: [PATCH] refactor: reorganize project structure into yarpgateway folder - Move YarpGateway and all source files to src/yarpgateway/ - Keep Fengling.Gateway.Plugin.Abstractions at src/ level - Fix duplicate project reference in YarpGateway.slnx - Update solution paths and test project references - Add ProjectReference from YarpGateway to abstractions --- YarpGateway.slnx | 4 +--- .../Fengling.Gateway.Plugin.Abstractions.csproj | 2 +- src/{ => yarpgateway}/Config/ConfigNotifyChannel.cs | 0 .../Config/DatabaseClusterConfigProvider.cs | 0 .../Config/DatabaseRouteConfigProvider.cs | 0 src/{ => yarpgateway}/Config/JwtConfig.cs | 0 src/{ => yarpgateway}/Config/RedisConfig.cs | 0 .../Controllers/GatewayConfigController.cs | 0 .../Controllers/PendingServicesController.cs | 0 src/{ => yarpgateway}/Data/GatewayDbContext.cs | 0 src/{ => yarpgateway}/Data/GatewayDbContextFactory.cs | 0 src/{ => yarpgateway}/Directory.Build.props | 0 src/{ => yarpgateway}/Directory.Packages.props | 0 .../DynamicProxy/DynamicProxyConfigProvider.cs | 0 .../LoadBalancing/DistributedWeightedRoundRobinPolicy.cs | 0 src/{ => yarpgateway}/Metrics/GatewayMetrics.cs | 0 .../Middleware/JwtTransformMiddleware.cs | 0 .../Middleware/TenantRoutingMiddleware.cs | 0 .../Migrations/20260201120312_InitialCreate.Designer.cs | 0 .../Migrations/20260201120312_InitialCreate.cs | 0 .../20260201133826_AddIsGlobalToTenantRoute.Designer.cs | 0 .../Migrations/20260201133826_AddIsGlobalToTenantRoute.cs | 0 .../20260222134342_AddPendingServiceDiscovery.Designer.cs | 0 .../20260222134342_AddPendingServiceDiscovery.cs | 0 .../Migrations/GatewayDbContextModelSnapshot.cs | 0 .../Migrations/pending_service_migration.sql | 0 src/{ => yarpgateway}/Migrations/script.sql | 0 src/{ => yarpgateway}/Models/GwPendingServiceDiscovery.cs | 0 src/{ => yarpgateway}/Models/GwServiceInstance.cs | 0 src/{ => yarpgateway}/Models/GwTenant.cs | 0 src/{ => yarpgateway}/Models/GwTenantRoute.cs | 0 src/{ => yarpgateway}/NuGet.Config | 0 src/{ => yarpgateway}/Program.cs | 0 src/{ => yarpgateway}/Properties/launchSettings.json | 0 .../Services/KubernetesPendingSyncService.cs | 0 .../Services/PgSqlConfigChangeListener.cs | 0 src/{ => yarpgateway}/Services/RedisConnectionManager.cs | 0 src/{ => yarpgateway}/Services/RouteCache.cs | 0 src/{ => yarpgateway}/YarpGateway.csproj | 8 ++++++-- src/{ => yarpgateway}/appsettings.Development.json | 0 src/{ => yarpgateway}/appsettings.json | 0 tests/YarpGateway.Tests/YarpGateway.Tests.csproj | 2 +- 42 files changed, 9 insertions(+), 7 deletions(-) rename src/{ => yarpgateway}/Config/ConfigNotifyChannel.cs (100%) rename src/{ => yarpgateway}/Config/DatabaseClusterConfigProvider.cs (100%) rename src/{ => yarpgateway}/Config/DatabaseRouteConfigProvider.cs (100%) rename src/{ => yarpgateway}/Config/JwtConfig.cs (100%) rename src/{ => yarpgateway}/Config/RedisConfig.cs (100%) rename src/{ => yarpgateway}/Controllers/GatewayConfigController.cs (100%) rename src/{ => yarpgateway}/Controllers/PendingServicesController.cs (100%) rename src/{ => yarpgateway}/Data/GatewayDbContext.cs (100%) rename src/{ => yarpgateway}/Data/GatewayDbContextFactory.cs (100%) rename src/{ => yarpgateway}/Directory.Build.props (100%) rename src/{ => yarpgateway}/Directory.Packages.props (100%) rename src/{ => yarpgateway}/DynamicProxy/DynamicProxyConfigProvider.cs (100%) rename src/{ => yarpgateway}/LoadBalancing/DistributedWeightedRoundRobinPolicy.cs (100%) rename src/{ => yarpgateway}/Metrics/GatewayMetrics.cs (100%) rename src/{ => yarpgateway}/Middleware/JwtTransformMiddleware.cs (100%) rename src/{ => yarpgateway}/Middleware/TenantRoutingMiddleware.cs (100%) rename src/{ => yarpgateway}/Migrations/20260201120312_InitialCreate.Designer.cs (100%) rename src/{ => yarpgateway}/Migrations/20260201120312_InitialCreate.cs (100%) rename src/{ => yarpgateway}/Migrations/20260201133826_AddIsGlobalToTenantRoute.Designer.cs (100%) rename src/{ => yarpgateway}/Migrations/20260201133826_AddIsGlobalToTenantRoute.cs (100%) rename src/{ => yarpgateway}/Migrations/20260222134342_AddPendingServiceDiscovery.Designer.cs (100%) rename src/{ => yarpgateway}/Migrations/20260222134342_AddPendingServiceDiscovery.cs (100%) rename src/{ => yarpgateway}/Migrations/GatewayDbContextModelSnapshot.cs (100%) rename src/{ => yarpgateway}/Migrations/pending_service_migration.sql (100%) rename src/{ => yarpgateway}/Migrations/script.sql (100%) rename src/{ => yarpgateway}/Models/GwPendingServiceDiscovery.cs (100%) rename src/{ => yarpgateway}/Models/GwServiceInstance.cs (100%) rename src/{ => yarpgateway}/Models/GwTenant.cs (100%) rename src/{ => yarpgateway}/Models/GwTenantRoute.cs (100%) rename src/{ => yarpgateway}/NuGet.Config (100%) rename src/{ => yarpgateway}/Program.cs (100%) rename src/{ => yarpgateway}/Properties/launchSettings.json (100%) rename src/{ => yarpgateway}/Services/KubernetesPendingSyncService.cs (100%) rename src/{ => yarpgateway}/Services/PgSqlConfigChangeListener.cs (100%) rename src/{ => yarpgateway}/Services/RedisConnectionManager.cs (100%) rename src/{ => yarpgateway}/Services/RouteCache.cs (100%) rename src/{ => yarpgateway}/YarpGateway.csproj (87%) rename src/{ => yarpgateway}/appsettings.Development.json (100%) rename src/{ => yarpgateway}/appsettings.json (100%) diff --git a/YarpGateway.slnx b/YarpGateway.slnx index f391d42..7d77377 100644 --- a/YarpGateway.slnx +++ b/YarpGateway.slnx @@ -4,10 +4,8 @@ - + - - diff --git a/src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj b/src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj index 0717594..15eb6bd 100644 --- a/src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj +++ b/src/Fengling.Gateway.Plugin.Abstractions/Fengling.Gateway.Plugin.Abstractions.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Config/ConfigNotifyChannel.cs b/src/yarpgateway/Config/ConfigNotifyChannel.cs similarity index 100% rename from src/Config/ConfigNotifyChannel.cs rename to src/yarpgateway/Config/ConfigNotifyChannel.cs diff --git a/src/Config/DatabaseClusterConfigProvider.cs b/src/yarpgateway/Config/DatabaseClusterConfigProvider.cs similarity index 100% rename from src/Config/DatabaseClusterConfigProvider.cs rename to src/yarpgateway/Config/DatabaseClusterConfigProvider.cs diff --git a/src/Config/DatabaseRouteConfigProvider.cs b/src/yarpgateway/Config/DatabaseRouteConfigProvider.cs similarity index 100% rename from src/Config/DatabaseRouteConfigProvider.cs rename to src/yarpgateway/Config/DatabaseRouteConfigProvider.cs diff --git a/src/Config/JwtConfig.cs b/src/yarpgateway/Config/JwtConfig.cs similarity index 100% rename from src/Config/JwtConfig.cs rename to src/yarpgateway/Config/JwtConfig.cs diff --git a/src/Config/RedisConfig.cs b/src/yarpgateway/Config/RedisConfig.cs similarity index 100% rename from src/Config/RedisConfig.cs rename to src/yarpgateway/Config/RedisConfig.cs diff --git a/src/Controllers/GatewayConfigController.cs b/src/yarpgateway/Controllers/GatewayConfigController.cs similarity index 100% rename from src/Controllers/GatewayConfigController.cs rename to src/yarpgateway/Controllers/GatewayConfigController.cs diff --git a/src/Controllers/PendingServicesController.cs b/src/yarpgateway/Controllers/PendingServicesController.cs similarity index 100% rename from src/Controllers/PendingServicesController.cs rename to src/yarpgateway/Controllers/PendingServicesController.cs diff --git a/src/Data/GatewayDbContext.cs b/src/yarpgateway/Data/GatewayDbContext.cs similarity index 100% rename from src/Data/GatewayDbContext.cs rename to src/yarpgateway/Data/GatewayDbContext.cs diff --git a/src/Data/GatewayDbContextFactory.cs b/src/yarpgateway/Data/GatewayDbContextFactory.cs similarity index 100% rename from src/Data/GatewayDbContextFactory.cs rename to src/yarpgateway/Data/GatewayDbContextFactory.cs diff --git a/src/Directory.Build.props b/src/yarpgateway/Directory.Build.props similarity index 100% rename from src/Directory.Build.props rename to src/yarpgateway/Directory.Build.props diff --git a/src/Directory.Packages.props b/src/yarpgateway/Directory.Packages.props similarity index 100% rename from src/Directory.Packages.props rename to src/yarpgateway/Directory.Packages.props diff --git a/src/DynamicProxy/DynamicProxyConfigProvider.cs b/src/yarpgateway/DynamicProxy/DynamicProxyConfigProvider.cs similarity index 100% rename from src/DynamicProxy/DynamicProxyConfigProvider.cs rename to src/yarpgateway/DynamicProxy/DynamicProxyConfigProvider.cs diff --git a/src/LoadBalancing/DistributedWeightedRoundRobinPolicy.cs b/src/yarpgateway/LoadBalancing/DistributedWeightedRoundRobinPolicy.cs similarity index 100% rename from src/LoadBalancing/DistributedWeightedRoundRobinPolicy.cs rename to src/yarpgateway/LoadBalancing/DistributedWeightedRoundRobinPolicy.cs diff --git a/src/Metrics/GatewayMetrics.cs b/src/yarpgateway/Metrics/GatewayMetrics.cs similarity index 100% rename from src/Metrics/GatewayMetrics.cs rename to src/yarpgateway/Metrics/GatewayMetrics.cs diff --git a/src/Middleware/JwtTransformMiddleware.cs b/src/yarpgateway/Middleware/JwtTransformMiddleware.cs similarity index 100% rename from src/Middleware/JwtTransformMiddleware.cs rename to src/yarpgateway/Middleware/JwtTransformMiddleware.cs diff --git a/src/Middleware/TenantRoutingMiddleware.cs b/src/yarpgateway/Middleware/TenantRoutingMiddleware.cs similarity index 100% rename from src/Middleware/TenantRoutingMiddleware.cs rename to src/yarpgateway/Middleware/TenantRoutingMiddleware.cs diff --git a/src/Migrations/20260201120312_InitialCreate.Designer.cs b/src/yarpgateway/Migrations/20260201120312_InitialCreate.Designer.cs similarity index 100% rename from src/Migrations/20260201120312_InitialCreate.Designer.cs rename to src/yarpgateway/Migrations/20260201120312_InitialCreate.Designer.cs diff --git a/src/Migrations/20260201120312_InitialCreate.cs b/src/yarpgateway/Migrations/20260201120312_InitialCreate.cs similarity index 100% rename from src/Migrations/20260201120312_InitialCreate.cs rename to src/yarpgateway/Migrations/20260201120312_InitialCreate.cs diff --git a/src/Migrations/20260201133826_AddIsGlobalToTenantRoute.Designer.cs b/src/yarpgateway/Migrations/20260201133826_AddIsGlobalToTenantRoute.Designer.cs similarity index 100% rename from src/Migrations/20260201133826_AddIsGlobalToTenantRoute.Designer.cs rename to src/yarpgateway/Migrations/20260201133826_AddIsGlobalToTenantRoute.Designer.cs diff --git a/src/Migrations/20260201133826_AddIsGlobalToTenantRoute.cs b/src/yarpgateway/Migrations/20260201133826_AddIsGlobalToTenantRoute.cs similarity index 100% rename from src/Migrations/20260201133826_AddIsGlobalToTenantRoute.cs rename to src/yarpgateway/Migrations/20260201133826_AddIsGlobalToTenantRoute.cs diff --git a/src/Migrations/20260222134342_AddPendingServiceDiscovery.Designer.cs b/src/yarpgateway/Migrations/20260222134342_AddPendingServiceDiscovery.Designer.cs similarity index 100% rename from src/Migrations/20260222134342_AddPendingServiceDiscovery.Designer.cs rename to src/yarpgateway/Migrations/20260222134342_AddPendingServiceDiscovery.Designer.cs diff --git a/src/Migrations/20260222134342_AddPendingServiceDiscovery.cs b/src/yarpgateway/Migrations/20260222134342_AddPendingServiceDiscovery.cs similarity index 100% rename from src/Migrations/20260222134342_AddPendingServiceDiscovery.cs rename to src/yarpgateway/Migrations/20260222134342_AddPendingServiceDiscovery.cs diff --git a/src/Migrations/GatewayDbContextModelSnapshot.cs b/src/yarpgateway/Migrations/GatewayDbContextModelSnapshot.cs similarity index 100% rename from src/Migrations/GatewayDbContextModelSnapshot.cs rename to src/yarpgateway/Migrations/GatewayDbContextModelSnapshot.cs diff --git a/src/Migrations/pending_service_migration.sql b/src/yarpgateway/Migrations/pending_service_migration.sql similarity index 100% rename from src/Migrations/pending_service_migration.sql rename to src/yarpgateway/Migrations/pending_service_migration.sql diff --git a/src/Migrations/script.sql b/src/yarpgateway/Migrations/script.sql similarity index 100% rename from src/Migrations/script.sql rename to src/yarpgateway/Migrations/script.sql diff --git a/src/Models/GwPendingServiceDiscovery.cs b/src/yarpgateway/Models/GwPendingServiceDiscovery.cs similarity index 100% rename from src/Models/GwPendingServiceDiscovery.cs rename to src/yarpgateway/Models/GwPendingServiceDiscovery.cs diff --git a/src/Models/GwServiceInstance.cs b/src/yarpgateway/Models/GwServiceInstance.cs similarity index 100% rename from src/Models/GwServiceInstance.cs rename to src/yarpgateway/Models/GwServiceInstance.cs diff --git a/src/Models/GwTenant.cs b/src/yarpgateway/Models/GwTenant.cs similarity index 100% rename from src/Models/GwTenant.cs rename to src/yarpgateway/Models/GwTenant.cs diff --git a/src/Models/GwTenantRoute.cs b/src/yarpgateway/Models/GwTenantRoute.cs similarity index 100% rename from src/Models/GwTenantRoute.cs rename to src/yarpgateway/Models/GwTenantRoute.cs diff --git a/src/NuGet.Config b/src/yarpgateway/NuGet.Config similarity index 100% rename from src/NuGet.Config rename to src/yarpgateway/NuGet.Config diff --git a/src/Program.cs b/src/yarpgateway/Program.cs similarity index 100% rename from src/Program.cs rename to src/yarpgateway/Program.cs diff --git a/src/Properties/launchSettings.json b/src/yarpgateway/Properties/launchSettings.json similarity index 100% rename from src/Properties/launchSettings.json rename to src/yarpgateway/Properties/launchSettings.json diff --git a/src/Services/KubernetesPendingSyncService.cs b/src/yarpgateway/Services/KubernetesPendingSyncService.cs similarity index 100% rename from src/Services/KubernetesPendingSyncService.cs rename to src/yarpgateway/Services/KubernetesPendingSyncService.cs diff --git a/src/Services/PgSqlConfigChangeListener.cs b/src/yarpgateway/Services/PgSqlConfigChangeListener.cs similarity index 100% rename from src/Services/PgSqlConfigChangeListener.cs rename to src/yarpgateway/Services/PgSqlConfigChangeListener.cs diff --git a/src/Services/RedisConnectionManager.cs b/src/yarpgateway/Services/RedisConnectionManager.cs similarity index 100% rename from src/Services/RedisConnectionManager.cs rename to src/yarpgateway/Services/RedisConnectionManager.cs diff --git a/src/Services/RouteCache.cs b/src/yarpgateway/Services/RouteCache.cs similarity index 100% rename from src/Services/RouteCache.cs rename to src/yarpgateway/Services/RouteCache.cs diff --git a/src/YarpGateway.csproj b/src/yarpgateway/YarpGateway.csproj similarity index 87% rename from src/YarpGateway.csproj rename to src/yarpgateway/YarpGateway.csproj index 576fbc5..e398762 100644 --- a/src/YarpGateway.csproj +++ b/src/yarpgateway/YarpGateway.csproj @@ -21,11 +21,15 @@ - + - + + + + + diff --git a/src/appsettings.Development.json b/src/yarpgateway/appsettings.Development.json similarity index 100% rename from src/appsettings.Development.json rename to src/yarpgateway/appsettings.Development.json diff --git a/src/appsettings.json b/src/yarpgateway/appsettings.json similarity index 100% rename from src/appsettings.json rename to src/yarpgateway/appsettings.json diff --git a/tests/YarpGateway.Tests/YarpGateway.Tests.csproj b/tests/YarpGateway.Tests/YarpGateway.Tests.csproj index efc643c..8fee337 100644 --- a/tests/YarpGateway.Tests/YarpGateway.Tests.csproj +++ b/tests/YarpGateway.Tests/YarpGateway.Tests.csproj @@ -21,7 +21,7 @@ - +