Browse Source
Merge pull request #1254 from colinin/agile-config
feat(configuration): Enhance the agileconfig configuration enabled
pull/1267/head
yx lin
9 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
14 changed files with
29 additions and
58 deletions
-
aspnet-core/services/LY.MicroService.Applications.Single/Program.cs
-
aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.AuthServer/Program.cs
-
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.IdentityServer/Program.cs
-
aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.WechatManagement.HttpApi.Host/Program.cs
-
aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs
-
aspnet-core/templates/micro/content/host/PackageName.CompanyName.ProjectName.HttpApi.Host/Program.cs
|
|
|
@ -33,10 +33,9 @@ builder.Host.AddAppSettingsSecretsJson() |
|
|
|
config.AddJsonFile($"appsettings.{dbProvider}.json", optional: true); |
|
|
|
} |
|
|
|
|
|
|
|
var configuration = config.Build(); |
|
|
|
if (configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,12 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
|
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -28,11 +28,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -25,11 +25,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
using LY.MicroService.WechatManagement; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
using Serilog; |
|
|
|
@ -19,11 +20,9 @@ try |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -26,11 +26,9 @@ public class Program |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var configuration = config.Build(); |
|
|
|
var agileConfigEnabled = configuration["AgileConfig:IsEnabled"]; |
|
|
|
if (agileConfigEnabled.IsNullOrEmpty() || bool.Parse(agileConfigEnabled)) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(configuration)); |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|
|
|
|
@ -21,13 +21,9 @@ try |
|
|
|
.UseAutofac() |
|
|
|
.ConfigureAppConfiguration((context, config) => |
|
|
|
{ |
|
|
|
var agileConfig = context.Configuration.GetSection("AgileConfig");//IsEnabled
|
|
|
|
if (agileConfig.Exists()) |
|
|
|
if (context.Configuration.GetValue("AgileConfig:IsEnabled", false)) |
|
|
|
{ |
|
|
|
if (agileConfig.GetValue("IsEnabled", false)) |
|
|
|
{ |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
config.AddAgileConfig(new AgileConfig.Client.ConfigClient(context.Configuration)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.UseSerilog((context, provider, config) => |
|
|
|
|