483 changed files with 2664 additions and 4593 deletions
@ -0,0 +1,13 @@ |
|||
<Project> |
|||
<PropertyGroup> |
|||
<IsTestProject Condition="$(MSBuildProjectFullPath.Contains('test')) and ($(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.TestBase')))">true</IsTestProject> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Condition="'$(IsTestProject)' == 'true'" Include="coverlet.collector"> |
|||
<PrivateAssets>all</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
|||
</PackageReference> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,256 @@ |
|||
<Project> |
|||
<PropertyGroup> |
|||
<DotNetCoreCAPPackageVersion>8.1.0</DotNetCoreCAPPackageVersion> |
|||
<ElsaPackageVersion>2.14.1</ElsaPackageVersion> |
|||
<VoloAbpPackageVersion>8.1.0</VoloAbpPackageVersion> |
|||
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion> |
|||
<MicrosoftAspNetCorePackageVersion>8.0.0</MicrosoftAspNetCorePackageVersion> |
|||
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion> |
|||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> |
|||
</PropertyGroup> |
|||
|
|||
<!-- Abp Framework --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="3.0.5" /> |
|||
<PackageVersion Include="Volo.Abp.Core" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.Web.IdentityServer" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Account.Web.OpenIddict" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Client.Common" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.NewtonsoftJson" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.Serilog" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.SignalR" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AspNetCore.TestBase" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Auditing" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Auditing.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AuditLogging.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Authorization" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Authorization.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Autofac" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.BackgroundJobs" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.BackgroundJobs.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.BackgroundWorkers" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.BlobStoring" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.BlobStoring.FileSystem" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Caching" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Caching.StackExchangeRedis" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Cli.Core" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Data" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Ddd.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Ddd.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Ddd.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Ddd.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.DistributedLocking.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.DistributedLocking" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.MySql" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.EntityFrameworkCore.SqlServer" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Features" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.FeatureManagement.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.FeatureManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.FeatureManagement.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.FeatureManagement.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.FeatureManagement.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Emailing" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.EventBus" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.EventBus.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.ExceptionHandling" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Guids" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.GlobalFeatures" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.HangFire" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Http.Client" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Http.Client.IdentityModel.Web" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.AspNetCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.IdentityServer.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.IdentityServer.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.IdentityServer.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.IdentityServer.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.IdentityServer.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.IdentityServer.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Identity.HttpApi.Client" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Imaging.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Imaging.ImageSharp" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Json" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Json.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Localization" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.MultiTenancy.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.ObjectExtending" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.AspNetCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.OpenIddict.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.PermissionManagement.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Quartz" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Security" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Settings" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.SettingManagement.Application" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.SettingManagement.Application.Contracts" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.SettingManagement.Domain" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.SettingManagement.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.SettingManagement.HttpApi" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Swashbuckle" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Sms" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.TestBase" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.TextTemplating.Core" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.TextTemplating.Scriban" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Users.Abstractions" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Users.Domain.Shared" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageVersion Include="Volo.Abp.Validation" Version="$(VoloAbpPackageVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- .NET --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" /> |
|||
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" /> |
|||
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
<PackageVersion Include="Microsoft.Extensions.Options" Version="$(MicrosoftExtensionsPackageVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- Elsa --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="Elsa" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Activities.Email" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Activities.Http" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Activities.UserTask" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Activities.Temporal.Quartz" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Core" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Designer.Components.Web" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Rebus.RabbitMq" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Server.Api" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Webhooks.Api" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.Core" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.Webhooks.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" /> |
|||
<PackageVersion Include="Elsa.WorkflowSettings.Persistence.EntityFramework.MySql" Version="$(ElsaPackageVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- DotNetCore.CAP --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="DotNetCore.CAP" Version="$(DotNetCoreCAPPackageVersion)" /> |
|||
<PackageVersion Include="DotNetCore.CAP.Dashboard" Version="$(DotNetCoreCAPPackageVersion)" /> |
|||
<PackageVersion Include="DotNetCore.CAP.MySql" Version="$(DotNetCoreCAPPackageVersion)" /> |
|||
<PackageVersion Include="DotNetCore.CAP.OpenTelemetry" Version="$(DotNetCoreCAPPackageVersion)" /> |
|||
<PackageVersion Include="DotNetCore.CAP.RabbitMQ" Version="$(DotNetCoreCAPPackageVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- Serilog --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="Serilog" Version="3.1.1" /> |
|||
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.0" /> |
|||
<PackageVersion Include="Serilog.Enrichers.Environment" Version="2.3.0" /> |
|||
<PackageVersion Include="Serilog.Enrichers.Assembly" Version="2.0.0" /> |
|||
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" /> |
|||
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" /> |
|||
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" /> |
|||
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" /> |
|||
<PackageVersion Include="Serilog.Settings.Configuration" Version="8.0.0" /> |
|||
<PackageVersion Include="Serilog.Sinks.Async" Version="1.5.0" /> |
|||
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.0" /> |
|||
<PackageVersion Include="Serilog.Sinks.Elasticsearch" Version="9.0.3" /> |
|||
<PackageVersion Include="Serilog.Sinks.File" Version="5.0.0" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- Test --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="coverlet.collector" Version="6.0.0" /> |
|||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> |
|||
<PackageVersion Include="Moq.AutoMock" Version="3.0.0" /> |
|||
<PackageVersion Include="NSubstitute" Version="5.1.0" /> |
|||
<PackageVersion Include="Shouldly" Version="4.2.1" /> |
|||
<PackageVersion Include="xunit" Version="2.6.1" /> |
|||
<PackageVersion Include="xunit.extensibility.execution" Version="2.6.1" /> |
|||
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- Fody --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="ConfigureAwait.Fody" Version="3.3.2" /> |
|||
<PackageVersion Include="Fody" Version="6.8.0" /> |
|||
</ItemGroup> |
|||
|
|||
<!-- Other --> |
|||
<ItemGroup> |
|||
<PackageVersion Include="aliyun-net-sdk-core" Version="1.5.10" /> |
|||
<PackageVersion Include="Aliyun.OSS.SDK.NetCore" Version="2.13.0" /> |
|||
<PackageVersion Include="AgileConfig.Client" Version="1.6.9" /> |
|||
<PackageVersion Include="Dapr.Client" Version="1.12.0" /> |
|||
<PackageVersion Include="Dapr.Actors" Version="1.12.0" /> |
|||
<PackageVersion Include="Dapr.Actors.AspNetCore" Version="1.12.0" /> |
|||
<PackageVersion Include="DistributedLock.Core" Version="1.0.5" /> |
|||
<PackageVersion Include="DistributedLock.Redis" Version="1.0.2" /> |
|||
<PackageVersion Include="Hangfire.MySqlStorage" Version="2.0.3" /> |
|||
<PackageVersion Include="HangFire.SqlServer" Version="1.8.6" /> |
|||
<PackageVersion Include="IdentityModel" Version="6.2.0" /> |
|||
<PackageVersion Include="JetBrains.Annotations" Version="2022.1.0" /> |
|||
<PackageVersion Include="Markdig" Version="0.34.0" /> |
|||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> |
|||
<PackageVersion Include="NEST" Version="7.15.1" /> |
|||
<PackageVersion Include="NRules" Version="0.9.2" /> |
|||
<PackageVersion Include="Ocelot.Provider.Polly" Version="20.0.0" /> |
|||
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" /> |
|||
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.8.0" /> |
|||
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.1" /> |
|||
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.8.1" /> |
|||
<PackageVersion Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.11" /> |
|||
<PackageVersion Include="Polly" Version="8.2.0" /> |
|||
<PackageVersion Include="Quartz.Serialization.Json" Version="3.7.0" /> |
|||
<PackageVersion Include="RulesEngine" Version="4.0.0" /> |
|||
<PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" /> |
|||
<PackageVersion Include="SixLabors.ImageSharp" Version="3.0.2" /> |
|||
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" /> |
|||
<PackageVersion Include="StackExchange.Redis" Version="2.7.4" /> |
|||
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" /> |
|||
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" /> |
|||
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.37" /> |
|||
<PackageVersion Include="TencentCloudSDK" Version="3.0.712" /> |
|||
<PackageVersion Include="Yarp.ReverseProxy" Version="1.1.1" /> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<packageSources> |
|||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> |
|||
</packageSources> |
|||
</configuration> |
|||
@ -1,50 +0,0 @@ |
|||
<Project> |
|||
<PropertyGroup> |
|||
<VoloAbpPackageVersion>8.1.0</VoloAbpPackageVersion> |
|||
<VoloAbpLeptonXThemePackageVersion>3.0.5</VoloAbpLeptonXThemePackageVersion> |
|||
<LINGYUNAbpPackageVersion>8.1.0</LINGYUNAbpPackageVersion> |
|||
<DaprPackageVersion>1.12.0</DaprPackageVersion> |
|||
<DistributedLockRedisPackageVersion>1.0.2</DistributedLockRedisPackageVersion> |
|||
<DotNetCoreCAPPackageVersion>8.1.0</DotNetCoreCAPPackageVersion> |
|||
<ElsaPackageVersion>2.14.1</ElsaPackageVersion> |
|||
<AliyunSDKPackageVersion>1.5.10</AliyunSDKPackageVersion> |
|||
<AliyunOSSSDKPackageVersion>2.13.0</AliyunOSSSDKPackageVersion> |
|||
<TencentCloudSDKPackageVersion>3.0.712</TencentCloudSDKPackageVersion> |
|||
<AgileConfigClientPackageVersion>1.6.9</AgileConfigClientPackageVersion> |
|||
<HangfireMySqlStoragePackageVersion>2.0.3</HangfireMySqlStoragePackageVersion> |
|||
<HangfireMSSQLStoragePackageVersion>1.8.6</HangfireMSSQLStoragePackageVersion> |
|||
<IdentityModelPackageVersion>6.2.0</IdentityModelPackageVersion> |
|||
<NESTPackageVersion>7.15.1</NESTPackageVersion> |
|||
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion> |
|||
<OpenTelemetryExtensionsHostingPackageVersion>1.8.0</OpenTelemetryExtensionsHostingPackageVersion> |
|||
<OpenTelemetryExporterZipkinPackageVersion>1.8.0</OpenTelemetryExporterZipkinPackageVersion> |
|||
<OpenTelemetryInstrumentationAspNetCorePackageVersion>1.8.1</OpenTelemetryInstrumentationAspNetCorePackageVersion> |
|||
<OpenTelemetryInstrumentationHttpPackageVersion>1.8.1</OpenTelemetryInstrumentationHttpPackageVersion> |
|||
<OpenTelemetryInstrumentationEntityFrameworkCorePackageVersion>1.0.0-beta.11</OpenTelemetryInstrumentationEntityFrameworkCorePackageVersion> |
|||
<QuartzNETPackageVersion>3.7.0</QuartzNETPackageVersion> |
|||
<StackExchangeRedisPackageVersion>2.7.4</StackExchangeRedisPackageVersion> |
|||
<SerilogPackageVersion>3.1.1</SerilogPackageVersion> |
|||
<SerilogAspNetCorePackageVersion>8.0.0</SerilogAspNetCorePackageVersion> |
|||
<SerilogEnrichersEnvironmentPackageVersion>2.3.0</SerilogEnrichersEnvironmentPackageVersion> |
|||
<SerilogEnrichersAssemblyPackageVersion>2.0.0</SerilogEnrichersAssemblyPackageVersion> |
|||
<SerilogEnrichersProcessPackageVersion>2.0.2</SerilogEnrichersProcessPackageVersion> |
|||
<SerilogEnrichersThreadPackageVersion>3.1.0</SerilogEnrichersThreadPackageVersion> |
|||
<SerilogExtensionsLoggingPackageVersion>8.0.0</SerilogExtensionsLoggingPackageVersion> |
|||
<SerilogSettingsConfigurationPackageVersion>8.0.0</SerilogSettingsConfigurationPackageVersion> |
|||
<SerilogSinksConsolePackageVersion>5.0.0</SerilogSinksConsolePackageVersion> |
|||
<SerilogSinksElasticsearchPackageVersion>9.0.3</SerilogSinksElasticsearchPackageVersion> |
|||
<SerilogSinksFilePackageVersion>5.0.0</SerilogSinksFilePackageVersion> |
|||
<SixLaborsImageSharpDrawingPackageVersion>2.0.1</SixLaborsImageSharpDrawingPackageVersion> |
|||
<SwashbuckleAspNetCorePackageVersion>6.5.0</SwashbuckleAspNetCorePackageVersion> |
|||
<PollyPackageVersion>8.2.0</PollyPackageVersion> |
|||
<MarkdigPackageVersion>0.34.0</MarkdigPackageVersion> |
|||
<MicrosoftPackageVersion>8.0.*</MicrosoftPackageVersion> |
|||
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion> |
|||
<XunitPackageVersion>2.6.1</XunitPackageVersion> |
|||
<XunitRunnerPackageVersion>2.5.5</XunitRunnerPackageVersion> |
|||
<ShouldlyPackageVersion>4.2.1</ShouldlyPackageVersion> |
|||
<NSubstitutePackageVersion>5.1.0</NSubstitutePackageVersion> |
|||
<MicrosoftNETTestSdkPackageVersion>17.8.0</MicrosoftNETTestSdkPackageVersion> |
|||
<CoverletCollectorPackageVersion>3.0.2</CoverletCollectorPackageVersion> |
|||
</PropertyGroup> |
|||
</Project> |
|||
@ -1,38 +0,0 @@ |
|||
<Project> |
|||
<PropertyGroup> |
|||
<LangVersion>latest</LangVersion> |
|||
<Version>8.1.0</Version> |
|||
<Authors>colin</Authors> |
|||
<NoWarn>$(NoWarn);CS1591;CS0436;CS8618;NU1803</NoWarn> |
|||
<PackageProjectUrl>https://github.com/colinin/abp-next-admin</PackageProjectUrl> |
|||
<PackageOutputPath>$(SolutionDir)LocalNuget</PackageOutputPath> |
|||
<PackageVersion>8.1.0</PackageVersion> |
|||
<PackageLicenseExpression>MIT</PackageLicenseExpression> |
|||
<RepositoryType>git</RepositoryType> |
|||
<RepositoryUrl>https://github.com/colinin/abp-next-admin</RepositoryUrl> |
|||
<GeneratePackageOnBuild Condition="$(AssemblyName.StartsWith('LINGYUN'))">true</GeneratePackageOnBuild> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="LocalNuget\**" /> |
|||
<EmbeddedResource Remove="LocalNuget\**" /> |
|||
<None Remove="LocalNuget\**" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Modules\**" /> |
|||
<EmbeddedResource Remove="Modules\**" /> |
|||
<None Remove="Modules\**" /> |
|||
</ItemGroup> |
|||
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
|||
<OutputPath>$(SolutionDir)LocalNuget</OutputPath> |
|||
</PropertyGroup> |
|||
|
|||
</Project> |
|||
@ -1,9 +0,0 @@ |
|||
<Project> |
|||
<ItemGroup> |
|||
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.2" PrivateAssets="All" /> |
|||
<PackageReference Include="Fody" Version="6.8.0"> |
|||
<PrivateAssets>All</PrivateAssets> |
|||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> |
|||
</PackageReference> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -1,15 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
</PropertyGroup> |
|||
<Import Project="..\..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Sms" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageReference Include="Volo.Abp.Sms" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\LINGYUN.Abp.Tencent\LINGYUN.Abp.Tencent.csproj" /> |
|||
<ProjectReference Include="..\LINGYUN.Abp.Tencent\LINGYUN.Abp.Tencent.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
|
|||
@ -1,3 +0,0 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -1,20 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> |
|||
<Version>3.1.0</Version> |
|||
<Authors>LINGYUN</Authors> |
|||
</PropertyGroup> |
|||
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> |
|||
<OutputPath>D:\LocalNuget</OutputPath> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Caching" Version="4.4.0" /> |
|||
<PackageReference Include="Volo.Abp.IdentityModel" Version="4.4.0" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -1,13 +0,0 @@ |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.IdentityModel; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.IdentityModel |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpIdentityModelModule), |
|||
typeof(AbpCachingModule))] |
|||
public class AbpCachedIdentityModelModule : AbpModule |
|||
{ |
|||
} |
|||
} |
|||
@ -1,27 +0,0 @@ |
|||
using System; |
|||
|
|||
namespace LINGYUN.Abp.IdentityModel |
|||
{ |
|||
public class IdentityModelAuthenticationCacheItem |
|||
{ |
|||
public string AccessToken { get; set; } |
|||
public IdentityModelAuthenticationCacheItem() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public IdentityModelAuthenticationCacheItem(string accessToken) |
|||
{ |
|||
AccessToken = accessToken; |
|||
} |
|||
|
|||
public static string CalculateCacheKey(string grantType, string clientId, string userName = null) |
|||
{ |
|||
if (userName.IsNullOrWhiteSpace()) |
|||
{ |
|||
return "gt:" + grantType + ",ci:" + clientId; |
|||
} |
|||
return "gt:" + grantType + ",ci:" + clientId + ",un:" + userName; |
|||
} |
|||
} |
|||
} |
|||
@ -1,102 +0,0 @@ |
|||
using IdentityModel.Client; |
|||
using Microsoft.Extensions.Caching.Distributed; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Microsoft.Extensions.Options; |
|||
using System; |
|||
using System.Net.Http; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Caching; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.IdentityModel; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Security.Encryption; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace LINGYUN.Abp.IdentityModel |
|||
{ |
|||
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] |
|||
[ExposeServices( |
|||
typeof(IIdentityModelAuthenticationService), |
|||
typeof(IdentityModelAuthenticationService))] |
|||
public class IdentityModelCachedAuthenticationService : IdentityModelAuthenticationService |
|||
{ |
|||
protected IDistributedCache<IdentityModelAuthenticationCacheItem> Cache { get; } |
|||
public IdentityModelCachedAuthenticationService( |
|||
IOptions<AbpIdentityClientOptions> options, |
|||
ICancellationTokenProvider cancellationTokenProvider, |
|||
IHttpClientFactory httpClientFactory, |
|||
ICurrentTenant currentTenant, |
|||
IDistributedCache<IdentityModelAuthenticationCacheItem> cache, |
|||
IOptions<IdentityModelHttpRequestMessageOptions> identityModelHttpRequestMessageOptions) |
|||
: base(options, cancellationTokenProvider, httpClientFactory, currentTenant, identityModelHttpRequestMessageOptions) |
|||
{ |
|||
Cache = cache; |
|||
} |
|||
|
|||
public override async Task<string> GetAccessTokenAsync(IdentityClientConfiguration configuration) |
|||
{ |
|||
var accessTokenCacheItem = await GetCacheItemAsync(configuration); |
|||
// 需要解密
|
|||
return accessTokenCacheItem.AccessToken; |
|||
} |
|||
|
|||
protected async virtual Task<IdentityModelAuthenticationCacheItem> GetCacheItemAsync(IdentityClientConfiguration configuration) |
|||
{ |
|||
var cacheKey = IdentityModelAuthenticationCacheItem.CalculateCacheKey(configuration.GrantType, configuration.ClientId, configuration.UserName); |
|||
|
|||
Logger.LogDebug($"IdentityModelCachedAuthenticationService.GetCacheItemAsync: {cacheKey}"); |
|||
|
|||
var cacheItem = await Cache.GetAsync(cacheKey); |
|||
|
|||
if (cacheItem != null) |
|||
{ |
|||
Logger.LogDebug($"Found in the cache: {cacheKey}"); |
|||
return cacheItem; |
|||
} |
|||
|
|||
Logger.LogDebug($"Not found in the cache: {cacheKey}"); |
|||
|
|||
var tokenResponse = await GetAccessTokenResponseAsync(configuration); |
|||
cacheItem = new IdentityModelAuthenticationCacheItem(tokenResponse.AccessToken); |
|||
var cacheEntryOptions = new DistributedCacheEntryOptions |
|||
{ |
|||
// 缓存前两分钟过期
|
|||
AbsoluteExpiration = DateTimeOffset.Now.AddSeconds(tokenResponse.ExpiresIn - 120) |
|||
}; |
|||
|
|||
Logger.LogDebug($"Setting the cache item: {cacheKey}"); |
|||
await Cache.SetAsync(cacheKey, cacheItem, cacheEntryOptions); |
|||
|
|||
Logger.LogDebug($"Finished setting the cache item: {cacheKey}"); |
|||
|
|||
return cacheItem; |
|||
} |
|||
|
|||
protected async virtual Task<TokenResponse> GetAccessTokenResponseAsync(IdentityClientConfiguration configuration) |
|||
{ |
|||
var discoveryResponse = await GetDiscoveryResponse(configuration); |
|||
if (discoveryResponse.IsError) |
|||
{ |
|||
throw new AbpException($"Could not retrieve the OpenId Connect discovery document! ErrorType: {discoveryResponse.ErrorType}. Error: {discoveryResponse.Error}"); |
|||
} |
|||
|
|||
var tokenResponse = await GetTokenResponse(discoveryResponse, configuration); |
|||
|
|||
if (tokenResponse.IsError) |
|||
{ |
|||
if (tokenResponse.ErrorDescription != null) |
|||
{ |
|||
throw new AbpException($"Could not get token from the OpenId Connect server! ErrorType: {tokenResponse.ErrorType}. Error: {tokenResponse.Error}. ErrorDescription: {tokenResponse.ErrorDescription}. HttpStatusCode: {tokenResponse.HttpStatusCode}"); |
|||
} |
|||
|
|||
var rawError = tokenResponse.Raw; |
|||
var withoutInnerException = rawError.Split(new string[] { "<eof/>" }, StringSplitOptions.RemoveEmptyEntries); |
|||
throw new AbpException(withoutInnerException[0]); |
|||
} |
|||
|
|||
return tokenResponse; |
|||
} |
|||
} |
|||
} |
|||
@ -1,19 +0,0 @@ |
|||
# LINGYUN.Abp.IdentityModel |
|||
|
|||
abp框架 **IIdentityModelAuthenticationService**接口缓存版本 |
|||
|
|||
因官方**Volo.Abp.IdentityModel**模块没有对接口授权缓存,每次内部调用都会请求IDS服务器,会加重IDS服务器压力, |
|||
创建使用缓存的接口实现 |
|||
|
|||
## 配置使用 |
|||
|
|||
模块按需引用,需要配置**Volo.Abp.IdentityModel**模块所需配置项 |
|||
|
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpCachedIdentityModelModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
} |
|||
``` |
|||
@ -1,3 +0,0 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -1,16 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.EventBus" Version="$(VoloAbpPackageVersion)" /> |
|||
<PackageReference Include="Volo.Abp.Localization" Version="$(VoloAbpPackageVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -1,18 +0,0 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.EventBus; |
|||
using Volo.Abp.Localization; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpEventBusModule), |
|||
typeof(AbpLocalizationModule))] |
|||
public class AbpLocalizationDynamicModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddHostedService<DynamicLocalizationInitializeService>(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class AbpLocalizationDynamicOptions |
|||
{ |
|||
internal LocalizationDictionary LocalizationDictionary { get; } |
|||
|
|||
public AbpLocalizationDynamicOptions() |
|||
{ |
|||
LocalizationDictionary = new LocalizationDictionary(); |
|||
} |
|||
|
|||
internal void AddOrUpdate(string resourceName, Dictionary<string, ILocalizationDictionary> dictionares) |
|||
{ |
|||
var _dictionares = LocalizationDictionary |
|||
.GetOrAdd(resourceName, () => new Dictionary<string, ILocalizationDictionary>()); |
|||
_dictionares.AddIfNotContains(dictionares); |
|||
} |
|||
} |
|||
} |
|||
@ -1,35 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class DefaultLocalizationStore : ILocalizationStore, ITransientDependency |
|||
{ |
|||
public DefaultLocalizationStore() |
|||
{ |
|||
} |
|||
|
|||
public Task<Dictionary<string, Dictionary<string, ILocalizationDictionary>>> GetAllLocalizationDictionaryAsync(CancellationToken cancellationToken = default) |
|||
{ |
|||
return Task.FromResult(new Dictionary<string, Dictionary<string, ILocalizationDictionary>>()); |
|||
} |
|||
|
|||
public Task<List<LanguageInfo>> GetLanguageListAsync(CancellationToken cancellationToken = default) |
|||
{ |
|||
return Task.FromResult(new List<LanguageInfo>()); |
|||
} |
|||
|
|||
public Task<Dictionary<string, ILocalizationDictionary>> GetLocalizationDictionaryAsync(string resourceName, CancellationToken cancellationToken = default) |
|||
{ |
|||
return Task.FromResult(new Dictionary<string, ILocalizationDictionary>()); |
|||
} |
|||
|
|||
public Task<bool> ResourceExistsAsync(string resourceName, CancellationToken cancellationToken = default) |
|||
{ |
|||
return Task.FromResult(false); |
|||
} |
|||
} |
|||
} |
|||
@ -1,42 +0,0 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Options; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
[Dependency(ServiceLifetime.Transient, ReplaceServices = true)] |
|||
[ExposeServices( |
|||
typeof(ILanguageProvider), |
|||
typeof(DynamicLanguageProvider))] |
|||
public class DynamicLanguageProvider : ILanguageProvider |
|||
{ |
|||
protected ILocalizationStore Store { get; } |
|||
protected AbpLocalizationOptions Options { get; } |
|||
|
|||
public DynamicLanguageProvider( |
|||
ILocalizationStore store, |
|||
IOptions<AbpLocalizationOptions> options) |
|||
{ |
|||
Store = store; |
|||
Options = options.Value; |
|||
} |
|||
|
|||
public async virtual Task<IReadOnlyList<LanguageInfo>> GetLanguagesAsync() |
|||
{ |
|||
var languages = await Store.GetLanguageListAsync(); |
|||
|
|||
if (!languages.Any()) |
|||
{ |
|||
return Options.Languages; |
|||
} |
|||
|
|||
return languages |
|||
.Distinct(new LanguageInfoComparer()) |
|||
.ToList(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,49 +0,0 @@ |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Options; |
|||
using System; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class DynamicLocalizationInitializeService : BackgroundService |
|||
{ |
|||
protected ILocalizationStore Store { get; } |
|||
protected AbpLocalizationOptions LocalizationOptions { get; } |
|||
protected AbpLocalizationDynamicOptions DynamicOptions { get; } |
|||
|
|||
public DynamicLocalizationInitializeService( |
|||
ILocalizationStore store, |
|||
IOptions<AbpLocalizationOptions> localizationOptions, |
|||
IOptions<AbpLocalizationDynamicOptions> dynamicOptions) |
|||
{ |
|||
Store = store; |
|||
DynamicOptions = dynamicOptions.Value; |
|||
LocalizationOptions = localizationOptions.Value; |
|||
} |
|||
|
|||
protected async override Task ExecuteAsync(CancellationToken stoppingToken) |
|||
{ |
|||
try |
|||
{ |
|||
var resourceTexts = await Store.GetAllLocalizationDictionaryAsync(stoppingToken); |
|||
|
|||
foreach (var resource in LocalizationOptions.Resources) |
|||
{ |
|||
foreach (var contributor in resource.Value.Contributors) |
|||
{ |
|||
if (contributor.GetType().IsAssignableFrom(typeof(DynamicLocalizationResourceContributor))) |
|||
{ |
|||
if (resourceTexts.TryGetValue(resource.Value.ResourceName, out var resourceLocalizationDic)) |
|||
{ |
|||
DynamicOptions.AddOrUpdate(resource.Value.ResourceName, resourceLocalizationDic); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
catch (OperationCanceledException) { } // 忽略此异常
|
|||
} |
|||
} |
|||
} |
|||
@ -1,41 +0,0 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Localization; |
|||
using Microsoft.Extensions.Options; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class DynamicLocalizationResourceContributor : ILocalizationResourceContributor |
|||
{ |
|||
private readonly string _resourceName; |
|||
|
|||
private AbpLocalizationDynamicOptions _options; |
|||
|
|||
public DynamicLocalizationResourceContributor(string resourceName) |
|||
{ |
|||
_resourceName = resourceName; |
|||
} |
|||
|
|||
public virtual void Initialize(LocalizationResourceInitializationContext context) |
|||
{ |
|||
_options = context.ServiceProvider.GetService<IOptions<AbpLocalizationDynamicOptions>>().Value; |
|||
} |
|||
|
|||
public virtual void Fill(string cultureName, Dictionary<string, LocalizedString> dictionary) |
|||
{ |
|||
GetDictionaries().GetOrDefault(cultureName)?.Fill(dictionary); |
|||
} |
|||
|
|||
public virtual LocalizedString GetOrNull(string cultureName, string name) |
|||
{ |
|||
return GetDictionaries().GetOrDefault(cultureName)?.GetOrNull(name); |
|||
} |
|||
|
|||
protected virtual Dictionary<string, ILocalizationDictionary> GetDictionaries() |
|||
{ |
|||
return _options.LocalizationDictionary |
|||
.GetOrAdd(_resourceName, () => new Dictionary<string, ILocalizationDictionary>()); |
|||
} |
|||
} |
|||
} |
|||
@ -1,42 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public interface ILocalizationStore |
|||
{ |
|||
/// <summary>
|
|||
/// 获取语言列表
|
|||
/// </summary>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
Task<List<LanguageInfo>> GetLanguageListAsync( |
|||
CancellationToken cancellationToken = default); |
|||
/// <summary>
|
|||
/// 资源是否存在
|
|||
/// </summary>
|
|||
/// <param name="resourceName">资源名称</param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
Task<bool> ResourceExistsAsync( |
|||
string resourceName, |
|||
CancellationToken cancellationToken = default); |
|||
/// <summary>
|
|||
/// 获取当前资源下的本地化字典
|
|||
/// </summary>
|
|||
/// <param name="resourceName">资源名称</param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
Task<Dictionary<string, ILocalizationDictionary>> GetLocalizationDictionaryAsync( |
|||
string resourceName, |
|||
CancellationToken cancellationToken = default); |
|||
/// <summary>
|
|||
/// 获取所有资源本地化字典
|
|||
/// </summary>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
Task<Dictionary<string, Dictionary<string, ILocalizationDictionary>>> GetAllLocalizationDictionaryAsync(CancellationToken cancellationToken = default); |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class LanguageInfoComparer : IEqualityComparer<LanguageInfo> |
|||
{ |
|||
public bool Equals(LanguageInfo x, LanguageInfo y) |
|||
{ |
|||
if (x == null || y == null) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return x.CultureName.Equals(y.CultureName); |
|||
} |
|||
|
|||
public int GetHashCode(LanguageInfo obj) |
|||
{ |
|||
return obj?.CultureName.GetHashCode() ?? GetHashCode(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,51 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class LocalizationCacheItem |
|||
{ |
|||
public string Resource { get; set; } |
|||
public string Culture { get; set; } |
|||
public List<LocalizationText> Texts { get; set; } |
|||
public LocalizationCacheItem() |
|||
{ |
|||
Texts = new List<LocalizationText>(); |
|||
} |
|||
|
|||
public LocalizationCacheItem( |
|||
string resource, |
|||
string culture, |
|||
List<LocalizationText> texts) |
|||
{ |
|||
Resource = resource; |
|||
Culture = culture; |
|||
Texts = texts; |
|||
} |
|||
|
|||
public static string NormalizeKey( |
|||
string resource, |
|||
string culture) |
|||
{ |
|||
return $"p:Localization,r:{resource},c:{culture}"; |
|||
} |
|||
} |
|||
|
|||
public class LocalizationText |
|||
{ |
|||
public string Key { get; set; } |
|||
public string Value { get; set; } |
|||
public LocalizationText() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public LocalizationText( |
|||
string key, |
|||
string value) |
|||
{ |
|||
Key = key; |
|||
Value = value; |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class LocalizationDictionary : Dictionary<string, Dictionary<string, ILocalizationDictionary>> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -1,72 +0,0 @@ |
|||
using Microsoft.Extensions.Localization; |
|||
using Microsoft.Extensions.Options; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
internal class LocalizationResetSynchronizer : |
|||
IDistributedEventHandler<LocalizedStringCacheResetEventData>, |
|||
ITransientDependency |
|||
{ |
|||
private readonly AbpLocalizationDynamicOptions _options; |
|||
|
|||
public LocalizationResetSynchronizer( |
|||
IOptions<AbpLocalizationDynamicOptions> options) |
|||
{ |
|||
_options = options.Value; |
|||
} |
|||
public virtual Task HandleEventAsync(LocalizedStringCacheResetEventData eventData) |
|||
{ |
|||
var dictionaries = GetDictionaries(eventData.ResourceName); |
|||
if (!dictionaries.ContainsKey(eventData.CultureName)) |
|||
{ |
|||
// TODO: 需要处理 data.Key data.Value 空引用
|
|||
var dictionary = new Dictionary<string, LocalizedString>(); |
|||
dictionary.Add(eventData.Key, new LocalizedString(eventData.Key, eventData.Value.NormalizeLineEndings())); |
|||
var newLocalizationDictionary = new StaticLocalizationDictionary(eventData.CultureName, dictionary); |
|||
|
|||
dictionaries.Add(eventData.CultureName, newLocalizationDictionary); |
|||
} |
|||
else |
|||
{ |
|||
// 取出当前的缓存写入到新字典进行处理
|
|||
var nowLocalizationDictionary = dictionaries[eventData.CultureName]; |
|||
var dictionary = new Dictionary<string, LocalizedString>(); |
|||
nowLocalizationDictionary.Fill(dictionary); |
|||
|
|||
var existsKey = dictionary.ContainsKey(eventData.Key); |
|||
if (!existsKey) |
|||
{ |
|||
// 如果不存在,则新增
|
|||
dictionary.Add(eventData.Key, new LocalizedString(eventData.Key, eventData.Value.NormalizeLineEndings())); |
|||
} |
|||
else if (existsKey && eventData.IsDeleted) |
|||
{ |
|||
// 如果删掉了本地化的节点,删掉当前的缓存
|
|||
dictionary.Remove(eventData.Key); |
|||
} |
|||
|
|||
var newLocalizationDictionary = new StaticLocalizationDictionary(eventData.CultureName, dictionary); |
|||
|
|||
if (newLocalizationDictionary != null) |
|||
{ |
|||
// 重新赋值变更过的缓存
|
|||
dictionaries[eventData.CultureName] = newLocalizationDictionary; |
|||
} |
|||
} |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
protected virtual Dictionary<string, ILocalizationDictionary> GetDictionaries(string resourceName) |
|||
{ |
|||
return _options.LocalizationDictionary |
|||
.GetOrAdd(resourceName, () => new Dictionary<string, ILocalizationDictionary>()); |
|||
} |
|||
} |
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
namespace LINGYUN.Abp.Localization.Dynamic |
|||
{ |
|||
public class LocalizedStringCacheResetEventData |
|||
{ |
|||
public bool IsDeleted { get; set; } |
|||
public string ResourceName { get; set; } |
|||
public string CultureName { get; set; } |
|||
public string Key { get; set; } |
|||
public string Value { get; set; } |
|||
public LocalizedStringCacheResetEventData() |
|||
{ |
|||
|
|||
} |
|||
|
|||
public LocalizedStringCacheResetEventData( |
|||
string resourceName, |
|||
string cultureName, |
|||
string key, |
|||
string value) |
|||
{ |
|||
ResourceName = resourceName; |
|||
CultureName = cultureName; |
|||
Key = key; |
|||
Value = value; |
|||
|
|||
IsDeleted = false; |
|||
} |
|||
} |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
# LINGYUN.Abp.Localization.Dynamic |
|||
|
|||
动态本地化提供者组件,添加动态提供者可实现运行时替换本地化文本 |
|||
|
|||
需要实现 ILocalizationStore 接口 |
|||
|
|||
LocalizationManagement项目提供支持 |
|||
|
|||
## 配置使用 |
|||
|
|||
```csharp |
|||
[DependsOn(typeof(AbpLocalizationDynamicModule))] |
|||
public class YouProjectModule : AbpModule |
|||
{ |
|||
// other |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Get<YouProjectResource>() |
|||
.AddDynamic(); // 添加动态本地化文档支持 |
|||
|
|||
// 添加所有资源的动态文档支持,将监听所有的资源包文档变更事件 |
|||
// options.Resources.AddDynamic(); |
|||
|
|||
// 添加所有资源的动态文档支持,忽略 IdentityResource 资源 |
|||
// options.Resources.AddDynamic(typeof(IdentityResource)); |
|||
}); |
|||
} |
|||
} |
|||
``` |
|||
|
|||
## 注意事项 |
|||
|
|||
动态资源在启动时加载,如果通过LocalizationManagement模块查询,可能受后端存储资源体量影响整体启动时间 |
|||
|
|||
详情见: [DynamicLocalizationInitializeService](./LINGYUN/Abp/Localization/Dynamic/DynamicLocalizationInitializeService.cs#L25-L38) |
|||
@ -1,42 +0,0 @@ |
|||
using LINGYUN.Abp.Localization.Dynamic; |
|||
using System; |
|||
using System.Linq; |
|||
|
|||
namespace Volo.Abp.Localization |
|||
{ |
|||
public static class LocalizationResourceDictionaryExtensions |
|||
{ |
|||
public static LocalizationResourceDictionary AddDynamic( |
|||
this LocalizationResourceDictionary resources, |
|||
params Type[] ignoreResourceTypes) |
|||
{ |
|||
foreach (var resource in resources) |
|||
{ |
|||
if (ShouldIgnoreType(resource.Key, ignoreResourceTypes)) |
|||
{ |
|||
continue; |
|||
} |
|||
if (ShouldIgnoreType(resource.Value)) |
|||
{ |
|||
continue; |
|||
} |
|||
resource.Value.AddDynamic(); |
|||
} |
|||
return resources; |
|||
} |
|||
|
|||
private static bool ShouldIgnoreType(Type resourceType, params Type[] ignoreResourceTypes) |
|||
{ |
|||
if (ignoreResourceTypes == null) |
|||
{ |
|||
return false; |
|||
} |
|||
return ignoreResourceTypes.Any(x => x == resourceType); |
|||
} |
|||
|
|||
private static bool ShouldIgnoreType(LocalizationResource resource) |
|||
{ |
|||
return resource.Contributors.Exists(x => x is DynamicLocalizationResourceContributor); |
|||
} |
|||
} |
|||
} |
|||
@ -1,20 +0,0 @@ |
|||
using JetBrains.Annotations; |
|||
using LINGYUN.Abp.Localization.Dynamic; |
|||
|
|||
namespace Volo.Abp.Localization |
|||
{ |
|||
public static class DynamicLocalizationResourceExtensions |
|||
{ |
|||
public static LocalizationResource AddDynamic( |
|||
[NotNull] this LocalizationResource localizationResource) |
|||
{ |
|||
Check.NotNull(localizationResource, nameof(localizationResource)); |
|||
|
|||
localizationResource.Contributors.Add( |
|||
new DynamicLocalizationResourceContributor( |
|||
localizationResource.ResourceName)); |
|||
|
|||
return localizationResource; |
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue