update 0.0.14

This commit is contained in:
igeekfan 2023-07-20 01:15:12 +08:00
parent 76b34bc154
commit fb383e2c3c
10 changed files with 105 additions and 30 deletions

View File

@ -11,14 +11,14 @@
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git</RepositoryUrl>
<RootNamespace>IGeekFan.AspNetCore.Knife4jUI</RootNamespace>
<Version>0.0.13</Version>
<Version>0.0.14</Version>
<Company />
<Authors>igeekfan;xiaoym;</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Copyright>Apache License 2.0</Copyright>
<PackageLicenseExpression></PackageLicenseExpression>
<AssemblyVersion>0.0.13.0</AssemblyVersion>
<FileVersion>0.0.13.0</FileVersion>
<AssemblyVersion>0.0.14.0</AssemblyVersion>
<FileVersion>0.0.14.0</FileVersion>
</PropertyGroup>
<!-- Using SourceLink -->
@ -46,6 +46,7 @@
<ItemGroup>
<EmbeddedResource Include="knife4j/**/*" />
<EmbeddedResource Include="oauth/*" />
<EmbeddedResource Include="favicon.ico" />
<EmbeddedResource Include="index.html" />
</ItemGroup>

View File

@ -7,7 +7,7 @@
</PropertyGroup>
<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.SwaggerUi" Version="6.4.0" />
</ItemGroup>

View File

@ -4,7 +4,7 @@
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "http://localhost:5000;https://localhost:5001",
"applicationUrl": "http://localhost:5002;https://localhost:5003",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}

View File

@ -73,6 +73,46 @@ namespace Knife4jUIDemo.Controllers
})
.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>

View File

@ -12,12 +12,13 @@
<ItemGroup>
<!--<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="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />
<!--<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />-->
</ItemGroup>
<ItemGroup>

View File

@ -27,6 +27,37 @@
</summary>
<returns></returns>
</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">
<summary>
请求实体

View File

@ -42,8 +42,8 @@ namespace Knife4jUIDemo
return controllerAction.ControllerName + "-" + controllerAction.ActionName;
});
var filePath = Path.Combine(System.AppContext.BaseDirectory, "Knife4jUIDemo.xml");
c.IncludeXmlComments(filePath, true);
//var filePath = Path.Combine(System.AppContext.BaseDirectory, "Knife4jUIDemo.xml");
//c.IncludeXmlComments(filePath, true);
});
}

View File

@ -16,14 +16,16 @@ namespace OAuth2Integration.AuthServer
RedirectUris = new[] {
"http://localhost:55202/resource-server/swagger/oauth2-redirect.html", // IIS Express
"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()) },
RequireConsent = true,
AllowedGrantTypes = GrantTypes.Code,
RequirePkce = true,
AllowedScopes = new[] { "readAccess", "writeAccess" },
RequirePkce = false,
//AllowedScopes = new[] { "readAccess", "writeAccess" },
};
}

View File

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<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="NCaptcha.AspNetCore.SessionImages" Version="0.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0" />

View File

@ -60,24 +60,24 @@ namespace OAuth2Integration
{
c.SwaggerDoc("v1", new OpenApiInfo { Version = "v1", Title = "Test API V1" });
// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
{
Type = SecuritySchemeType.OAuth2,
Flows = new OpenApiOAuthFlows
{
AuthorizationCode = new OpenApiOAuthFlow
{
AuthorizationUrl = new Uri("/auth-server/connect/authorize", UriKind.Relative),
TokenUrl = new Uri("/auth-server/connect/token", UriKind.Relative),
Scopes = new Dictionary<string, string>
{
{ "readAccess", "Access read operations" },
{ "writeAccess", "Access write operations" }
}
}
}
});
//// Define the OAuth2.0 scheme that's in use (i.e. Implicit Flow)
//c.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
//{
// Type = SecuritySchemeType.OAuth2,
// Flows = new OpenApiOAuthFlows
// {
// AuthorizationCode = new OpenApiOAuthFlow
// {
// AuthorizationUrl = new Uri("/auth-server/connect/authorize", UriKind.Relative),
// TokenUrl = new Uri("/auth-server/connect/token", UriKind.Relative),
// Scopes = new Dictionary<string, string>
// {
// { "readAccess", "Access read operations" },
// { "writeAccess", "Access write operations" }
// }
// }
// }
//});
c.CustomOperationIds(apiDesc =>
{