mirror of
https://github.com/nsnail/IGeekFan.AspNetCore.Knife4jUI.git
synced 2025-04-16 23:52:49 +08:00
update 0.0.14
This commit is contained in:
parent
76b34bc154
commit
fb383e2c3c
@ -11,14 +11,14 @@
|
|||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git</RepositoryUrl>
|
||||||
<RootNamespace>IGeekFan.AspNetCore.Knife4jUI</RootNamespace>
|
<RootNamespace>IGeekFan.AspNetCore.Knife4jUI</RootNamespace>
|
||||||
<Version>0.0.13</Version>
|
<Version>0.0.14</Version>
|
||||||
<Company />
|
<Company />
|
||||||
<Authors>igeekfan;xiaoym;</Authors>
|
<Authors>igeekfan;xiaoym;</Authors>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Copyright>Apache License 2.0</Copyright>
|
<Copyright>Apache License 2.0</Copyright>
|
||||||
<PackageLicenseExpression></PackageLicenseExpression>
|
<PackageLicenseExpression></PackageLicenseExpression>
|
||||||
<AssemblyVersion>0.0.13.0</AssemblyVersion>
|
<AssemblyVersion>0.0.14.0</AssemblyVersion>
|
||||||
<FileVersion>0.0.13.0</FileVersion>
|
<FileVersion>0.0.14.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Using SourceLink -->
|
<!-- Using SourceLink -->
|
||||||
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="knife4j/**/*" />
|
<EmbeddedResource Include="knife4j/**/*" />
|
||||||
|
<EmbeddedResource Include="oauth/*" />
|
||||||
<EmbeddedResource Include="favicon.ico" />
|
<EmbeddedResource Include="favicon.ico" />
|
||||||
<EmbeddedResource Include="index.html" />
|
<EmbeddedResource Include="index.html" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.12" />
|
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.13" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="6.4.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="6.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "",
|
"launchUrl": "",
|
||||||
"applicationUrl": "http://localhost:5000;https://localhost:5001",
|
"applicationUrl": "http://localhost:5002;https://localhost:5003",
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,46 @@ namespace Knife4jUIDemo.Controllers
|
|||||||
})
|
})
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送一个Post
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("CreateUserRequest")]
|
||||||
|
public UserRequest<TheyReqDto> CreateUserRequest([FromBody] UserRequest<TheyReqDto> req)
|
||||||
|
{
|
||||||
|
return req;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// TheyReqDto
|
||||||
|
/// </summary>
|
||||||
|
public sealed class TheyReqDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Hobbies
|
||||||
|
/// </summary>
|
||||||
|
public string Hobbies { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Behavior
|
||||||
|
/// </summary>
|
||||||
|
public string Behavior { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserRequest<TRequest> where TRequest : class
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RequestId
|
||||||
|
/// </summary>
|
||||||
|
public string RequestId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Args
|
||||||
|
/// </summary>
|
||||||
|
public TRequest Args { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -12,12 +12,13 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!--<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.9" />-->
|
<!--<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.9" />-->
|
||||||
|
<PackageReference Include="IGeekFan.AspNetCore.Knife4jUI" Version="0.0.13" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />
|
<!--<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />-->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -27,6 +27,37 @@
|
|||||||
</summary>
|
</summary>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:Knife4jUIDemo.Controllers.WeatherForecastController.CreateUserRequest(Knife4jUIDemo.Controllers.UserRequest{Knife4jUIDemo.Controllers.TheyReqDto})">
|
||||||
|
<summary>
|
||||||
|
发送一个Post
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
|
<member name="T:Knife4jUIDemo.Controllers.TheyReqDto">
|
||||||
|
<summary>
|
||||||
|
TheyReqDto
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Knife4jUIDemo.Controllers.TheyReqDto.Hobbies">
|
||||||
|
<summary>
|
||||||
|
Hobbies
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Knife4jUIDemo.Controllers.TheyReqDto.Behavior">
|
||||||
|
<summary>
|
||||||
|
Behavior
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Knife4jUIDemo.Controllers.UserRequest`1.RequestId">
|
||||||
|
<summary>
|
||||||
|
RequestId
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="P:Knife4jUIDemo.Controllers.UserRequest`1.Args">
|
||||||
|
<summary>
|
||||||
|
Args
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:Knife4jUIDemo.Controllers.PostErrorCodeDto">
|
<member name="T:Knife4jUIDemo.Controllers.PostErrorCodeDto">
|
||||||
<summary>
|
<summary>
|
||||||
请求实体
|
请求实体
|
||||||
|
@ -42,8 +42,8 @@ namespace Knife4jUIDemo
|
|||||||
return controllerAction.ControllerName + "-" + controllerAction.ActionName;
|
return controllerAction.ControllerName + "-" + controllerAction.ActionName;
|
||||||
});
|
});
|
||||||
|
|
||||||
var filePath = Path.Combine(System.AppContext.BaseDirectory, "Knife4jUIDemo.xml");
|
//var filePath = Path.Combine(System.AppContext.BaseDirectory, "Knife4jUIDemo.xml");
|
||||||
c.IncludeXmlComments(filePath, true);
|
//c.IncludeXmlComments(filePath, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,14 +16,16 @@ namespace OAuth2Integration.AuthServer
|
|||||||
RedirectUris = new[] {
|
RedirectUris = new[] {
|
||||||
"http://localhost:55202/resource-server/swagger/oauth2-redirect.html", // IIS Express
|
"http://localhost:55202/resource-server/swagger/oauth2-redirect.html", // IIS Express
|
||||||
"http://localhost:5000/resource-server/swagger/oauth2-redirect.html", // Kestrel
|
"http://localhost:5000/resource-server/swagger/oauth2-redirect.html", // Kestrel
|
||||||
|
"http://localhost:5000/oauth/oauth2.html", // Kestrel
|
||||||
|
"http://localhost:8080/oauth/oauth2.html", // Kestrel
|
||||||
},
|
},
|
||||||
|
|
||||||
ClientSecrets = { new Secret("test-secret".Sha256()) },
|
ClientSecrets = { new Secret("test-secret".Sha256()) },
|
||||||
RequireConsent = true,
|
RequireConsent = true,
|
||||||
|
|
||||||
AllowedGrantTypes = GrantTypes.Code,
|
AllowedGrantTypes = GrantTypes.Code,
|
||||||
RequirePkce = true,
|
RequirePkce = false,
|
||||||
AllowedScopes = new[] { "readAccess", "writeAccess" },
|
//AllowedScopes = new[] { "readAccess", "writeAccess" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="IdentityServer4" Version="4.1.2" />
|
<PackageReference Include="IdentityServer4" Version="3.0.1" />
|
||||||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
|
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
|
||||||
<PackageReference Include="NCaptcha.AspNetCore.SessionImages" Version="0.1.0" />
|
<PackageReference Include="NCaptcha.AspNetCore.SessionImages" Version="0.1.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0" />
|
||||||
|
@ -60,24 +60,24 @@ namespace OAuth2Integration
|
|||||||
{
|
{
|
||||||
c.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", Title = "Test API V1" });
|
c.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", Title = "Test API V1" });
|
||||||
|
|
||||||
// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
|
//// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
|
||||||
c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
//c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
|
||||||
{
|
//{
|
||||||
Type = SecuritySchemeType.OAuth2,
|
// Type = SecuritySchemeType.OAuth2,
|
||||||
Flows = new OpenApiOAuthFlows
|
// Flows = new OpenApiOAuthFlows
|
||||||
{
|
// {
|
||||||
AuthorizationCode = new OpenApiOAuthFlow
|
// AuthorizationCode = new OpenApiOAuthFlow
|
||||||
{
|
// {
|
||||||
AuthorizationUrl = new Uri("/auth-server/connect/authorize", UriKind.Relative),
|
// AuthorizationUrl = new Uri("/auth-server/connect/authorize", UriKind.Relative),
|
||||||
TokenUrl = new Uri("/auth-server/connect/token", UriKind.Relative),
|
// TokenUrl = new Uri("/auth-server/connect/token", UriKind.Relative),
|
||||||
Scopes = new Dictionary<string, string>
|
// Scopes = new Dictionary<string, string>
|
||||||
{
|
// {
|
||||||
{ "readAccess", "Access read operations" },
|
// { "readAccess", "Access read operations" },
|
||||||
{ "writeAccess", "Access write operations" }
|
// { "writeAccess", "Access write operations" }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
//});
|
||||||
|
|
||||||
c.CustomOperationIds(apiDesc =>
|
c.CustomOperationIds(apiDesc =>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user