mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-08-02 11:50:17 +08:00
Add .NET 6 Sample
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.11" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.1.4" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="6.1.4" />
|
||||
</ItemGroup>
|
||||
@ -16,6 +17,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />
|
||||
<!--<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />-->
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -55,7 +55,7 @@ namespace Basic
|
||||
//c.EnableAnnotations();
|
||||
c.AddServer(new OpenApiServer()
|
||||
{
|
||||
Url = "",
|
||||
Url = "http://localhost:81/admin/",
|
||||
Description = "vvv"
|
||||
});
|
||||
c.CustomOperationIds(apiDesc =>
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<!--<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.9" />-->
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.1.4" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -23,14 +23,19 @@ namespace Knife4jUIDemo
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddControllers();
|
||||
services.Configure<Knife4UIOptions>(c =>
|
||||
{
|
||||
Configuration.Bind("Knife4UI", c);
|
||||
});
|
||||
services.AddSwaggerGen(c =>
|
||||
{
|
||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "API V1", Version = "v1" });
|
||||
c.AddServer(new OpenApiServer()
|
||||
{
|
||||
//Url = "http://localhost:81/admin/",
|
||||
Url = "http://localhost:81/admin/",
|
||||
Description = "vvv"
|
||||
});
|
||||
|
||||
c.CustomOperationIds(apiDesc =>
|
||||
{
|
||||
var controllerAction = apiDesc.ActionDescriptor as ControllerActionDescriptor;
|
||||
|
@ -6,5 +6,9 @@
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"Knife4UI": {
|
||||
"DocumentTitle": "Knife4jUI Demo"
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user