支持兼容.net7和.net8

master
zhontai 1 year ago
parent b36f21041c
commit 3b8e52c7ee

@ -21,7 +21,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4A1F23C8
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{A6C50476-5236-4FD3-8C29-6449494846C0}"
ProjectSection(SolutionItems) = preProject
build\pkg.props = build\pkg.props
src\platform\Directory.Build.props = src\platform\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZhonTai.ApiUI", "src\platform\ZhonTai.ApiUI\ZhonTai.ApiUI.csproj", "{A6911102-A4F8-4000-A997-045F84F73060}"

@ -1,19 +0,0 @@
<Project>
<PropertyGroup>
<Version>5.0.2</Version>
<TargetFramework>net8.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Authors>xiaoxue</Authors>
<Company>xiaoxue</Company>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://admin.zhontai.net</PackageProjectUrl>
<RepositoryUrl>https://github.com/zhontai/Admin.Core</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>ZhonTai AdminApi;WebApi;HttpApi;</PackageTags>
<PackageIcon>logo.png</PackageIcon>
<NoWarn>1701;1702;1591</NoWarn>
</PropertyGroup>
</Project>

@ -1,3 +0,0 @@
<Project>
<Import Project="..\build\pkg.props" />
</Project>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Description>中台接口宿主</Description>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

@ -0,0 +1,23 @@
<Project>
<PropertyGroup>
<Version>5.0.2</Version>
<LangVersion>Latest</LangVersion>
<TargetFrameworks>net7.0;net8.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<RunAnalyzersDuringLiveAnalysis>false</RunAnalyzersDuringLiveAnalysis>
<Authors>xiaoxue</Authors>
<Company>xiaoxue</Company>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://admin.zhontai.net</PackageProjectUrl>
<RepositoryUrl>https://github.com/zhontai/Admin.Core</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>ZhonTai AdminApi;WebApi;HttpApi;</PackageTags>
<PackageIcon>logo.png</PackageIcon>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>$(MSBuildProjectName).xml</DocumentationFile>
</PropertyGroup>
</Project>

@ -10,7 +10,7 @@ public static class ClaimAttributes
/// <summary>
/// 用户Id
/// </summary>
public const string UserId = "id";
public const string UserId = "uid";
/// <summary>
/// 用户名

@ -17,11 +17,20 @@ namespace ZhonTai.Admin.Core.Auth;
/// </summary>
public class ResponseAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions>
{
#if NET8_0
public ResponseAuthenticationHandler(
IOptionsMonitor<AuthenticationSchemeOptions> options,
ILoggerFactory logger,
UrlEncoder encoder
) : base(options, logger, encoder)
) : base(options, logger, encoder)
#else
public ResponseAuthenticationHandler(
IOptionsMonitor<AuthenticationSchemeOptions> options,
ILoggerFactory logger,
UrlEncoder encoder,
ISystemClock systemClock
) : base(options, logger, encoder, systemClock)
#endif
{
}

@ -88,6 +88,7 @@ public class AuthService : BaseService, IAuthService, IDynamicApi
new Claim(ClaimAttributes.UserName, user.UserName),
new Claim(ClaimAttributes.Name, user.Name),
new Claim(ClaimAttributes.UserType, user.Type.ToInt().ToString(), ClaimValueTypes.Integer32),
new Claim(JwtRegisteredClaimNames.Iat, DateTime.Now.ToTimestamp().ToString(), ClaimValueTypes.Integer64),
};
if (_appConfig.Tenant)

@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>中台Admin权限管理接口库</Description>
<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>ZhonTai.Admin.xml</DocumentationFile>
<NoWarn>1701;1702;1591;8632</NoWarn>
</PropertyGroup>
<ItemGroup>
<None Include="../../../logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="7.1.0" />
<PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
@ -40,14 +40,13 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="UAParser" Version="3.1.47" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ZhonTai.Common\ZhonTai.Common.csproj" />
<ProjectReference Include="..\ZhonTai.DynamicApi\ZhonTai.DynamicApi.csproj" />
<ProjectReference Include="..\ZhonTai.Common\ZhonTai.Common.csproj" />
<ProjectReference Include="..\ZhonTai.DynamicApi\ZhonTai.DynamicApi.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,434 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>ZhonTai.ApiUI</name>
</assembly>
<members>
<member name="M:ZhonTai.ApiUI.ApiUIBuilderExtensions.UseSwaggerUI(Microsoft.AspNetCore.Builder.IApplicationBuilder,ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Register the SwaggerUI middleware with provided options
</summary>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIBuilderExtensions.UseApiUI(Microsoft.AspNetCore.Builder.IApplicationBuilder,System.Action{ZhonTai.ApiUI.ApiUIOptions})">
<summary>
Register the SwaggerUI middleware with optional setup action for DI-injected options
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.RoutePrefix">
<summary>
Gets or sets a route prefix for accessing the swagger-ui
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.IndexStream">
<summary>
Gets or sets a Stream function for retrieving the swagger-ui page
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.DocumentTitle">
<summary>
Gets or sets a title for the swagger-ui page
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.HeadContent">
<summary>
Gets or sets additional content to place in the head of the swagger-ui page
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.ConfigObject">
<summary>
Gets the JavaScript config object, represented as JSON, that will be passed to the SwaggerUI
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.OAuthConfigObject">
<summary>
Gets the JavaScript config object, represented as JSON, that will be passed to the initOAuth method
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ApiUIOptions.Interceptors">
<summary>
Gets the interceptor functions that define client-side request/response interceptors
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.Urls">
<summary>
One or more Swagger JSON endpoints (url and name) to power the UI
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DeepLinking">
<summary>
If set to true, enables deep linking for tags and operations
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.PersistAuthorization">
<summary>
If set to true, it persists authorization data and it would not be lost on browser close/refresh
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DisplayOperationId">
<summary>
Controls the display of operationId in operations list
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DefaultModelsExpandDepth">
<summary>
The default expansion depth for models (set to -1 completely hide the models)
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DefaultModelExpandDepth">
<summary>
The default expansion depth for the model on the model-example section
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DefaultModelRendering">
<summary>
Controls how the model is shown when the API is first rendered.
(The user can always switch the rendering for a given model by clicking the 'Model' and 'Example Value' links)
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DisplayRequestDuration">
<summary>
Controls the display of the request duration (in milliseconds) for Try-It-Out requests
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.DocExpansion">
<summary>
Controls the default expansion setting for the operations and tags.
It can be 'list' (expands only the tags), 'full' (expands the tags and operations) or 'none' (expands nothing)
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.Filter">
<summary>
If set, enables filtering. The top bar will show an edit box that you can use to filter the tagged operations
that are shown. Can be an empty string or specific value, in which case filtering will be enabled using that
value as the filter expression. Filtering is case sensitive matching the filter expression anywhere inside the tag
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.MaxDisplayedTags">
<summary>
If set, limits the number of tagged operations displayed to at most this many. The default is to show all operations
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.ShowExtensions">
<summary>
Controls the display of vendor extension (x-) fields and values for Operations, Parameters, and Schema
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.ShowCommonExtensions">
<summary>
Controls the display of extensions (pattern, maxLength, minLength, maximum, minimum) fields and values for Parameters
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.OAuth2RedirectUrl">
<summary>
OAuth redirect URL
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.SupportedSubmitMethods">
<summary>
List of HTTP methods that have the Try it out feature enabled.
An empty array disables Try it out for all operations. This does not filter the operations from the display
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.TryItOutEnabled">
<summary>
Controls whether the "Try it out" section should be enabled by default.
</summary>
</member>
<member name="P:ZhonTai.ApiUI.ConfigObject.ValidatorUrl">
<summary>
By default, Swagger-UI attempts to validate specs against swagger.io's online validator.
You can use this parameter to set a different validator URL, for example for locally deployed validators (Validator Badge).
Setting it to null will disable validation
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.Username">
<summary>
Default username for OAuth2 password flow.
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.ClientId">
<summary>
Default clientId
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.ClientSecret">
<summary>
Default clientSecret
</summary>
<remarks>Setting this exposes the client secrets in inline javascript in the swagger-ui generated html.</remarks>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.Realm">
<summary>
Realm query parameter (for oauth1) added to authorizationUrl and tokenUrl
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.AppName">
<summary>
Application name, displayed in authorization popup
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.ScopeSeparator">
<summary>
Scope separator for passing scopes, encoded before calling, default value is a space (encoded value %20)
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.Scopes">
<summary>
String array of initially selected oauth scopes, default is empty array
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.AdditionalQueryStringParams">
<summary>
Additional query parameters added to authorizationUrl and tokenUrl
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.UseBasicAuthenticationWithAccessCodeGrant">
<summary>
Only activated for the accessCode flow. During the authorization_code request to the tokenUrl,
pass the Client Password using the HTTP Basic Authentication scheme
(Authorization header with Basic base64encode(client_id + client_secret))
</summary>
</member>
<member name="P:ZhonTai.ApiUI.OAuthConfigObject.UsePkceWithAuthorizationCodeGrant">
<summary>
Only applies to authorizatonCode flows. Proof Key for Code Exchange brings enhanced security for OAuth public clients.
The default is false
</summary>
</member>
<member name="P:ZhonTai.ApiUI.InterceptorFunctions.RequestInterceptorFunction">
<summary>
MUST be a valid Javascript function.
Function to intercept remote definition, "Try it out", and OAuth 2.0 requests.
Accepts one argument requestInterceptor(request) and must return the modified request, or a Promise that resolves to the modified request.
Ex: "function (req) { req.headers['MyCustomHeader'] = 'CustomValue'; return req; }"
</summary>
</member>
<member name="P:ZhonTai.ApiUI.InterceptorFunctions.ResponseInterceptorFunction">
<summary>
MUST be a valid Javascript function.
Function to intercept remote definition, "Try it out", and OAuth 2.0 responses.
Accepts one argument responseInterceptor(response) and must return the modified response, or a Promise that resolves to the modified response.
Ex: "function (res) { console.log(res); return res; }"
</summary>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.InjectStylesheet(ZhonTai.ApiUI.ApiUIOptions,System.String,System.String)">
<summary>
Injects additional CSS stylesheets into the index.html page
</summary>
<param name="options"></param>
<param name="path">A path to the stylesheet - i.e. the link "href" attribute</param>
<param name="media">The target media - i.e. the link "media" attribute</param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.InjectJavascript(ZhonTai.ApiUI.ApiUIOptions,System.String,System.String)">
<summary>
Injects additional Javascript files into the index.html page
</summary>
<param name="options"></param>
<param name="path">A path to the javascript - i.e. the script "src" attribute</param>
<param name="type">The script type - i.e. the script "type" attribute</param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.SwaggerEndpoint(ZhonTai.ApiUI.ApiUIOptions,System.String,System.String)">
<summary>
Adds Swagger JSON endpoints. Can be fully-qualified or relative to the UI page
</summary>
<param name="options"></param>
<param name="url">Can be fully qualified or relative to the current host</param>
<param name="name">The description that appears in the document selector drop-down</param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.EnableDeepLinking(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Enables deep linking for tags and operations
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.EnablePersistAuthorization(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Enables persist authorization data
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.DisplayOperationId(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Controls the display of operationId in operations list
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.DefaultModelsExpandDepth(ZhonTai.ApiUI.ApiUIOptions,System.Int32)">
<summary>
The default expansion depth for models (set to -1 completely hide the models)
</summary>
<param name="options"></param>
<param name="depth"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.DefaultModelExpandDepth(ZhonTai.ApiUI.ApiUIOptions,System.Int32)">
<summary>
The default expansion depth for the model on the model-example section
</summary>
<param name="options"></param>
<param name="depth"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.DefaultModelRendering(ZhonTai.ApiUI.ApiUIOptions,ZhonTai.ApiUI.ModelRendering)">
<summary>
Controls how the model is shown when the API is first rendered.
(The user can always switch the rendering for a given model by clicking the 'Model' and 'Example Value' links.)
</summary>
<param name="options"></param>
<param name="modelRendering"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.DisplayRequestDuration(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Controls the display of the request duration (in milliseconds) for Try-It-Out requests
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.DocExpansion(ZhonTai.ApiUI.ApiUIOptions,ZhonTai.ApiUI.DocExpansion)">
<summary>
Controls the default expansion setting for the operations and tags.
It can be 'List' (expands only the tags), 'Full' (expands the tags and operations) or 'None' (expands nothing)
</summary>
<param name="options"></param>
<param name="docExpansion"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.EnableFilter(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Enables filtering. The top bar will show an edit box that you can use to filter the tagged operations that are shown.
If an expression is provided it will be used and applied initially.
Filtering is case sensitive matching the filter expression anywhere inside the tag
</summary>
<param name="options"></param>
<param name="expression"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.EnableTryItOutByDefault(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Enables the "Try it out" section by default.
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.MaxDisplayedTags(ZhonTai.ApiUI.ApiUIOptions,System.Int32)">
<summary>
Limits the number of tagged operations displayed to at most this many. The default is to show all operations
</summary>
<param name="options"></param>
<param name="count"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.ShowExtensions(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Controls the display of vendor extension (x-) fields and values for Operations, Parameters, and Schema
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.ShowCommonExtensions(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Controls the display of extensions (pattern, maxLength, minLength, maximum, minimum) fields and values for Parameters
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.SupportedSubmitMethods(ZhonTai.ApiUI.ApiUIOptions,ZhonTai.ApiUI.SubmitMethod[])">
<summary>
List of HTTP methods that have the Try it out feature enabled. An empty array disables Try it out for all operations.
This does not filter the operations from the display
</summary>
<param name="options"></param>
<param name="submitMethods"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuth2RedirectUrl(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
OAuth redirect URL
</summary>
<param name="options"></param>
<param name="url"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.EnableValidator(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
You can use this parameter to enable the swagger-ui's built-in validator (badge) functionality
Setting it to null will disable validation
</summary>
<param name="options"></param>
<param name="url"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthClientId(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Default clientId
</summary>
<param name="options"></param>
<param name="value"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthUsername(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Default userName
</summary>
<param name="options"></param>
<param name="value"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthClientSecret(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Default clientSecret
</summary>
<param name="options"></param>
<param name="value"></param>
<remarks>Setting this exposes the client secrets in inline javascript in the swagger-ui generated html.</remarks>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthRealm(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
realm query parameter (for oauth1) added to authorizationUrl and tokenUrl
</summary>
<param name="options"></param>
<param name="value"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthAppName(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Application name, displayed in authorization popup
</summary>
<param name="options"></param>
<param name="value"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthScopeSeparator(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Scope separator for passing scopes, encoded before calling, default value is a space (encoded value %20)
</summary>
<param name="options"></param>
<param name="value"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthScopes(ZhonTai.ApiUI.ApiUIOptions,System.String[])">
<summary>
String array of initially selected oauth scopes, default is empty array
</summary>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthAdditionalQueryStringParams(ZhonTai.ApiUI.ApiUIOptions,System.Collections.Generic.Dictionary{System.String,System.String})">
<summary>
Additional query parameters added to authorizationUrl and tokenUrl
</summary>
<param name="options"></param>
<param name="value"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthUseBasicAuthenticationWithAccessCodeGrant(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Only activated for the accessCode flow. During the authorization_code request to the tokenUrl,
pass the Client Password using the HTTP Basic Authentication scheme (Authorization header with
Basic base64encoded[client_id:client_secret]). The default is false
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.OAuthUsePkce(ZhonTai.ApiUI.ApiUIOptions)">
<summary>
Only applies to authorizatonCode flows. Proof Key for Code Exchange brings enhanced security for OAuth public clients.
The default is false
</summary>
<param name="options"></param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.UseRequestInterceptor(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Function to intercept remote definition, "Try it out", and OAuth 2.0 requests.
</summary>
<param name="options"></param>
<param name="value">MUST be a valid Javascript function: (request: SwaggerRequest) => SwaggerRequest</param>
</member>
<member name="M:ZhonTai.ApiUI.ApiUIOptionsExtensions.UseResponseInterceptor(ZhonTai.ApiUI.ApiUIOptions,System.String)">
<summary>
Function to intercept remote definition, "Try it out", and OAuth 2.0 responses.
</summary>
<param name="options"></param>
<param name="value">MUST be a valid Javascript function: (response: SwaggerResponse ) => SwaggerResponse </param>
</member>
</members>
</doc>

@ -5,20 +5,26 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>ZhonTai.Common.xml</DocumentationFile>
<NoWarn>1701;1702;1591;8632</NoWarn>
<OutputPath></OutputPath>
</PropertyGroup>
<ItemGroup>
<None Include="../../../logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.0.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
</ItemGroup>
</Project>

@ -322,9 +322,7 @@
</member>
<member name="M:ZhonTai.Common.Helpers.DataMaskHelper.PhoneMaskRegex">
<remarks>
Pattern:<br/>
<code>(\\d{3})\\d{4}(\\d{4})</code><br/>
Explanation:<br/>
Pattern explanation:<br/>
<code>
○ 1st capture group.<br/>
○ Match a Unicode digit exactly 3 times.<br/>
@ -336,9 +334,7 @@
</member>
<member name="M:ZhonTai.Common.Helpers.DataMaskHelper.EmailMaskRegex">
<remarks>
Pattern:<br/>
<code>(?&lt;=.{2})[^@]+(?=.{2}@)</code><br/>
Explanation:<br/>
Pattern explanation:<br/>
<code>
○ Zero-width positive lookbehind.<br/>
○ Match a character other than '\n' exactly 2 times right-to-left.<br/>
@ -351,21 +347,19 @@
</member>
<member name="M:ZhonTai.Common.Helpers.DataMaskHelper.IPMaskRegex">
<remarks>
Pattern:<br/>
<code>([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})</code><br/>
Explanation:<br/>
Pattern explanation:<br/>
<code>
○ 1st capture group.<br/>
○ Match a character in the set [0-9] atomically at least 1 and at most 3 times.<br/>
○ Match '0' through '9' atomically at least 1 and at most 3 times.<br/>
○ Match '.'.<br/>
○ 2nd capture group.<br/>
○ Match a character in the set [0-9] atomically at least 1 and at most 3 times.<br/>
○ Match '0' through '9' atomically at least 1 and at most 3 times.<br/>
○ Match '.'.<br/>
○ 3rd capture group.<br/>
○ Match a character in the set [0-9] atomically at least 1 and at most 3 times.<br/>
○ Match '0' through '9' atomically at least 1 and at most 3 times.<br/>
○ Match '.'.<br/>
○ 4th capture group.<br/>
○ Match a character in the set [0-9] atomically at least 1 and at most 3 times.<br/>
○ Match '0' through '9' atomically at least 1 and at most 3 times.<br/>
</code>
</remarks>
</member>
@ -572,9 +566,7 @@
</member>
<member name="M:ZhonTai.Common.Helpers.PasswordHelper.RegexPassword">
<remarks>
Pattern:<br/>
<code>^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d!@#$%^&amp;.*]{6,16}$</code><br/>
Explanation:<br/>
Pattern explanation:<br/>
<code>
○ Match if at the beginning of the string.<br/>
○ Zero-width positive lookahead.<br/>
@ -816,14 +808,5 @@
<member name="F:System.Text.RegularExpressions.Generated.Utilities.s_hasTimeout">
<summary>Whether <see cref="F:System.Text.RegularExpressions.Generated.Utilities.s_defaultTimeout"/> is non-infinite.</summary>
</member>
<member name="M:System.Text.RegularExpressions.Generated.Utilities.IndexOfAnyDigit(System.ReadOnlySpan{System.Char})">
<summary>Finds the next index of any character that matches a Unicode digit.</summary>
</member>
<member name="F:System.Text.RegularExpressions.Generated.Utilities.s_asciiExceptDigits">
<summary>Supports searching for characters in or not in "\0\u0001\u0002\u0003\u0004\u0005\u0006\a\b\t\n\v\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&amp;'()*+,-./:;&lt;=&gt;?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f".</summary>
</member>
<member name="F:System.Text.RegularExpressions.Generated.Utilities.s_asciiLetters">
<summary>Supports searching for characters in or not in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".</summary>
</member>
</members>
</doc>

@ -4,10 +4,6 @@
<PackageTags>DynamicApi;WebApi;</PackageTags>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="../../../logo.png" Pack="true" PackagePath="\" />
</ItemGroup>

@ -0,0 +1,235 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>ZhonTai.DynamicApi</name>
</assembly>
<members>
<member name="T:ZhonTai.DynamicApi.AssemblyDynamicApiOptions">
<summary>
Specifies the dynamic webapi options for the assembly.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.AssemblyDynamicApiOptions.ApiPrefix">
<summary>
Routing prefix for all APIs
<para></para>
Default value is null.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.AssemblyDynamicApiOptions.HttpVerb">
<summary>
API HTTP Verb.
<para></para>
Default value is null.
</summary>
</member>
<member name="M:ZhonTai.DynamicApi.AssemblyDynamicApiOptions.#ctor(System.String,System.String)">
<summary>
</summary>
<param name="apiPrefix">Routing prefix for all APIs</param>
<param name="httpVerb">API HTTP Verb.</param>
</member>
<member name="P:ZhonTai.DynamicApi.Attributes.DynamicApiAttribute.Area">
<summary>
Equivalent to AreaName
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.Attributes.DynamicApiAttribute.GroupNames">
<summary>
分组名称列表
</summary>
</member>
<member name="T:ZhonTai.DynamicApi.Attributes.NonFormatResultAttribute">
<summary>
不格式化结果数据
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.Attributes.OrderAttribute.Value">
<summary>
排序值
</summary>
</member>
<member name="M:ZhonTai.DynamicApi.Attributes.OrderAttribute.#ctor(System.Int32)">
<summary>
排序设置
</summary>
<param name="value">排序值</param>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiConvention.CheckNoMapMethod(Microsoft.AspNetCore.Mvc.ApplicationModels.ActionModel)">
<summary>
//不映射指定的方法
</summary>
<param name="action"></param>
<returns></returns>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiConvention.CheckNoFormatResultMethod(Microsoft.AspNetCore.Mvc.ApplicationModels.ActionModel)">
<summary>
不格式化结果数据
</summary>
<param name="action"></param>
<returns></returns>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiConvention.GetRestFulActionName(System.String)">
<summary>
Processing action name
</summary>
<param name="actionName"></param>
<returns></returns>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.DefaultHttpVerb">
<summary>
API HTTP Verb.
<para></para>
Default value is "POST".
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.DefaultApiPrefix">
<summary>
Routing prefix for all APIs
<para></para>
Default value is "api".
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.RemoveControllerPostfixes">
<summary>
Remove the dynamic API class(Controller) name postfix.
<para></para>
Default value is {"AppService", "ApplicationService"}.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.RemoveActionPostfixes">
<summary>
Remove the dynamic API class's method(Action) postfix.
<para></para>
Default value is {"Async"}.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.FormBodyBindingIgnoredTypes">
<summary>
Ignore MVC Form Binding types.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.NamingConvention">
<summary>
Naming convention
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.GetRestFulActionName">
<summary>
The method that processing the name of the action.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.GetRestFulControllerName">
<summary>
The method that processing the name of the controller.
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.DynamicApiOptions.AssemblyDynamicApiOptions">
<summary>
Specifies the dynamic webapi options for the assembly.
</summary>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiOptions.Valid">
<summary>
Verify that all configurations are valid
</summary>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiOptions.AddAssemblyOptions(System.Reflection.Assembly,System.String,System.String)">
<summary>
Add the dynamic webapi options for the assembly.
</summary>
<param name="assembly"></param>
<param name="apiPreFix"></param>
<param name="httpVerb"></param>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiOptions.AddAssemblyOptions(System.Reflection.Assembly[],System.String,System.String)">
<summary>
Add the dynamic webapi options for the assemblies.
</summary>
<param name="assemblies"></param>
<param name="apiPreFix"></param>
<param name="httpVerb"></param>
</member>
<member name="T:ZhonTai.DynamicApi.DynamicApiServiceExtensions">
<summary>
Add Dynamic WebApi
</summary>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiServiceExtensions.UseDynamicApi(Microsoft.AspNetCore.Builder.IApplicationBuilder,System.Action{System.IServiceProvider,ZhonTai.DynamicApi.DynamicApiOptions})">
<summary>
Use Dynamic WebApi to Configure
</summary>
<param name="application"></param>
<param name="optionsAction"></param>
<returns></returns>
</member>
<member name="M:ZhonTai.DynamicApi.DynamicApiServiceExtensions.AddDynamicApi(Microsoft.Extensions.DependencyInjection.IServiceCollection,ZhonTai.DynamicApi.DynamicApiOptions)">
<summary>
Add Dynamic WebApi to Container
</summary>
<param name="services"></param>
<param name="options">configuration</param>
<returns></returns>
</member>
<member name="F:ZhonTai.DynamicApi.Enums.NamingConventionEnum.CamelCase">
<summary>
camelCase
</summary>
</member>
<member name="F:ZhonTai.DynamicApi.Enums.NamingConventionEnum.PascalCase">
<summary>
PascalCase
</summary>
</member>
<member name="F:ZhonTai.DynamicApi.Enums.NamingConventionEnum.SnakeCase">
<summary>
snake_case
</summary>
</member>
<member name="F:ZhonTai.DynamicApi.Enums.NamingConventionEnum.KebabCase">
<summary>
kebab-case
</summary>
</member>
<member name="F:ZhonTai.DynamicApi.Enums.NamingConventionEnum.ExtensionCase">
<summary>
extension.case
</summary>
</member>
<member name="F:ZhonTai.DynamicApi.Enums.NamingConventionEnum.Custom">
<summary>
Customize with GetRestFulControllerName and GetRestFulActionName method
</summary>
</member>
<member name="M:ZhonTai.DynamicApi.Helpers.ReflectionHelper.GetSingleAttributeOrNull``1(System.Reflection.MemberInfo,System.Boolean)">
<summary>
Gets a single attribute for a member.
</summary>
<typeparam name="TAttribute">Type of the attribute</typeparam>
<param name="memberInfo">The member that will be checked for the attribute</param>
<param name="inherit">Include inherited attributes</param>
<returns>Returns the attribute object if found. Returns null if not found.</returns>
</member>
<member name="P:ZhonTai.DynamicApi.ResponseResult`1.Success">
<summary>
是否成功标记
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.ResponseResult`1.Code">
<summary>
编码
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.ResponseResult`1.Msg">
<summary>
消息
</summary>
</member>
<member name="P:ZhonTai.DynamicApi.ResponseResult`1.Data">
<summary>
数据
</summary>
</member>
</members>
</doc>

@ -1,23 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>中台测试库</Description>
<TargetFramework>net8.0</TargetFramework>
<Description>中台测试库</Description>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="7.0.14" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="7.0.14" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\hosts\ZhonTai.Host\ZhonTai.Host.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\hosts\ZhonTai.Host\ZhonTai.Host.csproj" />
</ItemGroup>
</Project>
</Project>
Loading…
Cancel
Save