Skip to content

Commit

Permalink
feat(open-api): add open-api gateway module
Browse files Browse the repository at this point in the history
  • Loading branch information
colinin committed Oct 25, 2024
1 parent df3355b commit 1f07c25
Show file tree
Hide file tree
Showing 11 changed files with 1,072 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Logging.Serilog
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Logging", "..\..\..\aspnet-core\framework\logging\LINGYUN.Abp.Logging\LINGYUN.Abp.Logging.csproj", "{745E278B-AEDC-49CE-872E-FAEB6BF195B1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "open-api", "open-api", "{BA1D1A21-61AD-4674-A5FB-AE4FF61E9CC1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenApi", "..\..\..\aspnet-core\framework\open-api\LINGYUN.Abp.OpenApi\LINGYUN.Abp.OpenApi.csproj", "{F4B22A53-9483-4906-86F9-2A23E6D46CE9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.OpenApi.Authorization", "..\..\..\aspnet-core\framework\open-api\LINGYUN.Abp.OpenApi.Authorization\LINGYUN.Abp.OpenApi.Authorization.csproj", "{7F3CC521-FE9B-4E52-BF52-93C41E2F34ED}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.MicroService.OpenApi.Gateway", "src\LINGYUN.MicroService.OpenApi.Gateway\LINGYUN.MicroService.OpenApi.Gateway.csproj", "{433D2E8C-E15A-47BC-AB49-25307C05E849}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "identity", "identity", "{667EE009-DA55-4F87-9A07-F9DE76AF6EBF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session", "..\..\..\aspnet-core\modules\identity\LINGYUN.Abp.Identity.Session\LINGYUN.Abp.Identity.Session.csproj", "{F6CA275D-5843-4349-851C-B56A3A74F545}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Identity.Session.AspNetCore", "..\..\..\aspnet-core\modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj", "{80965673-2598-44E6-98C7-CCF8F0D4A4A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IP2Region", "..\..\..\aspnet-core\framework\common\LINGYUN.Abp.IP2Region\LINGYUN.Abp.IP2Region.csproj", "{85CAA0EF-883D-469B-BBEC-735758A3FC9B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApi.Sdk", "..\..\..\aspnet-core\framework\open-api\OpenApi.Sdk\OpenApi.Sdk.csproj", "{551D8B82-B619-4846-BC3B-E883BA312D9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -116,6 +134,34 @@ Global
{745E278B-AEDC-49CE-872E-FAEB6BF195B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{745E278B-AEDC-49CE-872E-FAEB6BF195B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{745E278B-AEDC-49CE-872E-FAEB6BF195B1}.Release|Any CPU.Build.0 = Release|Any CPU
{F4B22A53-9483-4906-86F9-2A23E6D46CE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4B22A53-9483-4906-86F9-2A23E6D46CE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4B22A53-9483-4906-86F9-2A23E6D46CE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4B22A53-9483-4906-86F9-2A23E6D46CE9}.Release|Any CPU.Build.0 = Release|Any CPU
{7F3CC521-FE9B-4E52-BF52-93C41E2F34ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F3CC521-FE9B-4E52-BF52-93C41E2F34ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F3CC521-FE9B-4E52-BF52-93C41E2F34ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F3CC521-FE9B-4E52-BF52-93C41E2F34ED}.Release|Any CPU.Build.0 = Release|Any CPU
{433D2E8C-E15A-47BC-AB49-25307C05E849}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{433D2E8C-E15A-47BC-AB49-25307C05E849}.Debug|Any CPU.Build.0 = Debug|Any CPU
{433D2E8C-E15A-47BC-AB49-25307C05E849}.Release|Any CPU.ActiveCfg = Release|Any CPU
{433D2E8C-E15A-47BC-AB49-25307C05E849}.Release|Any CPU.Build.0 = Release|Any CPU
{F6CA275D-5843-4349-851C-B56A3A74F545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6CA275D-5843-4349-851C-B56A3A74F545}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6CA275D-5843-4349-851C-B56A3A74F545}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6CA275D-5843-4349-851C-B56A3A74F545}.Release|Any CPU.Build.0 = Release|Any CPU
{80965673-2598-44E6-98C7-CCF8F0D4A4A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80965673-2598-44E6-98C7-CCF8F0D4A4A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80965673-2598-44E6-98C7-CCF8F0D4A4A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80965673-2598-44E6-98C7-CCF8F0D4A4A0}.Release|Any CPU.Build.0 = Release|Any CPU
{85CAA0EF-883D-469B-BBEC-735758A3FC9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85CAA0EF-883D-469B-BBEC-735758A3FC9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85CAA0EF-883D-469B-BBEC-735758A3FC9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85CAA0EF-883D-469B-BBEC-735758A3FC9B}.Release|Any CPU.Build.0 = Release|Any CPU
{551D8B82-B619-4846-BC3B-E883BA312D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{551D8B82-B619-4846-BC3B-E883BA312D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{551D8B82-B619-4846-BC3B-E883BA312D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{551D8B82-B619-4846-BC3B-E883BA312D9A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -140,6 +186,15 @@ Global
{3F3CA517-8A22-4B85-A2E8-3BB90B99A158} = {EE01F3C2-14D1-4089-8C02-00C8083D9795}
{4AF54F2B-D650-4B4D-AD05-2AA882DD2A49} = {3B460BD3-26EE-4BAC-A8B8-CFDF5F108A63}
{745E278B-AEDC-49CE-872E-FAEB6BF195B1} = {3B460BD3-26EE-4BAC-A8B8-CFDF5F108A63}
{BA1D1A21-61AD-4674-A5FB-AE4FF61E9CC1} = {80E45092-1181-456D-B88C-7DDCB7F16368}
{F4B22A53-9483-4906-86F9-2A23E6D46CE9} = {BA1D1A21-61AD-4674-A5FB-AE4FF61E9CC1}
{7F3CC521-FE9B-4E52-BF52-93C41E2F34ED} = {BA1D1A21-61AD-4674-A5FB-AE4FF61E9CC1}
{433D2E8C-E15A-47BC-AB49-25307C05E849} = {E8067AED-2B6E-4134-AAF8-9101457D709A}
{667EE009-DA55-4F87-9A07-F9DE76AF6EBF} = {80E45092-1181-456D-B88C-7DDCB7F16368}
{F6CA275D-5843-4349-851C-B56A3A74F545} = {667EE009-DA55-4F87-9A07-F9DE76AF6EBF}
{80965673-2598-44E6-98C7-CCF8F0D4A4A0} = {667EE009-DA55-4F87-9A07-F9DE76AF6EBF}
{85CAA0EF-883D-469B-BBEC-735758A3FC9B} = {EE01F3C2-14D1-4089-8C02-00C8083D9795}
{551D8B82-B619-4846-BC3B-E883BA312D9A} = {BA1D1A21-61AD-4674-A5FB-AE4FF61E9CC1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {972464AB-1B23-4D87-89A2-13271E1873B9}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;

namespace LINGYUN.MicroService.OpenApi.Gateway;

public static class AbpHostingHostBuilderExtensions
{
public const string AppYarpJsonPath = "yarp.json";
public static IHostBuilder AddYarpJson(
this IHostBuilder hostBuilder,
bool optional = true,
bool reloadOnChange = true,
string path = AppYarpJsonPath)
{
return hostBuilder.ConfigureAppConfiguration((_, builder) =>
{
builder.AddJsonFile(
path: AppYarpJsonPath,
optional: optional,
reloadOnChange: reloadOnChange
);
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;

namespace LINGYUN.MicroService.OpenApi.Gateway.Controllers;

public class HomeController : AbpControllerBase
{
public IActionResult Index()
{
return Redirect("/swagger/index.html");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0
LABEL maintainer="colin.in@foxmail.com"
WORKDIR /app

COPY . /app

EXPOSE 80/tcp
VOLUME [ "./app/Logs" ]
VOLUME [ "./app/Modules" ]

ENTRYPOINT ["dotnet", "LINGYUN.MicroService.Internal.Gateway.dll"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>LINGYUN.MicroService.Internal.Gateway</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="Yarp.ReverseProxy" />
<PackageReference Include="Yarp.Telemetry.Consumption" />
<PackageReference Include="AgileConfig.Client" />
<PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.Assembly" />
<PackageReference Include="Serilog.Enrichers.Process" />
<PackageReference Include="Serilog.Enrichers.Thread" />
<PackageReference Include="Serilog.Settings.Configuration" />
<PackageReference Include="Serilog.Sinks.Elasticsearch" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.AspNetCore" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.Swashbuckle" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\auditing\LINGYUN.Abp.AuditLogging.Elasticsearch\LINGYUN.Abp.AuditLogging.Elasticsearch.csproj" />
<!--<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj" />-->
<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\logging\LINGYUN.Abp.Serilog.Enrichers.Application\LINGYUN.Abp.Serilog.Enrichers.Application.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\framework\open-api\LINGYUN.Abp.OpenApi.Authorization\LINGYUN.Abp.OpenApi.Authorization.csproj" />
<ProjectReference Include="..\..\..\..\..\aspnet-core\modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit 1f07c25

Please sign in to comment.