-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(open-api): add open-api gateway module
- Loading branch information
Showing
11 changed files
with
1,072 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...al.ApiGateway/src/LINGYUN.MicroService.OpenApi.Gateway/AbpHostingHostBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
}); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...nternal.ApiGateway/src/LINGYUN.MicroService.OpenApi.Gateway/Controllers/HomeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...GYUN.MicroService.Internal.ApiGateway/src/LINGYUN.MicroService.OpenApi.Gateway/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
48 changes: 48 additions & 0 deletions
48
...eway/src/LINGYUN.MicroService.OpenApi.Gateway/LINGYUN.MicroService.OpenApi.Gateway.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.