Browse Source

use appsettings(agile_config) as the main gateway configuration

5.0.0-rc.1
cKey 4 years ago
parent
commit
8aca99ab0d
  1. 2
      aspnet-core/Directory.Build.props
  2. 7
      aspnet-core/LINGYUN.MicroService.All.sln
  3. 3
      aspnet-core/modules/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs
  4. 2
      gateways/Directory.Build.props
  5. 3
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/InternalApiGatewayModule.Configure.cs
  6. 1
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/InternalApiGatewayOptions.cs
  7. 2
      gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/appsettings.Development.json

2
aspnet-core/Directory.Build.props

@ -6,7 +6,7 @@
<DotNetCoreCAPPackageVersion>5.2.0</DotNetCoreCAPPackageVersion>
<AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion>
<AliyunOSSSDKPackageVersion>2.13.0</AliyunOSSSDKPackageVersion>
<AgileConfigClientPackageVersion>1.2.1.3</AgileConfigClientPackageVersion>
<AgileConfigClientPackageVersion>1.2.1.5</AgileConfigClientPackageVersion>
<HangfireMySqlStoragePackageVersion>2.0.3</HangfireMySqlStoragePackageVersion>
<HangfireMSSQLStoragePackageVersion>1.7.27</HangfireMSSQLStoragePackageVersion>
<NESTPackageVersion>7.15.1</NESTPackageVersion>

7
aspnet-core/LINGYUN.MicroService.All.sln

@ -351,6 +351,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenApi", "modu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenApi.Authorization", "modules\open-api\LINGYUN.Abp.OpenApi.Authorization\LINGYUN.Abp.OpenApi.Authorization.csproj", "{433AD1FB-2DE8-479F-B89E-A17217591538}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Wrapper", "modules\common\LINGYUN.Abp.Wrapper\LINGYUN.Abp.Wrapper.csproj", "{65311EC9-7A86-4E73-A587-F06A99474EDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -909,6 +911,10 @@ Global
{433AD1FB-2DE8-479F-B89E-A17217591538}.Debug|Any CPU.Build.0 = Debug|Any CPU
{433AD1FB-2DE8-479F-B89E-A17217591538}.Release|Any CPU.ActiveCfg = Release|Any CPU
{433AD1FB-2DE8-479F-B89E-A17217591538}.Release|Any CPU.Build.0 = Release|Any CPU
{65311EC9-7A86-4E73-A587-F06A99474EDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65311EC9-7A86-4E73-A587-F06A99474EDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65311EC9-7A86-4E73-A587-F06A99474EDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65311EC9-7A86-4E73-A587-F06A99474EDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1082,6 +1088,7 @@ Global
{3C7A8246-DE82-4330-8697-24EF1B1C515D} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{4059F87E-9762-46C1-AEB1-B1128EA533AE} = {3C7A8246-DE82-4330-8697-24EF1B1C515D}
{433AD1FB-2DE8-479F-B89E-A17217591538} = {3C7A8246-DE82-4330-8697-24EF1B1C515D}
{65311EC9-7A86-4E73-A587-F06A99474EDD} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

3
aspnet-core/modules/common/LINGYUN.Abp.Wrapper/LINGYUN/Abp/Wrapper/DefaultExceptionWrapHandler.cs

@ -30,10 +30,9 @@ namespace LINGYUN.Abp.Wrapper
{
if (context.StatusCode.HasValue)
{
context.WithCode(context.StatusCode.ToString());
context.WithCode(((int)context.StatusCode).ToString());
return;
}
// TODO: 先从TttpStatusCodeFinder中查找
var wrapperOptions = context.ServiceProvider.GetRequiredService<IOptions<AbpWrapperOptions>>().Value;
context.WithCode(wrapperOptions.CodeWithUnhandled);
}

2
gateways/Directory.Build.props

@ -6,7 +6,7 @@
<DotNetCoreCAPPackageVersion>5.2.0</DotNetCoreCAPPackageVersion>
<AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion>
<AliyunOSSSDKPackageVersion>2.13.0</AliyunOSSSDKPackageVersion>
<AgileConfigClientPackageVersion>1.2.1.3</AgileConfigClientPackageVersion>
<AgileConfigClientPackageVersion>1.2.1.5</AgileConfigClientPackageVersion>
<HangfireMySqlStoragePackageVersion>2.0.3</HangfireMySqlStoragePackageVersion>
<HangfireMSSQLStoragePackageVersion>1.7.27</HangfireMSSQLStoragePackageVersion>
<NESTPackageVersion>7.15.1</NESTPackageVersion>

3
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/InternalApiGatewayModule.Configure.cs

@ -120,7 +120,8 @@ namespace LINGYUN.MicroService.Internal.ApiGateway
private void ConfigureOcelot(IServiceCollection services, IConfiguration configuration)
{
services.AddSingleton<IFileConfigurationRepository, DiskFileConfigurationAggragatorRepository>();
// 需要合并自定义配置取消注释
// services.AddSingleton<IFileConfigurationRepository, DiskFileConfigurationAggragatorRepository>();
services
.AddOcelot(configuration)
.AddPolly()

1
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/InternalApiGatewayOptions.cs

@ -4,7 +4,6 @@ namespace LINGYUN.MicroService.Internal.ApiGateway
{
public class InternalApiGatewayOptions
{
public string AppId { get; set; }
public DownstreamOpenApi[] DownstreamOpenApis { get; set; }
public InternalApiGatewayOptions()
{

2
gateways/internal/LINGYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.Internal.ApiGateway/appsettings.Development.json

@ -1,7 +1,7 @@
{
"AgileConfig": {
"env": "DEV",
"appId": "LINGYUN.Abp.ApiGateway",
"appId": "LINGYUN.Internal.ApiGateway",
"secret": "1q2w3E*",
"nodes": "http://127.0.0.1:5000",
"name": "ApiGateway",

Loading…
Cancel
Save