diff --git a/src/IGeekFan.AspNetCore.Knife4jUI/IGeekFan.AspNetCore.Knife4jUI.csproj b/src/IGeekFan.AspNetCore.Knife4jUI/IGeekFan.AspNetCore.Knife4jUI.csproj index bfe1519..903c919 100644 --- a/src/IGeekFan.AspNetCore.Knife4jUI/IGeekFan.AspNetCore.Knife4jUI.csproj +++ b/src/IGeekFan.AspNetCore.Knife4jUI/IGeekFan.AspNetCore.Knife4jUI.csproj @@ -11,14 +11,14 @@ git https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git IGeekFan.AspNetCore.Knife4jUI - 0.0.13 + 0.0.14 igeekfan;xiaoym; true Apache License 2.0 - 0.0.13.0 - 0.0.13.0 + 0.0.14.0 + 0.0.14.0 @@ -46,6 +46,7 @@ + diff --git a/test/Basic/Basic.csproj b/test/Basic/Basic.csproj index 2e51ab9..997cadb 100644 --- a/test/Basic/Basic.csproj +++ b/test/Basic/Basic.csproj @@ -7,7 +7,7 @@ - + diff --git a/test/Basic/Properties/launchSettings.json b/test/Basic/Properties/launchSettings.json index 2b879f8..6c2b9f3 100644 --- a/test/Basic/Properties/launchSettings.json +++ b/test/Basic/Properties/launchSettings.json @@ -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" } diff --git a/test/Knife4jUIDemo/Controllers/WeatherForecastController.cs b/test/Knife4jUIDemo/Controllers/WeatherForecastController.cs index 6df4c78..9c8c3ae 100644 --- a/test/Knife4jUIDemo/Controllers/WeatherForecastController.cs +++ b/test/Knife4jUIDemo/Controllers/WeatherForecastController.cs @@ -73,6 +73,46 @@ namespace Knife4jUIDemo.Controllers }) .ToArray(); } + + /// + /// 发送一个Post + /// + /// + [HttpPost("CreateUserRequest")] + public UserRequest CreateUserRequest([FromBody] UserRequest req) + { + return req; + } + + } + + /// + /// TheyReqDto + /// + public sealed class TheyReqDto + { + /// + /// Hobbies + /// + public string Hobbies { get; set; } = string.Empty; + + /// + /// Behavior + /// + public string Behavior { get; set; } = string.Empty; + } + + public class UserRequest where TRequest : class + { + /// + /// RequestId + /// + public string RequestId { get; set; } = string.Empty; + + /// + /// Args + /// + public TRequest Args { get; set; } } /// diff --git a/test/Knife4jUIDemo/Knife4jUIDemo.csproj b/test/Knife4jUIDemo/Knife4jUIDemo.csproj index 9d77fbf..8c6ea47 100644 --- a/test/Knife4jUIDemo/Knife4jUIDemo.csproj +++ b/test/Knife4jUIDemo/Knife4jUIDemo.csproj @@ -12,12 +12,13 @@ + - + diff --git a/test/Knife4jUIDemo/Knife4jUIDemo.xml b/test/Knife4jUIDemo/Knife4jUIDemo.xml index 58b0e21..f0a7498 100644 --- a/test/Knife4jUIDemo/Knife4jUIDemo.xml +++ b/test/Knife4jUIDemo/Knife4jUIDemo.xml @@ -27,6 +27,37 @@ + + + 发送一个Post + + + + + + TheyReqDto + + + + + Hobbies + + + + + Behavior + + + + + RequestId + + + + + Args + + 请求实体 diff --git a/test/Knife4jUIDemo/Startup.cs b/test/Knife4jUIDemo/Startup.cs index 7f1d5dc..8b999bb 100644 --- a/test/Knife4jUIDemo/Startup.cs +++ b/test/Knife4jUIDemo/Startup.cs @@ -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); }); } diff --git a/test/WebSites/OAuth2Integration/AuthServer/Config.cs b/test/WebSites/OAuth2Integration/AuthServer/Config.cs index 0f598c5..555da0a 100644 --- a/test/WebSites/OAuth2Integration/AuthServer/Config.cs +++ b/test/WebSites/OAuth2Integration/AuthServer/Config.cs @@ -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" }, }; } diff --git a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj index 7731bee..50bfa2f 100644 --- a/test/WebSites/OAuth2Integration/OAuth2Integration.csproj +++ b/test/WebSites/OAuth2Integration/OAuth2Integration.csproj @@ -1,11 +1,11 @@ - + netcoreapp3.1 - + diff --git a/test/WebSites/OAuth2Integration/Startup.cs b/test/WebSites/OAuth2Integration/Startup.cs index d5b5ca5..c9ead99 100644 --- a/test/WebSites/OAuth2Integration/Startup.cs +++ b/test/WebSites/OAuth2Integration/Startup.cs @@ -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 - { - { "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 + // { + // { "readAccess", "Access read operations" }, + // { "writeAccess", "Access write operations" } + // } + // } + // } + //}); c.CustomOperationIds(apiDesc => {