Browse Source

Merge pull request #1013 from colinin/rel-8.3.0

Rel 8.3.0
pull/1050/head
yx lin 1 year ago
committed by GitHub
parent
commit
8b462018e8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      .github/workflows/publish.yml
  2. 4
      .github/workflows/release.yml
  3. 8
      Directory.Packages.props
  4. 3
      apps/vue/docker/nginx/default.conf
  5. 6
      apps/vue/src/utils/http/axios/index.ts
  6. 16
      apps/vue/src/views/oss-management/objects/components/OssUploadModal.vue
  7. 158
      aspnet-core/LINGYUN.MicroService.SingleProject.sln
  8. 2
      aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj
  9. 11
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN.Abp.DataProtection.Abstractions.csproj
  10. 20
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/AbpDataProtectionAbstractionsModule.cs
  11. 30
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterOperate.cs
  12. 6
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Localization/Resources/en.json
  13. 6
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Localization/Resources/zh-Hans.json
  14. 5
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWriteEntityInterceptor.cs
  15. 3
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs
  16. 14
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataAccessDeniedException.cs
  17. 7
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataProtectionModule.cs
  18. 6
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessKeywordContributorContext.cs
  19. 6
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityTypeFilterBuilder.cs
  20. 6
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessKeywordContributor.cs
  21. 3
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAuthorizationServiceExtensions.cs
  22. 21
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Keywords/DataAccessCurrentUserContributor.cs
  23. 43
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs
  24. 4
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/System/Reflection/NullableTypeExtensions.cs
  25. 3
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/FodyWeavers.xml
  26. 30
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/FodyWeavers.xsd
  27. 20
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN.Abp.Exporter.Application.Contracts.csproj
  28. 9
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN/Abp/Exporter/AbpExporterApplicationContractsModule.cs
  29. 19
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN/Abp/Exporter/IExporterAppService.cs
  30. 17
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN/Abp/Exporter/IImporterAppService.cs
  31. 103
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/README.md
  32. 3
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/FodyWeavers.xml
  33. 30
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/FodyWeavers.xsd
  34. 25
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN.Abp.Exporter.Application.csproj
  35. 12
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN/Abp/Exporter/AbpExporterApplicationModule.cs
  36. 50
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN/Abp/Exporter/ExporterAppService.cs
  37. 47
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN/Abp/Exporter/ImporterAppService.cs
  38. 3
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/FodyWeavers.xml
  39. 30
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/FodyWeavers.xsd
  40. 30
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN.Abp.Exporter.Core.csproj
  41. 31
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/AbpExporterCoreModule.cs
  42. 9
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/ExporterErrorCodes.cs
  43. 20
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/IExporterProvider.cs
  44. 19
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/IImporterProvider.cs
  45. 8
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/Localization/AbpExporterResource.cs
  46. 6
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/Localization/Resources/en.json
  47. 6
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/Localization/Resources/zh-Hans.json
  48. 17
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/NullExporterProvider.cs
  49. 18
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/NullImporterProvider.cs
  50. 76
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/README.md
  51. 3
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/FodyWeavers.xml
  52. 24
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN.Abp.Exporter.HttpApi.csproj
  53. 12
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN/Abp/Exporter/AbpExporterHttpApiModule.cs
  54. 22
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN/Abp/Exporter/ExporterController.cs
  55. 24
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN/Abp/Exporter/ImporterController.cs
  56. 3
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/FodyWeavers.xml
  57. 26
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN.Abp.Exporter.MagicodesIE.Excel.csproj
  58. 30
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelModule.cs
  59. 31
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelOptions.cs
  60. 23
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpImportHelper.cs
  61. 62
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelExporterProvider.cs
  62. 74
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelImporterProvider.cs
  63. 41
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/README.md
  64. 3
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/FodyWeavers.xml
  65. 30
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/FodyWeavers.xsd
  66. 25
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN.Abp.Exporter.MiniExcel.csproj
  67. 22
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelModule.cs
  68. 25
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelOptions.cs
  69. 41
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelExporterProvider.cs
  70. 35
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelImporterProvider.cs
  71. 46
      aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/README.md
  72. 3
      aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.Development.json
  73. 3
      aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json
  74. 1
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj
  75. 5539
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240929080118_Add-Demo-Module.Designer.cs
  76. 95
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240929080118_Add-Demo-Module.cs
  77. 133
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/SingleMigrationsDbContextModelSnapshot.cs
  78. 5
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsDbContext.cs
  79. 51
      aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs
  80. 4
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs
  81. 5
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationServiceBase.cs
  82. 5
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs
  83. 8
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs
  84. 10
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj
  85. 26
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainSharedModule.cs
  86. 8
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementErrorCodes.cs
  87. 9
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/Localization/Resources/en.json
  88. 9
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/Localization/Resources/zh-Hans.json
  89. 7
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs
  90. 2
      aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs
  91. 3
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/FodyWeavers.xml
  92. 30
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/FodyWeavers.xsd
  93. 27
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN.Abp.Demo.Application.Contracts.csproj
  94. 15
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/AbpDemoApplicationContractsModule.cs
  95. 12
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/AuthorDto.cs
  96. 15
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/CreateAuthorDto.cs
  97. 7
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/GetAuthorListDto.cs
  98. 18
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/IAuthorAppService.cs
  99. 15
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/UpdateAuthorDto.cs
  100. 8
      aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/AuthorLookupDto.cs

2
.github/workflows/publish.yml

@ -2,7 +2,7 @@ name: "Publish"
on: on:
push: push:
branches: [ rel-8.2.2 ] branches: [ rel-8.3.0 ]
env: env:
DOTNET_VERSION: "8.0.200" DOTNET_VERSION: "8.0.200"

4
.github/workflows/release.yml

@ -2,7 +2,7 @@ name: "Tagged Release"
on: on:
push: push:
branches: [ rel-8.2.2 ] branches: [ rel-8.3.0 ]
jobs: jobs:
tagged-release: tagged-release:
@ -14,4 +14,4 @@ jobs:
with: with:
repo_token: "${{ secrets.GITHUB_TOKEN }}" repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false prerelease: false
automatic_release_tag: "8.2.2" automatic_release_tag: "8.3.0"

8
Directory.Packages.props

@ -2,8 +2,8 @@
<PropertyGroup> <PropertyGroup>
<DotNetCoreCAPPackageVersion>8.2.0</DotNetCoreCAPPackageVersion> <DotNetCoreCAPPackageVersion>8.2.0</DotNetCoreCAPPackageVersion>
<ElsaPackageVersion>2.14.1</ElsaPackageVersion> <ElsaPackageVersion>2.14.1</ElsaPackageVersion>
<VoloAbpPackageVersion>8.2.2</VoloAbpPackageVersion> <VoloAbpPackageVersion>8.3.0</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>8.2.2</LINGYUNAbpPackageVersion> <LINGYUNAbpPackageVersion>8.3.0</LINGYUNAbpPackageVersion>
<MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion> <MicrosoftExtensionsPackageVersion>8.0.0</MicrosoftExtensionsPackageVersion>
<MicrosoftAspNetCorePackageVersion>8.0.0</MicrosoftAspNetCorePackageVersion> <MicrosoftAspNetCorePackageVersion>8.0.0</MicrosoftAspNetCorePackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion> <MicrosoftEntityFrameworkCorePackageVersion>8.0.0</MicrosoftEntityFrameworkCorePackageVersion>
@ -225,7 +225,9 @@
<PackageVersion Include="IdentityModel" Version="6.2.0" /> <PackageVersion Include="IdentityModel" Version="6.2.0" />
<PackageVersion Include="IP2Region.Net" Version="2.0.2" /> <PackageVersion Include="IP2Region.Net" Version="2.0.2" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" /> <PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageVersion Include="Magicodes.IE.Excel" Version="2.7.5.2" />
<PackageVersion Include="Markdig" Version="0.34.0" /> <PackageVersion Include="Markdig" Version="0.34.0" />
<PackageVersion Include="MiniExcel" Version="1.34.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" /> <PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NEST" Version="7.15.1" /> <PackageVersion Include="NEST" Version="7.15.1" />
<PackageVersion Include="NRules" Version="0.9.2" /> <PackageVersion Include="NRules" Version="0.9.2" />
@ -246,7 +248,7 @@
<PackageVersion Include="RulesEngine" Version="4.0.0" /> <PackageVersion Include="RulesEngine" Version="4.0.0" />
<PackageVersion Include="Scriban" Version="5.9.0" /> <PackageVersion Include="Scriban" Version="5.9.0" />
<PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" /> <PackageVersion Include="Senparc.Weixin.MP" Version="16.18.9" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.0.2" /> <PackageVersion Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" /> <PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" />
<PackageVersion Include="StackExchange.Redis" Version="2.7.4" /> <PackageVersion Include="StackExchange.Redis" Version="2.7.4" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" /> <PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />

3
apps/vue/docker/nginx/default.conf

@ -42,6 +42,9 @@ server {
proxy_pass http://www.nmc.cn/; proxy_pass http://www.nmc.cn/;
proxy_set_header Host www.nmc.cn; proxy_set_header Host www.nmc.cn;
proxy_set_header Referer http://www.nmc.cn; proxy_set_header Referer http://www.nmc.cn;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
location /signalr-hubs/ { location /signalr-hubs/ {

6
apps/vue/src/utils/http/axios/index.ts

@ -186,7 +186,11 @@ function createAxios(opt?: Partial<CreateAxiosOptions>) {
// 基础接口地址 // 基础接口地址
// baseURL: globSetting.apiUrl, // baseURL: globSetting.apiUrl,
headers: { 'Content-Type': ContentTypeEnum.JSON }, headers: {
'Content-Type': ContentTypeEnum.JSON,
// 取消后端cookie重定向
'X-Request-From': 'vben',
},
// 如果是form-data格式 // 如果是form-data格式
// headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED }, // headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
// 数据处理方式 // 数据处理方式

16
apps/vue/src/views/oss-management/objects/components/OssUploadModal.vue

@ -60,6 +60,7 @@
import { BasicTable, TableAction, useTable } from '/@/components/Table'; import { BasicTable, TableAction, useTable } from '/@/components/Table';
import { uploadUrl } from '/@/api/oss-management/objects'; import { uploadUrl } from '/@/api/oss-management/objects';
import { useUserStoreWithOut } from '/@/store/modules/user'; import { useUserStoreWithOut } from '/@/store/modules/user';
import { Result } from '/#/axios';
import Uploader from 'simple-uploader.js'; import Uploader from 'simple-uploader.js';
const emits = defineEmits(['file:uploaded', 'register']); const emits = defineEmits(['file:uploaded', 'register']);
@ -172,7 +173,20 @@
fileList.value.push(...files); fileList.value.push(...files);
} }
function _fileProgress(_, file) { function _fileProgress(_, file, chunk) {
// 2024-09-29
if (chunk.processedState?.res) {
try {
const result = JSON.parse(chunk.processedState.res) as Result<any>;
if (result.code !== '0') {
file.error = true;
file.errorMsg = result.message;
file.pause();
}
} catch (error) {
console.log('upload error ---> ', error);
}
}
if (file._prevUploadedSize) { if (file._prevUploadedSize) {
file.progress = `${Math.floor((file._prevUploadedSize / file.size) * 100)} %`; file.progress = `${Math.floor((file._prevUploadedSize / file.size) * 100)} %`;
} }

158
aspnet-core/LINGYUN.MicroService.SingleProject.sln

@ -425,6 +425,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\Directory.Build.props = ..\Directory.Build.props ..\Directory.Build.props = ..\Directory.Build.props
..\Directory.Packages.props = ..\Directory.Packages.props ..\Directory.Packages.props = ..\Directory.Packages.props
..\NuGet.Config = ..\NuGet.Config ..\NuGet.Config = ..\NuGet.Config
..\README.en.md = ..\README.en.md
..\README.md = ..\README.md
EndProjectSection EndProjectSection
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dapr", "dapr", "{FD9F5933-FDE5-4504-99BF-9050E0435C6D}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dapr", "dapr", "{FD9F5933-FDE5-4504-99BF-9050E0435C6D}"
@ -539,13 +541,61 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WeChat.Work.Han
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.Saas", "modules\saas\LINGYUN.Abp.MultiTenancy.Saas\LINGYUN.Abp.MultiTenancy.Saas.csproj", "{E3C07A77-EAF9-4A3F-8814-7D2F116C8E26}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.MultiTenancy.Saas", "modules\saas\LINGYUN.Abp.MultiTenancy.Saas\LINGYUN.Abp.MultiTenancy.Saas.csproj", "{E3C07A77-EAF9-4A3F-8814-7D2F116C8E26}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.IP2Region", "framework\common\LINGYUN.Abp.IP2Region\LINGYUN.Abp.IP2Region.csproj", "{DA54E88E-C43E-4E31-92D0-08A753F2C08D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IP2Region", "framework\common\LINGYUN.Abp.IP2Region\LINGYUN.Abp.IP2Region.csproj", "{DA54E88E-C43E-4E31-92D0-08A753F2C08D}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TestsBase", "tests\LINGYUN.Abp.TestBase\LINGYUN.Abp.TestsBase.csproj", "{A7417E7F-DB97-48DB-B849-AFC15854A6E7}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.TestsBase", "tests\LINGYUN.Abp.TestBase\LINGYUN.Abp.TestsBase.csproj", "{A7417E7F-DB97-48DB-B849-AFC15854A6E7}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Aliyun.Tests", "tests\LINGYUN.Abp.Aliyun.Tests\LINGYUN.Abp.Aliyun.Tests.csproj", "{8DDE4291-BC57-4C56-9871-B982462F4C3D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Aliyun.Tests", "tests\LINGYUN.Abp.Aliyun.Tests\LINGYUN.Abp.Aliyun.Tests.csproj", "{8DDE4291-BC57-4C56-9871-B982462F4C3D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.IP2Region.Tests", "tests\LINGYUN.Abp.IP2Region.Tests\LINGYUN.Abp.IP2Region.Tests.csproj", "{C5D64A2B-7E7E-4509-9F31-425D59712E6F}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IP2Region.Tests", "tests\LINGYUN.Abp.IP2Region.Tests\LINGYUN.Abp.IP2Region.Tests.csproj", "{C5D64A2B-7E7E-4509-9F31-425D59712E6F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data-protection", "data-protection", "{07C2FB08-985C-42FE-85AF-38E40A301668}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtection.Abstractions", "framework\data-protection\LINGYUN.Abp.DataProtection.Abstractions\LINGYUN.Abp.DataProtection.Abstractions.csproj", "{A52C54FB-C96D-4032-8588-AFC2CD158D23}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtection", "framework\data-protection\LINGYUN.Abp.DataProtection\LINGYUN.Abp.DataProtection.csproj", "{B05ED61E-9A36-4E90-B876-F48559E018A6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtection.EntityFrameworkCore", "framework\data-protection\LINGYUN.Abp.DataProtection.EntityFrameworkCore\LINGYUN.Abp.DataProtection.EntityFrameworkCore.csproj", "{1E8DE890-F27F-4A1A-B356-0B6B9D3B1EF7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data-protection", "data-protection", "{4FCD7337-4320-412D-9BC8-A0B243BC27B3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtectionManagement.Domain.Shared", "modules\data-protection\LINGYUN.Abp.DataProtectionManagement.Domain.Shared\LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj", "{9D2C789C-8241-4F53-AFEF-F2AB15BAA823}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtectionManagement.Domain", "modules\data-protection\LINGYUN.Abp.DataProtectionManagement.Domain\LINGYUN.Abp.DataProtectionManagement.Domain.csproj", "{36AEA095-E34D-43F5-8000-9FA3A696C312}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtectionManagement.Application.Contracts", "modules\data-protection\LINGYUN.Abp.DataProtectionManagement.Application.Contracts\LINGYUN.Abp.DataProtectionManagement.Application.Contracts.csproj", "{2D5A9AB0-9F32-4784-8972-814F86C0239D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtectionManagement.Application", "modules\data-protection\LINGYUN.Abp.DataProtectionManagement.Application\LINGYUN.Abp.DataProtectionManagement.Application.csproj", "{A4ECDDC4-1115-48A2-AC74-3B75B58F8FFB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore", "modules\data-protection\LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore\LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore.csproj", "{AF15C829-9288-4D7F-95A0-4EA8DF909929}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.DataProtectionManagement.HttpApi", "modules\data-protection\LINGYUN.Abp.DataProtectionManagement.HttpApi\LINGYUN.Abp.DataProtectionManagement.HttpApi.csproj", "{616652A5-A420-475C-AC9F-FC687E3C768B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{E29EC2A4-A2DE-442F-8616-DAFD69F128B8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Demo.Domain.Shared", "modules\demo\LINGYUN.Abp.Demo.Domain.Shared\LINGYUN.Abp.Demo.Domain.Shared.csproj", "{D736C433-C230-46B7-9D43-17D0282EBBDF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Demo.Domain", "modules\demo\LINGYUN.Abp.Demo.Domain\LINGYUN.Abp.Demo.Domain.csproj", "{FA525A71-C0BF-49FB-BAB7-547944618587}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Demo.Application.Contracts", "modules\demo\LINGYUN.Abp.Demo.Application.Contracts\LINGYUN.Abp.Demo.Application.Contracts.csproj", "{532D5703-0090-4F2E-B725-5786D53506C9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Demo.Application", "modules\demo\LINGYUN.Abp.Demo.Application\LINGYUN.Abp.Demo.Application.csproj", "{E538580B-A21F-4B3B-9CB4-741FE8C1C6EF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Demo.EntityFrameworkCore", "modules\demo\LINGYUN.Abp.Demo.EntityFrameworkCore\LINGYUN.Abp.Demo.EntityFrameworkCore.csproj", "{71CF0E82-FA07-472A-B32A-AC25EDA82BB0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Demo.HttpApi", "modules\demo\LINGYUN.Abp.Demo.HttpApi\LINGYUN.Abp.Demo.HttpApi.csproj", "{77965572-373C-4319-9EF9-73D6E660044B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "exporter", "exporter", "{4A2CF141-F32D-45A0-8665-B3705667A6D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.Application.Contracts", "framework\exporter\LINGYUN.Abp.Exporter.Application.Contracts\LINGYUN.Abp.Exporter.Application.Contracts.csproj", "{A3924A79-1ADC-458D-8764-3958297BDEB0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.Application", "framework\exporter\LINGYUN.Abp.Exporter.Application\LINGYUN.Abp.Exporter.Application.csproj", "{38A933EB-82F1-42A6-ABF3-F55975B4078E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.Core", "framework\exporter\LINGYUN.Abp.Exporter.Core\LINGYUN.Abp.Exporter.Core.csproj", "{03C9FFB2-E9A3-4CCC-A6B1-8B248BFBCB65}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.MiniExcel", "framework\exporter\LINGYUN.Abp.Exporter.MiniExcel\LINGYUN.Abp.Exporter.MiniExcel.csproj", "{CBC64BD6-297B-48F6-A3BA-0DBB4B0F5A69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Exporter.MagicodesIE.Excel", "framework\exporter\LINGYUN.Abp.Exporter.MagicodesIE.Excel\LINGYUN.Abp.Exporter.MagicodesIE.Excel.csproj", "{319428B9-CE7F-4027-92FA-6311C4CE95FB}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -1445,6 +1495,86 @@ Global
{C5D64A2B-7E7E-4509-9F31-425D59712E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU {C5D64A2B-7E7E-4509-9F31-425D59712E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5D64A2B-7E7E-4509-9F31-425D59712E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU {C5D64A2B-7E7E-4509-9F31-425D59712E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5D64A2B-7E7E-4509-9F31-425D59712E6F}.Release|Any CPU.Build.0 = Release|Any CPU {C5D64A2B-7E7E-4509-9F31-425D59712E6F}.Release|Any CPU.Build.0 = Release|Any CPU
{A52C54FB-C96D-4032-8588-AFC2CD158D23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A52C54FB-C96D-4032-8588-AFC2CD158D23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A52C54FB-C96D-4032-8588-AFC2CD158D23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A52C54FB-C96D-4032-8588-AFC2CD158D23}.Release|Any CPU.Build.0 = Release|Any CPU
{B05ED61E-9A36-4E90-B876-F48559E018A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B05ED61E-9A36-4E90-B876-F48559E018A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B05ED61E-9A36-4E90-B876-F48559E018A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B05ED61E-9A36-4E90-B876-F48559E018A6}.Release|Any CPU.Build.0 = Release|Any CPU
{1E8DE890-F27F-4A1A-B356-0B6B9D3B1EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E8DE890-F27F-4A1A-B356-0B6B9D3B1EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E8DE890-F27F-4A1A-B356-0B6B9D3B1EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E8DE890-F27F-4A1A-B356-0B6B9D3B1EF7}.Release|Any CPU.Build.0 = Release|Any CPU
{9D2C789C-8241-4F53-AFEF-F2AB15BAA823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D2C789C-8241-4F53-AFEF-F2AB15BAA823}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D2C789C-8241-4F53-AFEF-F2AB15BAA823}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D2C789C-8241-4F53-AFEF-F2AB15BAA823}.Release|Any CPU.Build.0 = Release|Any CPU
{36AEA095-E34D-43F5-8000-9FA3A696C312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36AEA095-E34D-43F5-8000-9FA3A696C312}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36AEA095-E34D-43F5-8000-9FA3A696C312}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36AEA095-E34D-43F5-8000-9FA3A696C312}.Release|Any CPU.Build.0 = Release|Any CPU
{2D5A9AB0-9F32-4784-8972-814F86C0239D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D5A9AB0-9F32-4784-8972-814F86C0239D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2D5A9AB0-9F32-4784-8972-814F86C0239D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2D5A9AB0-9F32-4784-8972-814F86C0239D}.Release|Any CPU.Build.0 = Release|Any CPU
{A4ECDDC4-1115-48A2-AC74-3B75B58F8FFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4ECDDC4-1115-48A2-AC74-3B75B58F8FFB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4ECDDC4-1115-48A2-AC74-3B75B58F8FFB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4ECDDC4-1115-48A2-AC74-3B75B58F8FFB}.Release|Any CPU.Build.0 = Release|Any CPU
{AF15C829-9288-4D7F-95A0-4EA8DF909929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF15C829-9288-4D7F-95A0-4EA8DF909929}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF15C829-9288-4D7F-95A0-4EA8DF909929}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF15C829-9288-4D7F-95A0-4EA8DF909929}.Release|Any CPU.Build.0 = Release|Any CPU
{616652A5-A420-475C-AC9F-FC687E3C768B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{616652A5-A420-475C-AC9F-FC687E3C768B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{616652A5-A420-475C-AC9F-FC687E3C768B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{616652A5-A420-475C-AC9F-FC687E3C768B}.Release|Any CPU.Build.0 = Release|Any CPU
{D736C433-C230-46B7-9D43-17D0282EBBDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D736C433-C230-46B7-9D43-17D0282EBBDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D736C433-C230-46B7-9D43-17D0282EBBDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D736C433-C230-46B7-9D43-17D0282EBBDF}.Release|Any CPU.Build.0 = Release|Any CPU
{FA525A71-C0BF-49FB-BAB7-547944618587}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA525A71-C0BF-49FB-BAB7-547944618587}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA525A71-C0BF-49FB-BAB7-547944618587}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA525A71-C0BF-49FB-BAB7-547944618587}.Release|Any CPU.Build.0 = Release|Any CPU
{532D5703-0090-4F2E-B725-5786D53506C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{532D5703-0090-4F2E-B725-5786D53506C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{532D5703-0090-4F2E-B725-5786D53506C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{532D5703-0090-4F2E-B725-5786D53506C9}.Release|Any CPU.Build.0 = Release|Any CPU
{E538580B-A21F-4B3B-9CB4-741FE8C1C6EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E538580B-A21F-4B3B-9CB4-741FE8C1C6EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E538580B-A21F-4B3B-9CB4-741FE8C1C6EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E538580B-A21F-4B3B-9CB4-741FE8C1C6EF}.Release|Any CPU.Build.0 = Release|Any CPU
{71CF0E82-FA07-472A-B32A-AC25EDA82BB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71CF0E82-FA07-472A-B32A-AC25EDA82BB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71CF0E82-FA07-472A-B32A-AC25EDA82BB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{71CF0E82-FA07-472A-B32A-AC25EDA82BB0}.Release|Any CPU.Build.0 = Release|Any CPU
{77965572-373C-4319-9EF9-73D6E660044B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77965572-373C-4319-9EF9-73D6E660044B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77965572-373C-4319-9EF9-73D6E660044B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{77965572-373C-4319-9EF9-73D6E660044B}.Release|Any CPU.Build.0 = Release|Any CPU
{A3924A79-1ADC-458D-8764-3958297BDEB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3924A79-1ADC-458D-8764-3958297BDEB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3924A79-1ADC-458D-8764-3958297BDEB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3924A79-1ADC-458D-8764-3958297BDEB0}.Release|Any CPU.Build.0 = Release|Any CPU
{38A933EB-82F1-42A6-ABF3-F55975B4078E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{38A933EB-82F1-42A6-ABF3-F55975B4078E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{38A933EB-82F1-42A6-ABF3-F55975B4078E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{38A933EB-82F1-42A6-ABF3-F55975B4078E}.Release|Any CPU.Build.0 = Release|Any CPU
{03C9FFB2-E9A3-4CCC-A6B1-8B248BFBCB65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03C9FFB2-E9A3-4CCC-A6B1-8B248BFBCB65}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03C9FFB2-E9A3-4CCC-A6B1-8B248BFBCB65}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03C9FFB2-E9A3-4CCC-A6B1-8B248BFBCB65}.Release|Any CPU.Build.0 = Release|Any CPU
{CBC64BD6-297B-48F6-A3BA-0DBB4B0F5A69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CBC64BD6-297B-48F6-A3BA-0DBB4B0F5A69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CBC64BD6-297B-48F6-A3BA-0DBB4B0F5A69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CBC64BD6-297B-48F6-A3BA-0DBB4B0F5A69}.Release|Any CPU.Build.0 = Release|Any CPU
{319428B9-CE7F-4027-92FA-6311C4CE95FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{319428B9-CE7F-4027-92FA-6311C4CE95FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{319428B9-CE7F-4027-92FA-6311C4CE95FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{319428B9-CE7F-4027-92FA-6311C4CE95FB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -1712,6 +1842,30 @@ Global
{A7417E7F-DB97-48DB-B849-AFC15854A6E7} = {37E2CAFE-0024-452E-BF81-E15F937E08EF} {A7417E7F-DB97-48DB-B849-AFC15854A6E7} = {37E2CAFE-0024-452E-BF81-E15F937E08EF}
{8DDE4291-BC57-4C56-9871-B982462F4C3D} = {37E2CAFE-0024-452E-BF81-E15F937E08EF} {8DDE4291-BC57-4C56-9871-B982462F4C3D} = {37E2CAFE-0024-452E-BF81-E15F937E08EF}
{C5D64A2B-7E7E-4509-9F31-425D59712E6F} = {37E2CAFE-0024-452E-BF81-E15F937E08EF} {C5D64A2B-7E7E-4509-9F31-425D59712E6F} = {37E2CAFE-0024-452E-BF81-E15F937E08EF}
{07C2FB08-985C-42FE-85AF-38E40A301668} = {99B7CBDE-A251-4738-97F0-DB1DB484BEE1}
{A52C54FB-C96D-4032-8588-AFC2CD158D23} = {07C2FB08-985C-42FE-85AF-38E40A301668}
{B05ED61E-9A36-4E90-B876-F48559E018A6} = {07C2FB08-985C-42FE-85AF-38E40A301668}
{1E8DE890-F27F-4A1A-B356-0B6B9D3B1EF7} = {07C2FB08-985C-42FE-85AF-38E40A301668}
{4FCD7337-4320-412D-9BC8-A0B243BC27B3} = {0B58AA48-665A-443F-A6A8-751FB9629DAF}
{9D2C789C-8241-4F53-AFEF-F2AB15BAA823} = {4FCD7337-4320-412D-9BC8-A0B243BC27B3}
{36AEA095-E34D-43F5-8000-9FA3A696C312} = {4FCD7337-4320-412D-9BC8-A0B243BC27B3}
{2D5A9AB0-9F32-4784-8972-814F86C0239D} = {4FCD7337-4320-412D-9BC8-A0B243BC27B3}
{A4ECDDC4-1115-48A2-AC74-3B75B58F8FFB} = {4FCD7337-4320-412D-9BC8-A0B243BC27B3}
{AF15C829-9288-4D7F-95A0-4EA8DF909929} = {4FCD7337-4320-412D-9BC8-A0B243BC27B3}
{616652A5-A420-475C-AC9F-FC687E3C768B} = {4FCD7337-4320-412D-9BC8-A0B243BC27B3}
{E29EC2A4-A2DE-442F-8616-DAFD69F128B8} = {0B58AA48-665A-443F-A6A8-751FB9629DAF}
{D736C433-C230-46B7-9D43-17D0282EBBDF} = {E29EC2A4-A2DE-442F-8616-DAFD69F128B8}
{FA525A71-C0BF-49FB-BAB7-547944618587} = {E29EC2A4-A2DE-442F-8616-DAFD69F128B8}
{532D5703-0090-4F2E-B725-5786D53506C9} = {E29EC2A4-A2DE-442F-8616-DAFD69F128B8}
{E538580B-A21F-4B3B-9CB4-741FE8C1C6EF} = {E29EC2A4-A2DE-442F-8616-DAFD69F128B8}
{71CF0E82-FA07-472A-B32A-AC25EDA82BB0} = {E29EC2A4-A2DE-442F-8616-DAFD69F128B8}
{77965572-373C-4319-9EF9-73D6E660044B} = {E29EC2A4-A2DE-442F-8616-DAFD69F128B8}
{4A2CF141-F32D-45A0-8665-B3705667A6D2} = {99B7CBDE-A251-4738-97F0-DB1DB484BEE1}
{A3924A79-1ADC-458D-8764-3958297BDEB0} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
{38A933EB-82F1-42A6-ABF3-F55975B4078E} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
{03C9FFB2-E9A3-4CCC-A6B1-8B248BFBCB65} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
{CBC64BD6-297B-48F6-A3BA-0DBB4B0F5A69} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
{319428B9-CE7F-4027-92FA-6311C4CE95FB} = {4A2CF141-F32D-45A0-8665-B3705667A6D2}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1}

2
aspnet-core/framework/cli/LINGYUN.Abp.Cli/LINGYUN.Abp.Cli.csproj

@ -5,7 +5,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<Version>8.2.1</Version> <Version>8.3.0</Version>
<Copyright>colin</Copyright> <Copyright>colin</Copyright>
<Description>Use LINGYUN.MicroService.Templates command line</Description> <Description>Use LINGYUN.MicroService.Templates command line</Description>
<PackAsTool>true</PackAsTool> <PackAsTool>true</PackAsTool>

11
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN.Abp.DataProtection.Abstractions.csproj

@ -13,8 +13,19 @@
<RootNamespace /> <RootNamespace />
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\DataProtection\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\DataProtection\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\DataProtection\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\DataProtection\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.ObjectExtending" /> <PackageReference Include="Volo.Abp.ObjectExtending" />
<PackageReference Include="Volo.Abp.Localization" />
</ItemGroup> </ItemGroup>
</Project> </Project>

20
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/AbpDataProtectionAbstractionsModule.cs

@ -1,9 +1,27 @@
using Volo.Abp.Modularity; using LINGYUN.Abp.DataProtection.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.DataProtection; namespace LINGYUN.Abp.DataProtection;
[DependsOn(typeof(AbpLocalizationModule))]
[DependsOn(typeof(AbpObjectExtendingModule))] [DependsOn(typeof(AbpObjectExtendingModule))]
public class AbpDataProtectionAbstractionsModule : AbpModule public class AbpDataProtectionAbstractionsModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpDataProtectionAbstractionsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<DataProtectionResource>()
.AddVirtualJson("/LINGYUN/Abp/DataProtection/Localization/Resources");
});
}
} }

30
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/DataAccessFilterOperate.cs

@ -6,64 +6,54 @@ namespace LINGYUN.Abp.DataProtection;
/// </summary> /// </summary>
public enum DataAccessFilterOperate public enum DataAccessFilterOperate
{ {
/// <summary>
/// 且
/// </summary>
[Description("且")]
And = 1,
/// <summary>
/// 或
/// </summary>
[Description("或")]
Or = 2,
/// <summary> /// <summary>
/// 等于 /// 等于
/// </summary> /// </summary>
[Description("等于")] [Description("等于")]
Equal = 3, Equal = 1,
/// <summary> /// <summary>
/// 不等于 /// 不等于
/// </summary> /// </summary>
[Description("不等于")] [Description("不等于")]
NotEqual = 4, NotEqual = 2,
/// <summary> /// <summary>
/// 小于 /// 小于
/// </summary> /// </summary>
[Description("小于")] [Description("小于")]
Less = 5, Less = 3,
/// <summary> /// <summary>
/// 小于或等于 /// 小于或等于
/// </summary> /// </summary>
[Description("小于等于")] [Description("小于等于")]
LessOrEqual = 6, LessOrEqual = 4,
/// <summary> /// <summary>
/// 大于 /// 大于
/// </summary> /// </summary>
[Description("大于")] [Description("大于")]
Greater = 7, Greater = 5,
/// <summary> /// <summary>
/// 大于或等于 /// 大于或等于
/// </summary> /// </summary>
[Description("大于等于")] [Description("大于等于")]
GreaterOrEqual = 8, GreaterOrEqual = 6,
/// <summary> /// <summary>
/// 左包含 /// 左包含
/// </summary> /// </summary>
[Description("左包含")] [Description("左包含")]
StartsWith = 9, StartsWith = 7,
/// <summary> /// <summary>
/// 右包含 /// 右包含
/// </summary> /// </summary>
[Description("右包含")] [Description("右包含")]
EndsWith = 10, EndsWith = 8,
/// <summary> /// <summary>
/// 包含 /// 包含
/// </summary> /// </summary>
[Description("包含")] [Description("包含")]
Contains = 11, Contains = 9,
/// <summary> /// <summary>
/// 不包含 /// 不包含
/// </summary> /// </summary>
[Description("不包含")] [Description("不包含")]
NotContains = 12, NotContains = 10,
} }

6
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Localization/Resources/en.json

@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"DataProtection:010001": "Data access permission not granted to protected resources!"
}
}

6
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.Abstractions/LINGYUN/Abp/DataProtection/Localization/Resources/zh-Hans.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"DataProtection:010001": "未授予受保护资源的数据访问权限!"
}
}

5
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectedWriteEntityInterceptor.cs

@ -7,7 +7,6 @@ using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Authorization;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
@ -40,7 +39,7 @@ public class AbpDataProtectedWriteEntityInterceptor : SaveChangesInterceptor, IT
var entityKeys = updateEntites var entityKeys = updateEntites
.Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString()) .Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString())
.JoinAsString(";"); .JoinAsString(";");
throw new AbpAuthorizationException( throw new AbpDataAccessDeniedException(
$"Delete data permission not granted to entity {updateEntites.First().GetType()} for data {entityKeys}!"); $"Delete data permission not granted to entity {updateEntites.First().GetType()} for data {entityKeys}!");
} }
} }
@ -56,7 +55,7 @@ public class AbpDataProtectedWriteEntityInterceptor : SaveChangesInterceptor, IT
var entityKeys = deleteEntites var entityKeys = deleteEntites
.Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString()) .Select(entity => (entity is IEntity abpEntity ? abpEntity.GetKeys() : new string[1] { entity.ToString() }).ToString())
.JoinAsString(";"); .JoinAsString(";");
throw new AbpAuthorizationException( throw new AbpDataAccessDeniedException(
$"Delete data permission not granted to entity {deleteEntites.First().GetType()} for data {entityKeys}!"); $"Delete data permission not granted to entity {deleteEntites.First().GetType()} for data {entityKeys}!");
} }
} }

3
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs

@ -16,8 +16,7 @@ public abstract class AbpDataProtectionDbContext<TDbContext> : AbpDbContext<TDbC
public IOptions<AbpDataProtectionOptions> DataProtectionOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpDataProtectionOptions>>(); public IOptions<AbpDataProtectionOptions> DataProtectionOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpDataProtectionOptions>>();
public ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService<ICurrentUser>(); public ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService<ICurrentUser>();
public AbpDataProtectionDbContext( protected AbpDataProtectionDbContext(DbContextOptions<TDbContext> options) : base(options)
DbContextOptions<TDbContext> options) : base(options)
{ {
} }

14
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataAccessDeniedException.cs

@ -0,0 +1,14 @@
using Volo.Abp;
namespace LINGYUN.Abp.DataProtection;
public class AbpDataAccessDeniedException : BusinessException
{
public AbpDataAccessDeniedException()
{
}
public AbpDataAccessDeniedException(string message)
: base("DataProtection:010001", message)
{
}
}

7
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/AbpDataProtectionModule.cs

@ -4,7 +4,7 @@ using LINGYUN.Abp.DataProtection.Operations;
using LINGYUN.Abp.DataProtection.Subjects; using LINGYUN.Abp.DataProtection.Subjects;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain; using Volo.Abp.Domain;
using Volo.Abp.Localization; using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace LINGYUN.Abp.DataProtection; namespace LINGYUN.Abp.DataProtection;
@ -37,13 +37,14 @@ public class AbpDataProtectionModule : AbpModule
options.OperateContributors.Add(DataAccessFilterOperate.NotContains, new DataAccessNotContainsContributor()); options.OperateContributors.Add(DataAccessFilterOperate.NotContains, new DataAccessNotContainsContributor());
options.SubjectContributors.Add(new DataAccessUserIdContributor()); options.SubjectContributors.Add(new DataAccessUserIdContributor());
options.SubjectContributors.Add(new DataAccessClientIdContributor());
options.SubjectContributors.Add(new DataAccessRoleNameContributor()); options.SubjectContributors.Add(new DataAccessRoleNameContributor());
options.SubjectContributors.Add(new DataAccessOrganizationUnitContributor()); options.SubjectContributors.Add(new DataAccessOrganizationUnitContributor());
}); });
Configure<AbpLocalizationOptions>(options => Configure<AbpExceptionLocalizationOptions>(options =>
{ {
options.Resources.Add<DataProtectionResource>(); options.MapCodeNamespace("DataProtection", typeof(DataProtectionResource));
}); });
} }
} }

6
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/DataAccessKeywordContributorContext.cs

@ -4,8 +4,12 @@ namespace LINGYUN.Abp.DataProtection;
public class DataAccessKeywordContributorContext public class DataAccessKeywordContributorContext
{ {
public IServiceProvider ServiceProvider { get; } public IServiceProvider ServiceProvider { get; }
public DataAccessKeywordContributorContext(IServiceProvider serviceProvider) public Type ConversionType { get; }
public DataAccessKeywordContributorContext(
IServiceProvider serviceProvider,
Type conversionType)
{ {
ServiceProvider = serviceProvider; ServiceProvider = serviceProvider;
ConversionType = conversionType;
} }
} }

6
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/EntityTypeFilterBuilder.cs

@ -240,10 +240,8 @@ public class EntityTypeFilterBuilder : IEntityTypeFilterBuilder, ITransientDepen
{ {
if (_options.KeywordContributors.TryGetValue(rule.Value?.ToString() ?? "", out var contributor)) if (_options.KeywordContributors.TryGetValue(rule.Value?.ToString() ?? "", out var contributor))
{ {
var context = new DataAccessKeywordContributorContext(_serviceProvider); var context = new DataAccessKeywordContributorContext(_serviceProvider, conversionType);
var keyValue = contributor.Contribute(context); return contributor.Contribute(context);
var value = CastTo(keyValue, conversionType);
return Expression.Constant(value, conversionType);
} }
else else
{ {

6
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAccessKeywordContributor.cs

@ -1,6 +1,8 @@
namespace LINGYUN.Abp.DataProtection; using System.Linq.Expressions;
namespace LINGYUN.Abp.DataProtection;
public interface IDataAccessKeywordContributor public interface IDataAccessKeywordContributor
{ {
string Keyword { get; } string Keyword { get; }
object Contribute(DataAccessKeywordContributorContext context); Expression Contribute(DataAccessKeywordContributorContext context);
} }

3
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/IDataAuthorizationServiceExtensions.cs

@ -1,7 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Volo.Abp.Authorization;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
namespace LINGYUN.Abp.DataProtection; namespace LINGYUN.Abp.DataProtection;
@ -13,7 +12,7 @@ public static class IDataAuthorizationServiceExtensions
if (!result.Succeeded) if (!result.Succeeded)
{ {
var entityKeys = entities.Select(x => x.ToString()).JoinAsString(";"); var entityKeys = entities.Select(x => x.ToString()).JoinAsString(";");
throw new AbpAuthorizationException( throw new AbpDataAccessDeniedException(
$"The {operation} operation with entity type {typeof(Entity)} identified as {entityKeys} is not allowed!"); $"The {operation} operation with entity type {typeof(Entity)} identified as {entityKeys} is not allowed!");
} }
} }

21
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Keywords/DataAccessCurrentUserContributor.cs

@ -1,4 +1,8 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System;
using System.ComponentModel;
using System.Globalization;
using System.Linq.Expressions;
using Volo.Abp.Users; using Volo.Abp.Users;
namespace LINGYUN.Abp.DataProtection.Keywords; namespace LINGYUN.Abp.DataProtection.Keywords;
@ -7,9 +11,22 @@ public class DataAccessCurrentUserContributor : IDataAccessKeywordContributor
public const string Name = "@CurrentUser"; public const string Name = "@CurrentUser";
public string Keyword => Name; public string Keyword => Name;
public object Contribute(DataAccessKeywordContributorContext context) public Expression Contribute(DataAccessKeywordContributorContext context)
{ {
var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>(); var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>();
return currentUser.Id;
var userId = CastTo(currentUser.Id, context.ConversionType);
// entity.Where(x => x.CreatorId == CurrentUser.Id);
return Expression.Constant(userId, context.ConversionType);
}
private static object CastTo(object value, Type conversionType)
{
if (conversionType == typeof(Guid) || conversionType == typeof(Guid?))
{
return TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value.ToString()!)!;
}
return Convert.ChangeType(value, conversionType, CultureInfo.InvariantCulture);
} }
} }

43
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN/Abp/DataProtection/Subjects/DataAccessClientIdContributor.cs

@ -0,0 +1,43 @@
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using System.Linq;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Clients;
namespace LINGYUN.Abp.DataProtection.Subjects;
public class DataAccessClientIdContributor : IDataAccessSubjectContributor
{
public string Name => ClientPermissionValueProvider.ProviderName;
public virtual List<string> GetAllowProperties(DataAccessSubjectContributorContext context)
{
var allowProperties = new List<string>();
var currentClient = context.ServiceProvider.GetRequiredService<ICurrentClient>();
if (currentClient.IsAuthenticated)
{
var resourceStore = context.ServiceProvider.GetRequiredService<IDataProtectedResourceStore>();
var resource = resourceStore.Get(Name, currentClient.Id, context.EntityTypeFullName, context.Operation);
if (resource?.AllowProperties.Any() == true)
{
allowProperties.AddIfNotContains(resource.AllowProperties);
}
}
return allowProperties;
}
public virtual List<DataAccessFilterGroup> GetFilterGroups(DataAccessSubjectContributorContext context)
{
var groups = new List<DataAccessFilterGroup>();
var currentClient = context.ServiceProvider.GetRequiredService<ICurrentClient>();
if (currentClient.IsAuthenticated)
{
var resourceStore = context.ServiceProvider.GetRequiredService<IDataProtectedResourceStore>();
var resource = resourceStore.Get(Name, currentClient.Id, context.EntityTypeFullName, context.Operation);
if (resource?.FilterGroup != null)
{
groups.Add(resource.FilterGroup);
}
}
return groups;
}
}

4
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection/System/Reflection/NullableTypeExtensions.cs

@ -1,6 +1,4 @@
using System; namespace System.Reflection;
namespace System.Reflection;
internal static class NullableTypeExtensions internal static class NullableTypeExtensions
{ {

3
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

20
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN.Abp.Exporter.Application.Contracts.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Exporter.Application.Contracts</AssemblyName>
<PackageId>LINGYUN.Abp.Exporter.Application.Contracts</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" />
</ItemGroup>
</Project>

9
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN/Abp/Exporter/AbpExporterApplicationContractsModule.cs

@ -0,0 +1,9 @@
using Volo.Abp.Application;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Exporter;
[DependsOn(typeof(AbpDddApplicationContractsModule))]
public class AbpExporterApplicationContractsModule : AbpModule
{
}

19
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN/Abp/Exporter/IExporterAppService.cs

@ -0,0 +1,19 @@
using System.Threading.Tasks;
using Volo.Abp.Content;
namespace LINGYUN.Abp.Exporter;
/// <summary>
/// 数据导出服务接口
/// </summary>
/// <typeparam name="TEntityExportDto">导出的实体数据传输对象</typeparam>
/// <typeparam name="TEntityListGetInput">实体数据过滤数据对象</typeparam>
public interface IExporterAppService<TEntityExportDto, TEntityListGetInput>
where TEntityExportDto : class, new()
{
/// <summary>
/// 导出数据(默认实现Excel)
/// </summary>
/// <param name="input">数据过滤条件</param>
/// <returns></returns>
Task<IRemoteStreamContent> ExportAsync(TEntityListGetInput input);
}

17
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/LINGYUN/Abp/Exporter/IImporterAppService.cs

@ -0,0 +1,17 @@
using System.Threading.Tasks;
namespace LINGYUN.Abp.Exporter;
/// <summary>
/// 数据导入服务接口
/// </summary>
/// <typeparam name="TEntityImportDto"></typeparam>
public interface IImporterAppService<TEntityImportDto>
where TEntityImportDto: class, new()
{
/// <summary>
/// 导入数据(默认从Excel)
/// </summary>
/// <param name="input">导入的数据文件流</param>
/// <returns></returns>
Task ImportAsync(TEntityImportDto input);
}

103
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application.Contracts/README.md

@ -0,0 +1,103 @@
# LINGYUN.Abp.Exporter.Application.Contracts
数据导出/导入接口契约层,定义通用的数据导入/导入服务接口
## 配置使用
> 配置模块依赖
```csharp
[DependsOn(
typeof(AbpExporterApplicationContractsModule)
)]
public class YouProjectModule : AbpModule
{
}
```
> 定义导出类型
```csharp
public class DemoClassDto
{
public string Name { get; set; }
public string Remarks { get; set; }
public DemoClassDto()
{
}
}
```
> 定义导入类型
```csharp
public class DemoClassImportInput
{
[Required]
public IRemoteStreamContent Content { get; set; }
public DemoClassImportInput()
{
}
}
```
> 定义数据过滤类型
```csharp
public class DemoClassExportListInput
{
public string Filter { get; set; }
[Required]
public string FileName { get; set; }
public DemoClassExportListInput()
{
}
}
```
> 导出数据
```csharp
public class ExportDemoClassExportAppService : IExporterAppService<DemoClassDto, DemoClassExportListInput>
{
private readonly IExporterProvider _exporterProvider;
public ExportDemoClassExportAppService(IExporterProvider exporterProvider)
{
_exporterProvider = exporterProvider;
}
public async virtual Task<IRemoteStreamContent> ExportAsync(DemoClassExportListInput input)
{
var dtos = 通过仓储接口查询数据列表;
var stream = await _exporterProvider.ExportAsync(dtos);
return new RemoteStreamContent(stream, input.FileName);
}
}
```
> 导入数据
```csharp
public class ExportDemoClassImportAppService : IImporterAppService<DemoClassImportInput>
{
private readonly IImporterProvider _importerProvider;
public ExportDemoClassImportAppService(IImporterProvider importerProvider)
{
_importerProvider = importerProvider;
}
public async virtual Task ImportAsync(DemoClassImportInput input)
{
var stream = input.Content.GetStream();
var demos = await _importerProvider.ImportAsync<DemoClass>(stream);
// 其他操作
}
}
```

3
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

25
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN.Abp.Exporter.Application.csproj

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Exporter.Application</AssemblyName>
<PackageId>LINGYUN.Abp.Exporter.Application</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Exporter.Application.Contracts\LINGYUN.Abp.Exporter.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Exporter.Core\LINGYUN.Abp.Exporter.Core.csproj" />
</ItemGroup>
</Project>

12
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN/Abp/Exporter/AbpExporterApplicationModule.cs

@ -0,0 +1,12 @@
using Volo.Abp.Application;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Exporter;
[DependsOn(
typeof(AbpDddApplicationModule),
typeof(AbpExporterCoreModule),
typeof(AbpExporterApplicationContractsModule))]
public class AbpExporterApplicationModule : AbpModule
{
}

50
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN/Abp/Exporter/ExporterAppService.cs

@ -0,0 +1,50 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Content;
namespace LINGYUN.Abp.Exporter;
public abstract class ExporterAppService<TEntity, TEntityExportDto, TEntityListGetInput> : ApplicationService, IExporterAppService<TEntityExportDto, TEntityListGetInput>
where TEntityExportDto : class, new()
{
private readonly IExporterProvider _exporterProvider;
protected ExporterAppService(IExporterProvider exporterProvider)
{
_exporterProvider = exporterProvider;
}
public async virtual Task<IRemoteStreamContent> ExportAsync(TEntityListGetInput input)
{
var fileName = GetExportFileName(input);
var entities = await GetListAsync(input);
var entitieDtoList = MapEntitiesToDto(entities);
var stream = await _exporterProvider.ExportAsync(entitieDtoList);
return new RemoteStreamContent(stream, fileName);
}
/// <summary>
/// 实现方法用以返回导出文件名
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
protected abstract string GetExportFileName(TEntityListGetInput input);
/// <summary>
/// 实现方法用以查询需要导出的实体列表
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
protected abstract Task<List<TEntity>> GetListAsync(TEntityListGetInput input);
/// <summary>
/// 实现方法用以实体数据传输对象映射
/// </summary>
/// <param name="entities"></param>
/// <returns></returns>
protected virtual List<TEntityExportDto> MapEntitiesToDto(List<TEntity> entities)
{
return ObjectMapper.Map<List<TEntity>, List<TEntityExportDto>>(entities);
}
}

47
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Application/LINGYUN/Abp/Exporter/ImporterAppService.cs

@ -0,0 +1,47 @@
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.Exporter;
public abstract class ImporterAppService<TEntity, TEntityImportDto> : ApplicationService, IImporterAppService<TEntityImportDto>
where TEntityImportDto : class, new()
{
private readonly IImporterProvider _importerProvider;
protected ImporterAppService(IImporterProvider importerProvider)
{
_importerProvider = importerProvider;
}
public async virtual Task ImportAsync(TEntityImportDto input)
{
var stream = await GetImportStream(input);
var entitieDtoList = await _importerProvider.ImportAsync<TEntityImportDto>(stream);
var entities = MapDtoToEntities([.. entitieDtoList]);
await SaveManyEntities(entities);
}
/// <summary>
/// 实现方法用以从导入数据中提取文件流
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
protected abstract Task<Stream> GetImportStream(TEntityImportDto input);
/// <summary>
/// 实现方法用以保存实体列表到持久化设施
/// </summary>
/// <param name="entities"></param>
/// <returns></returns>
protected abstract Task SaveManyEntities(ICollection<TEntity> entities);
/// <summary>
/// 实现方法用以实体数据传输对象映射
/// </summary>
/// <param name="entitieDtoList"></param>
/// <returns></returns>
protected virtual List<TEntity> MapDtoToEntities(List<TEntityImportDto> entitieDtoList)
{
return ObjectMapper.Map<List<TEntityImportDto>, List<TEntity>>(entitieDtoList);
}
}

3
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

30
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

30
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN.Abp.Exporter.Core.csproj

@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Exporter.Core</AssemblyName>
<PackageId>LINGYUN.Abp.Exporter.Core</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Nullable>enable</Nullable>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\Exporter\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\Exporter\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\Exporter\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization" />
</ItemGroup>
</Project>

31
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/AbpExporterCoreModule.cs

@ -0,0 +1,31 @@
using LINGYUN.Abp.Exporter.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Exporter;
[DependsOn(typeof(AbpLocalizationModule))]
public class AbpExporterCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpExporterCoreModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<AbpExporterResource>("en")
.AddVirtualJson("/LINGYUN/Abp/Exporter/Localization/Resources");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace(ExporterErrorCodes.Namespace, typeof(AbpExporterResource));
});
}
}

9
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/ExporterErrorCodes.cs

@ -0,0 +1,9 @@
namespace LINGYUN.Abp.Exporter;
public static class ExporterErrorCodes
{
public const string Namespace = "AbpExporter";
/// <summary>
/// 导入数据过程中出现一些错误,请检查数据有效性!
/// </summary>
public const string ImportDataError = Namespace + ":010001";
}

20
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/IExporterProvider.cs

@ -0,0 +1,20 @@
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Exporter;
/// <summary>
/// 数据导出提供者
/// </summary>
public interface IExporterProvider
{
/// <summary>
/// 数据导出
/// </summary>
/// <param name="data">导出数据</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<Stream> ExportAsync<T>(ICollection<T> data, CancellationToken cancellationToken = default)
where T : class, new();
}

19
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/IImporterProvider.cs

@ -0,0 +1,19 @@
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Exporter;
/// <summary>
/// 数据导入提供者
/// </summary>
public interface IImporterProvider
{
/// <summary>
/// 数据导入
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="stream"></param>
/// <returns></returns>
Task<IReadOnlyCollection<T>> ImportAsync<T>(Stream stream)
where T : class, new();
}

8
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/Localization/AbpExporterResource.cs

@ -0,0 +1,8 @@
using Volo.Abp.Localization;
namespace LINGYUN.Abp.Exporter.Localization;
[LocalizationResourceName("AbpExporter")]
public class AbpExporterResource
{
}

6
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/Localization/Resources/en.json

@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"AbpExporter:010001": "There were some errors during the data import process. Please check the validity of the data!"
}
}

6
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/Localization/Resources/zh-Hans.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"AbpExporter:010001": "导入数据过程中出现一些错误,请检查数据有效性!"
}
}

17
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/NullExporterProvider.cs

@ -0,0 +1,17 @@
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Exporter;
[Dependency(TryRegister = true)]
public class NullExporterProvider : IExporterProvider, ISingletonDependency
{
private readonly static Stream _nullStreamCache = Stream.Null;
public Task<Stream> ExportAsync<T>(ICollection<T> data, CancellationToken cancellationToken = default) where T : class, new()
{
return Task.FromResult(_nullStreamCache);
}
}

18
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/LINGYUN/Abp/Exporter/NullImporterProvider.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Exporter;
[Dependency(TryRegister = true)]
public class NullImporterProvider : IImporterProvider, ISingletonDependency
{
public Task<IReadOnlyCollection<T>> ImportAsync<T>(Stream stream) where T : class, new()
{
IReadOnlyCollection<T> empty = Array.Empty<T>();
return Task.FromResult(empty);
}
}

76
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.Core/README.md

@ -0,0 +1,76 @@
# LINGYUN.Abp.Exporter.Core
数据导出/导入核心层
## 配置使用
```csharp
[DependsOn(
typeof(AbpExporterCoreModule)
)]
public class YouProjectModule : AbpModule
{
}
```
> 导出数据
```csharp
public class ExportDemoClass
{
private readonly IExporterProvider _exporterProvider;
public ExportDemoClass(IExporterProvider exporterProvider)
{
_exporterProvider = exporterProvider;
}
public async virtual Task<IRemoteStreamContent> ExportAsync()
{
var dataItems = new object[]
{
new
{
Name = "name1",
Remakrs = "remarks1"
}
};
var stream = await _exporterProvider.ExportAsync(dataItems);
return new RemoteStreamContent(stream, "demo.xlsx");
}
}
```
> 导入数据
```csharp
public class ImportDemoClass
{
private readonly IImporterProvider _importerProvider;
public ImportDemoClass(IImporterProvider importerProvider)
{
_importerProvider = importerProvider;
}
public async virtual Task ImportAsync(Stream stream)
{
var demos = await _importerProvider.ImportAsync<DemoClass>(stream);
// 其他操作
}
}
public class DemoClass
{
public string Name { get; set; }
public string Remarks { get; set; }
public DemoClass()
{
}
}
```

3
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

24
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN.Abp.Exporter.HttpApi.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.Exporter.HttpApi</AssemblyName>
<PackageId>LINGYUN.Abp.Exporter.HttpApi</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Exporter.Application.Contracts\LINGYUN.Abp.Exporter.Application.Contracts.csproj" />
</ItemGroup>
</Project>

12
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN/Abp/Exporter/AbpExporterHttpApiModule.cs

@ -0,0 +1,12 @@
using Volo.Abp.Application;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Exporter;
[DependsOn(
typeof(AbpDddApplicationModule),
typeof(AbpExporterApplicationContractsModule))]
public class AbpExporterHttpApiModule : AbpModule
{
}

22
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN/Abp/Exporter/ExporterController.cs

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Content;
namespace LINGYUN.Abp.Exporter;
public abstract class ExporterController<TEntityExportDto, TEntityListGetInput> : AbpControllerBase, IExporterAppService<TEntityExportDto, TEntityListGetInput>
where TEntityExportDto : class, new()
{
private readonly IExporterAppService<TEntityExportDto, TEntityListGetInput> _exportService;
protected ExporterController(IExporterAppService<TEntityExportDto, TEntityListGetInput> exportService)
{
_exportService = exportService;
}
[HttpGet]
[Route("export")]
public virtual Task<IRemoteStreamContent> ExportAsync(TEntityListGetInput input)
{
return _exportService.ExportAsync(input);
}
}

24
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.HttpApi/LINGYUN/Abp/Exporter/ImporterController.cs

@ -0,0 +1,24 @@
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Content;
namespace LINGYUN.Abp.Exporter;
public abstract class ImporterController<TEntityImportDto> : AbpControllerBase, IImporterAppService<TEntityImportDto>
where TEntityImportDto : class, new()
{
private readonly IImporterAppService<TEntityImportDto> _importService;
protected ImporterController(IImporterAppService<TEntityImportDto> importService)
{
_importService = importService;
}
[HttpPost]
[Route("import")]
public virtual Task ImportAsync(IRemoteStreamContent input)
{
return _importService.ImportAsync(input);
}
}

3
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

26
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN.Abp.Exporter.MagicodesIE.Excel.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Exporter.MagicodesIE.Excel</AssemblyName>
<PackageId>LINGYUN.Abp.Exporter.MagicodesIE.Excel</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Nullable>enable</Nullable>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Json" />
<PackageReference Include="Magicodes.IE.Excel" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Exporter.Core\LINGYUN.Abp.Exporter.Core.csproj" />
</ItemGroup>
</Project>

30
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelModule.cs

@ -0,0 +1,30 @@
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel;
[DependsOn(typeof(AbpExporterCoreModule))]
public class AbpExporterMagicodesIEExcelModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddScoped<IExcelExporter, ExcelExporter>();
context.Services.AddScoped<IExcelImporter, ExcelImporter>();
context.Services.AddScoped<IExportFileByTemplate, ExcelExporter>();
context.Services.Replace(
ServiceDescriptor.Transient(
typeof(IExporterProvider),
typeof(MagicodesIEExcelExporterProvider)));
context.Services.Replace(
ServiceDescriptor.Transient(
typeof(IImporterProvider),
typeof(MagicodesIEExcelImporterProvider)));
}
}

31
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpExporterMagicodesIEExcelOptions.cs

@ -0,0 +1,31 @@
using Magicodes.ExporterAndImporter.Excel;
using System;
using System.Collections.Generic;
namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel;
public class AbpExporterMagicodesIEExcelOptions
{
/// <summary>
/// 数据导出设置
/// </summary>
public IDictionary<Type, Action<ExcelExporterAttribute>> ExportSettingMapping { get; }
/// <summary>
/// 数据导入设置
/// </summary>
public IDictionary<Type, Action<ExcelImporterAttribute>> ImportSettingMapping { get; }
public AbpExporterMagicodesIEExcelOptions()
{
ExportSettingMapping = new Dictionary<Type, Action<ExcelExporterAttribute>>();
ImportSettingMapping = new Dictionary<Type, Action<ExcelImporterAttribute>>();
}
public void MapExportSetting(Type dataType, Action<ExcelExporterAttribute> exportSettingsSetup)
{
ExportSettingMapping[dataType] = exportSettingsSetup;
}
public void MapImportSetting(Type dataType, Action<ExcelImporterAttribute> importSettingsSetup)
{
ImportSettingMapping[dataType] = importSettingsSetup;
}
}

23
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/AbpImportHelper.cs

@ -0,0 +1,23 @@
using Magicodes.ExporterAndImporter.Excel;
using Magicodes.ExporterAndImporter.Excel.Utility;
using System;
using System.IO;
namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel;
public class AbpImportHelper<T> : ImportHelper<T> where T : class, new()
{
public AbpImportHelper(string? filePath = null, string? labelingFilePath = null)
: base(filePath, labelingFilePath)
{
}
public AbpImportHelper(Stream stream, Stream? labelingFileStream)
: base(stream, labelingFileStream)
{
}
internal void ConfigureExcelImportSettings(Action<ExcelImporterAttribute>? excelImportSettingsConfig)
{
excelImportSettingsConfig?.Invoke(ExcelImporterSettings);
}
}

62
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelExporterProvider.cs

@ -0,0 +1,62 @@
using Magicodes.ExporterAndImporter.Excel;
using Magicodes.ExporterAndImporter.Excel.Utility;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel;
public class MagicodesIEExcelExporterProvider : IExporterProvider, ITransientDependency
{
private readonly AbpExporterMagicodesIEExcelOptions _options;
private readonly IExcelExporter _excelExporter;
public MagicodesIEExcelExporterProvider(IOptions<AbpExporterMagicodesIEExcelOptions> options)
{
_options = options.Value;
}
public async virtual Task<Stream> ExportAsync<T>(ICollection<T> data, CancellationToken cancellationToken = default)
where T : class, new()
{
var fileBytes = new List<byte>();
var exportHelper = new ExportHelper<T>();
// 由于Microsoft.IE.Excel官方此接口未暴露用户配置,做一次转换
if (_options.ExportSettingMapping.TryGetValue(typeof(T), out var exportSetting))
{
exportSetting?.Invoke(exportHelper.ExcelExporterSettings);
}
if (exportHelper.ExcelExporterSettings.MaxRowNumberOnASheet > 0 && data.Count > exportHelper.ExcelExporterSettings.MaxRowNumberOnASheet)
{
using (exportHelper.CurrentExcelPackage)
{
var num = data.Count / exportHelper.ExcelExporterSettings.MaxRowNumberOnASheet + ((data.Count % exportHelper.ExcelExporterSettings.MaxRowNumberOnASheet > 0) ? 1 : 0);
for (var i = 0; i < num; i++)
{
var dataItems2 = data.Skip(i * exportHelper.ExcelExporterSettings.MaxRowNumberOnASheet).Take(exportHelper.ExcelExporterSettings.MaxRowNumberOnASheet).ToList();
exportHelper.AddExcelWorksheet();
exportHelper.Export(dataItems2);
}
fileBytes.AddRange(await exportHelper.CurrentExcelPackage.GetAsByteArrayAsync());
}
}
else
{
using var excelPackage2 = exportHelper.Export(data);
fileBytes.AddRange(await excelPackage2.GetAsByteArrayAsync());
}
var memoryStream = new MemoryStream([.. fileBytes]);
memoryStream.Seek(0, SeekOrigin.Begin);
return memoryStream;
}
}

74
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/LINGYUN/Abp/Exporter/MagicodesIEExcelImporterProvider.cs

@ -0,0 +1,74 @@
using Magicodes.ExporterAndImporter.Core.Models;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Json;
namespace LINGYUN.Abp.Exporter.MagicodesIE.Excel;
public class MagicodesIEExcelImporterProvider : IImporterProvider, ITransientDependency
{
public ILogger<MagicodesIEExcelImporterProvider> Logger { protected get; set; }
private readonly AbpExporterMagicodesIEExcelOptions _options;
private readonly IJsonSerializer _jsonSerializer;
private readonly IExcelImporter _excelImporter;
public MagicodesIEExcelImporterProvider(
IJsonSerializer jsonSerializer,
IExcelImporter excelImporter,
IOptions<AbpExporterMagicodesIEExcelOptions> options)
{
_jsonSerializer = jsonSerializer;
_excelImporter = excelImporter;
_options = options.Value;
Logger = NullLogger<MagicodesIEExcelImporterProvider>.Instance;
}
public async virtual Task<IReadOnlyCollection<T>> ImportAsync<T>(Stream stream) where T : class, new()
{
using var importHelper = new AbpImportHelper<T>(stream, null);
// 由于Microsoft.IE.Excel官方此接口未暴露用户配置,做一次转换
if (_options.ImportSettingMapping.TryGetValue(typeof(T), out var importSetting))
{
importHelper.ConfigureExcelImportSettings(importSetting);
}
var importResult = await importHelper.Import(null, null);
ThrowImportException(importResult);
return importResult.Data.ToImmutableList();
}
protected virtual void ThrowImportException<T>(ImportResult<T> importResult) where T : class, new()
{
if (importResult.HasError)
{
if (importResult.RowErrors.Count > 0)
{
var errorJson = _jsonSerializer.Serialize(importResult.RowErrors);
Logger.LogWarning("Row validation error occurred during data import process, details: {errorJson}", errorJson);
}
if (importResult.TemplateErrors.Count > 0)
{
var errorJson = _jsonSerializer.Serialize(importResult.TemplateErrors);
Logger.LogWarning("Template validation error occurred during data import process, details: {errorJson}", errorJson);
}
throw new BusinessException(
code: ExporterErrorCodes.ImportDataError,
innerException: importResult.Exception);
}
}
}

41
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MagicodesIE.Excel/README.md

@ -0,0 +1,41 @@
# LINGYUN.Abp.Exporter.MagicodesIE.Excel
数据导出接口的 [Magicodes.IE.Excel](https://github.com/dotnetcore/Magicodes.IE) 实现
Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
详情请参考 [Magicodes.IE.Excel 文档](https://github.com/dotnetcore/Magicodes.IE/blob/master/docs/2.%E5%9F%BA%E7%A1%80%E6%95%99%E7%A8%8B%E4%B9%8B%E5%AF%BC%E5%87%BAExcel.md)
## 配置使用
```csharp
[DependsOn(
typeof(AbpExporterMagicodesIEExcelModule)
)]
public class YouProjectModule : AbpModule
{
Configure<AbpExporterMagicodesIEExcelOptions>(options =>
{
// 配置类型数据导出
options.MapExportSetting(typeof(DemoClass), config =>
{
// 表头位置从第二行开始
config.HeaderRowIndex = 2;
// 其他配置
});
});
}
public class DemoClass
{
public string Name { get; set; }
public string Remarks { get; set; }
public DemoClass()
{
}
}
```

3
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

25
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN.Abp.Exporter.MiniExcel.csproj

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.Exporter.MiniExcel</AssemblyName>
<PackageId>LINGYUN.Abp.Exporter.MiniExcel</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Nullable>enable</Nullable>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MiniExcel" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.Exporter.Core\LINGYUN.Abp.Exporter.Core.csproj" />
</ItemGroup>
</Project>

22
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelModule.cs

@ -0,0 +1,22 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Exporter.MiniExcel;
[DependsOn(typeof(AbpExporterCoreModule))]
public class AbpExporterMiniExcelModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.Replace(
ServiceDescriptor.Transient(
typeof(IExporterProvider),
typeof(MiniExcelExporterProvider)));
context.Services.Replace(
ServiceDescriptor.Transient(
typeof(IImporterProvider),
typeof(MiniExcelImporterProvider)));
}
}

25
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/AbpExporterMiniExcelOptions.cs

@ -0,0 +1,25 @@
using MiniExcelLibs.OpenXml;
using System;
using System.Collections.Generic;
namespace LINGYUN.Abp.Exporter.MiniExcel;
public class AbpExporterMiniExcelOptions
{
public IDictionary<Type, Action<OpenXmlConfiguration>> ExportSettingMapping { get; }
public IDictionary<Type, Action<OpenXmlConfiguration>> ImportSettingMapping { get; }
public AbpExporterMiniExcelOptions()
{
ExportSettingMapping = new Dictionary<Type, Action<OpenXmlConfiguration>>();
ImportSettingMapping = new Dictionary<Type, Action<OpenXmlConfiguration>>();
}
public void MapExportSetting(Type dataType, Action<OpenXmlConfiguration> settingMapping)
{
ExportSettingMapping[dataType] = settingMapping;
}
public void MapImportSetting(Type dataType, Action<OpenXmlConfiguration> settingMapping)
{
ImportSettingMapping[dataType] = settingMapping;
}
}

41
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelExporterProvider.cs

@ -0,0 +1,41 @@
using Microsoft.Extensions.Options;
using MiniExcelLibs;
using MiniExcelLibs.OpenXml;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Exporter.MiniExcel;
public class MiniExcelExporterProvider : IExporterProvider, ITransientDependency
{
private readonly AbpExporterMiniExcelOptions _options;
public MiniExcelExporterProvider(IOptions<AbpExporterMiniExcelOptions> options)
{
_options = options.Value;
}
public async virtual Task<Stream> ExportAsync<T>(ICollection<T> data, CancellationToken cancellationToken = default)
where T : class, new()
{
var memoryStream = new MemoryStream();
var xmlConfig = new OpenXmlConfiguration();
if (_options.ExportSettingMapping.TryGetValue(typeof(T), out var exportSetting))
{
exportSetting?.Invoke(xmlConfig);
}
await memoryStream.SaveAsAsync(
value: data,
excelType: ExcelType.XLSX,
configuration: xmlConfig,
cancellationToken: cancellationToken);
memoryStream.Seek(0, SeekOrigin.Begin);
return memoryStream;
}
}

35
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/LINGYUN/Abp/Exporter/MiniExcelImporterProvider.cs

@ -0,0 +1,35 @@
using Microsoft.Extensions.Options;
using MiniExcelLibs;
using MiniExcelLibs.OpenXml;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.Exporter.MiniExcel;
public class MiniExcelImporterProvider : IImporterProvider, ITransientDependency
{
private readonly AbpExporterMiniExcelOptions _options;
public MiniExcelImporterProvider(IOptions<AbpExporterMiniExcelOptions> options)
{
_options = options.Value;
}
public async virtual Task<IReadOnlyCollection<T>> ImportAsync<T>(Stream stream) where T : class, new()
{
var xmlConfig = new OpenXmlConfiguration();
if (_options.ExportSettingMapping.TryGetValue(typeof(T), out var exportSetting))
{
exportSetting?.Invoke(xmlConfig);
}
var dataList = await stream.QueryAsync<T>(
excelType: ExcelType.XLSX,
configuration: xmlConfig);
return dataList.ToImmutableList();
}
}

46
aspnet-core/framework/exporter/LINGYUN.Abp.Exporter.MiniExcel/README.md

@ -0,0 +1,46 @@
# LINGYUN.Abp.Exporter.MiniExcel
数据导出接口的 [MiniExcel](https://github.com/mini-software/MiniExcel) 实现
MiniExcel简单、高效避免OOM的.NET处理Excel查、写、填充数据工具。
目前主流框架大多需要将数据全载入到内存方便操作,但这会导致内存消耗问题,MiniExcel 尝试以 Stream 角度写底层算法逻辑,能让原本1000多MB占用降低到几MB,避免内存不够情况。
详情请参考 [MiniExcel 文档](https://github.com/mini-software/MiniExcel/blob/master/README.md)
## 配置使用
```csharp
[DependsOn(
typeof(AbpExporterMiniExcelModule)
)]
public class YouProjectModule : AbpModule
{
Configure<AbpExporterMiniExcelOptions>(options =>
{
// 配置类型数据导出
options.MapExportSetting(typeof(DemoClass), config =>
{
config.DynamicColumns = new[]
{
// 忽略Name字段
new DynamicExcelColumn(nameof(DemoClass.Name)){ Ignore = true },
// 其他配置
};
});
});
}
public class DemoClass
{
public string Name { get; set; }
public string Remarks { get; set; }
public DemoClass()
{
}
}
```

3
aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.Development.json

@ -52,7 +52,8 @@
"TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", "TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None", "Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None",
"Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None", "Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None",
"MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None" "MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None",
"Demo": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"
}, },
"DistributedLock": { "DistributedLock": {
"IsEnabled": true, "IsEnabled": true,

3
aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.json

@ -16,7 +16,8 @@
"TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None", "TaskManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None",
"Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None", "Workflow": "Server=127.0.0.1;Database=Workflow-V70;User Id=root;Password=123456;SslMode=None",
"Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None", "Notifications": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None",
"MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None" "MessageService": "Server=127.0.0.1;Database=Messages-V70;User Id=root;Password=123456;SslMode=None",
"Demo": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456;SslMode=None"
}, },
"StringEncryption": { "StringEncryption": {
"DefaultPassPhrase": "s46c5q55nxpeS8Ra", "DefaultPassPhrase": "s46c5q55nxpeS8Ra",

1
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj

@ -25,6 +25,7 @@
<ProjectReference Include="..\..\framework\auditing\LINGYUN.Abp.AuditLogging.EntityFrameworkCore\LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\framework\auditing\LINGYUN.Abp.AuditLogging.EntityFrameworkCore\LINGYUN.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj" /> <ProjectReference Include="..\..\framework\wechat\LINGYUN.Abp.WeChat\LINGYUN.Abp.WeChat.csproj" />
<ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" /> <ProjectReference Include="..\..\framework\common\LINGYUN.Abp.Data.DbMigrator\LINGYUN.Abp.Data.DbMigrator.csproj" />
<ProjectReference Include="..\..\modules\demo\LINGYUN.Abp.Demo.EntityFrameworkCore\LINGYUN.Abp.Demo.EntityFrameworkCore.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

5539
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240929080118_Add-Demo-Module.Designer.cs

File diff suppressed because it is too large

95
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/20240929080118_Add-Demo-Module.cs

@ -0,0 +1,95 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations
{
/// <inheritdoc />
public partial class AddDemoModule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Demo_Authors",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(64)", maxLength: 64, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
BirthDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ShortBio = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Demo_Authors", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Demo_Books",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(128)", maxLength: 128, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Type = table.Column<int>(type: "int", nullable: false),
PublishDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Price = table.Column<float>(type: "float", nullable: false),
AuthorId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ExtraProperties = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_Demo_Books", x => x.Id);
table.ForeignKey(
name: "FK_Demo_Books_Demo_Authors_AuthorId",
column: x => x.AuthorId,
principalTable: "Demo_Authors",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_Demo_Authors_Name",
table: "Demo_Authors",
column: "Name");
migrationBuilder.CreateIndex(
name: "IX_Demo_Books_AuthorId",
table: "Demo_Books",
column: "AuthorId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Demo_Books");
migrationBuilder.DropTable(
name: "Demo_Authors");
}
}
}

133
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/Migrations/SingleMigrationsDbContextModelSnapshot.cs

@ -24,6 +24,130 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
modelBuilder.Entity("LINGYUN.Abp.Demo.Authors.Author", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("BirthDate")
.HasColumnType("datetime(6)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)");
b.Property<string>("ShortBio")
.HasColumnType("longtext");
b.HasKey("Id");
b.HasIndex("Name");
b.ToTable("Demo_Authors", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.Demo.Books.Book", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<Guid>("AuthorId")
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.IsRequired()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<string>("ExtraProperties")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)");
b.Property<float>("Price")
.HasColumnType("float");
b.Property<DateTime>("PublishDate")
.HasColumnType("datetime(6)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("AuthorId");
b.ToTable("Demo_Books", (string)null);
});
modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -4967,6 +5091,15 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.Migrations
b.ToTable("AbpSettingDefinitions", (string)null); b.ToTable("AbpSettingDefinitions", (string)null);
}); });
modelBuilder.Entity("LINGYUN.Abp.Demo.Books.Book", b =>
{
b.HasOne("LINGYUN.Abp.Demo.Authors.Author", null)
.WithMany()
.HasForeignKey("AuthorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b =>
{ {
b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition")

5
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsDbContext.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.Demo.EntityFrameworkCore;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.MessageService.EntityFrameworkCore; using LINGYUN.Abp.MessageService.EntityFrameworkCore;
using LINGYUN.Abp.Notifications.EntityFrameworkCore; using LINGYUN.Abp.Notifications.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore; using LINGYUN.Abp.Saas.EntityFrameworkCore;
@ -48,5 +49,7 @@ public class SingleMigrationsDbContext : AbpDbContext<SingleMigrationsDbContext>
modelBuilder.ConfigureNotifications(); modelBuilder.ConfigureNotifications();
modelBuilder.ConfigureNotificationsDefinition(); modelBuilder.ConfigureNotificationsDefinition();
modelBuilder.ConfigureMessageService(); modelBuilder.ConfigureMessageService();
modelBuilder.ConfigureDemo();
} }
} }

51
aspnet-core/modules/caching-management/LINGYUN.Abp.CachingManagement.StackExchangeRedis/LINGYUN/Abp/CachingManagement/StackExchangeRedis/StackExchangeRedisCacheManager.cs

@ -19,7 +19,6 @@ namespace LINGYUN.Abp.CachingManagement.StackExchangeRedis;
[Dependency(ReplaceServices = true)] [Dependency(ReplaceServices = true)]
public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependency public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependency
{ {
private readonly static MethodInfo GetRedisDatabaseMethod;
private readonly static MethodInfo ConnectAsyncMethod; private readonly static MethodInfo ConnectAsyncMethod;
protected RedisCacheOptions RedisCacheOptions { get; } protected RedisCacheOptions RedisCacheOptions { get; }
@ -28,15 +27,11 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
protected IDistributedCache DistributedCache { get; } protected IDistributedCache DistributedCache { get; }
protected AbpRedisCache RedisCache => DistributedCache.As<AbpRedisCache>(); protected AbpRedisCache RedisCache => DistributedCache.As<AbpRedisCache>();
protected IDatabase RedisDatabase => GetRedisDatabase();
private IDatabase _redisDatabase;
static StackExchangeRedisCacheManager() static StackExchangeRedisCacheManager()
{ {
var type = typeof(AbpRedisCache); var type = typeof(AbpRedisCache);
ConnectAsyncMethod = type.GetMethod("ConnectAsync", BindingFlags.Instance | BindingFlags.NonPublic); ConnectAsyncMethod = type.GetMethod("ConnectAsync", BindingFlags.Instance | BindingFlags.NonPublic);
GetRedisDatabaseMethod = type.GetMethod("GetRedisDatabase", BindingFlags.Instance | BindingFlags.NonPublic);
} }
public StackExchangeRedisCacheManager( public StackExchangeRedisCacheManager(
@ -53,7 +48,7 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
public async virtual Task<CackeKeysResponse> GetKeysAsync(GetCacheKeysRequest request, CancellationToken cancellationToken = default) public async virtual Task<CackeKeysResponse> GetKeysAsync(GetCacheKeysRequest request, CancellationToken cancellationToken = default)
{ {
await ConnectAsync(cancellationToken); var cache = await ConnectAsync(cancellationToken);
// 缓存键名规则: InstanceName + (t + TenantId)(CurrentTenant.IsAvailable) + CacheItemName + KeyPrefix + Key // 缓存键名规则: InstanceName + (t + TenantId)(CurrentTenant.IsAvailable) + CacheItemName + KeyPrefix + Key
// 缓存键名规则: InstanceName + (c:)(!CurrentTenant.IsAvailable) + CacheItemName + KeyPrefix + Key // 缓存键名规则: InstanceName + (c:)(!CurrentTenant.IsAvailable) + CacheItemName + KeyPrefix + Key
@ -75,17 +70,17 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
match += "c:*"; match += "c:*";
} }
// abp*t:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx*application* // abp*t:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx*application*
// abp*c:*application* // abp*c:application*
if (!CacheOptions.KeyPrefix.IsNullOrWhiteSpace()) if (!CacheOptions.KeyPrefix.IsNullOrWhiteSpace())
{ {
match += CacheOptions.KeyPrefix + "*"; match += CacheOptions.KeyPrefix.EnsureEndsWith('*');
} }
// app*abp*t:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx*application* // app*abp*t:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx*application*
// app*abp*c:*application* // app*abp*c:*application*
if (!request.Prefix.IsNullOrWhiteSpace()) if (!request.Prefix.IsNullOrWhiteSpace())
{ {
match = request.Prefix + "*" + match; match += request.Prefix.EnsureEndsWith('*') + match;
} }
// if filter is Mailing: // if filter is Mailing:
@ -93,14 +88,14 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
// app*abp*c:*application*Mailing* // app*abp*c:*application*Mailing*
if (!request.Filter.IsNullOrWhiteSpace()) if (!request.Filter.IsNullOrWhiteSpace())
{ {
match += request.Filter + "*"; match += request.Filter.EnsureStartsWith('*').EnsureEndsWith('*');
} }
// scan 0 match * count 50000 // scan 0 match * count 50000
// redis有自定义的key排序,由传递的marker来确定下一次检索起始位 // redis有自定义的key排序,由传递的marker来确定下一次检索起始位
var args = new object[] { request.Marker ?? "0", "match", match, "count", 50000 }; var args = new object[] { request.Marker ?? "0", "match", match, "count", 50000 };
var result = await RedisDatabase.ExecuteAsync("scan", args); var result = await cache.ExecuteAsync("scan", args);
var results = (RedisResult[])result; var results = (RedisResult[])result;
@ -119,19 +114,20 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
long size = 0; long size = 0;
var values = new Dictionary<string, object>(); var values = new Dictionary<string, object>();
var cache = await ConnectAsync(cancellationToken);
// type RedisKey // type RedisKey
var type = await RedisDatabase.KeyTypeAsync(key); var type = await cache.KeyTypeAsync(key);
// ttl RedisKey // ttl RedisKey
var ttl = await RedisDatabase.KeyTimeToLiveAsync(key); var ttl = await cache.KeyTimeToLiveAsync(key);
switch (type) switch (type)
{ {
case RedisType.Hash: case RedisType.Hash:
// hlen RedisKey // hlen RedisKey
size = await RedisDatabase.HashLengthAsync(key); size = await cache.HashLengthAsync(key);
// hscan RedisKey // hscan RedisKey
var hvalues = RedisDatabase.HashScan(key); await foreach (var hvalue in cache.HashScanAsync(key))
foreach (var hvalue in hvalues)
{ {
if (!hvalue.Name.IsNullOrEmpty) if (!hvalue.Name.IsNullOrEmpty)
{ {
@ -141,16 +137,16 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
break; break;
case RedisType.String: case RedisType.String:
// strlen RedisKey // strlen RedisKey
size = await RedisDatabase.StringLengthAsync(key); size = await cache.StringLengthAsync(key);
// get RedisKey // get RedisKey
var svalue = RedisDatabase.StringGet(key); var svalue = await cache.StringGetAsync(key);
values.Add("value", svalue.IsNullOrEmpty ? "" : svalue.ToString()); values.Add("value", svalue.IsNullOrEmpty ? "" : svalue.ToString());
break; break;
case RedisType.List: case RedisType.List:
// llen RedisKey // llen RedisKey
size = await RedisDatabase.ListLengthAsync(key); size = await cache.ListLengthAsync(key);
// lrange RedisKey // lrange RedisKey
var lvalues = RedisDatabase.ListRange(key); var lvalues = await cache.ListRangeAsync(key);
for (var lindex = 0; lindex < lvalues.Length; lindex++) for (var lindex = 0; lindex < lvalues.Length; lindex++)
{ {
if (!lvalues[lindex].IsNullOrEmpty) if (!lvalues[lindex].IsNullOrEmpty)
@ -228,21 +224,6 @@ public class StackExchangeRedisCacheManager : ICacheManager, ISingletonDependenc
protected virtual ValueTask<IDatabase> ConnectAsync(CancellationToken token = default) protected virtual ValueTask<IDatabase> ConnectAsync(CancellationToken token = default)
{ {
if (_redisDatabase != null)
{
return default;
}
return (ValueTask<IDatabase>)ConnectAsyncMethod.Invoke(RedisCache, new object[] { token }); return (ValueTask<IDatabase>)ConnectAsyncMethod.Invoke(RedisCache, new object[] { token });
} }
private IDatabase GetRedisDatabase()
{
if (_redisDatabase == null)
{
_redisDatabase = GetRedisDatabaseMethod.Invoke(RedisCache, null) as IDatabase;
}
return _redisDatabase;
}
} }

4
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs

@ -10,6 +10,10 @@ public class DataProtectionManagementApplicationMappingProfile :Profile
CreateMap<EntityPropertyInfo, EntityPropertyInfoDto>() CreateMap<EntityPropertyInfo, EntityPropertyInfoDto>()
.ForMember(dto => dto.ValueRange, map => map.MapFrom(src => MapToArray(src.ValueRange))); .ForMember(dto => dto.ValueRange, map => map.MapFrom(src => MapToArray(src.ValueRange)));
CreateMap<EntityTypeInfo, EntityTypeInfoDto>(); CreateMap<EntityTypeInfo, EntityTypeInfoDto>();
CreateMap<RoleEntityRule, RoleEntityRuleDto>()
.ForMember(dto => dto.AllowProperties, map => map.MapFrom(src => MapToArray(src.AllowProperties)));
CreateMap<OrganizationUnitEntityRule, OrganizationUnitEntityRuleDto>()
.ForMember(dto => dto.AllowProperties, map => map.MapFrom(src => MapToArray(src.AllowProperties)));
} }
private string[] MapToArray(string val) private string[] MapToArray(string val)

5
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationServiceBase.cs

@ -1,11 +1,12 @@
using Volo.Abp.Application.Services; using LINGYUN.Abp.DataProtection.Localization;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.DataProtectionManagement; namespace LINGYUN.Abp.DataProtectionManagement;
public abstract class DataProtectionManagementApplicationServiceBase : ApplicationService public abstract class DataProtectionManagementApplicationServiceBase : ApplicationService
{ {
protected DataProtectionManagementApplicationServiceBase() protected DataProtectionManagementApplicationServiceBase()
{ {
LocalizationResource = typeof(AbpDataProtectionManagementApplicationModule); LocalizationResource = typeof(DataProtectionResource);
ObjectMapperContext = typeof(AbpDataProtectionManagementApplicationModule); ObjectMapperContext = typeof(AbpDataProtectionManagementApplicationModule);
} }
} }

5
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/OrganizationUnitEntityRuleAppService.cs

@ -36,8 +36,8 @@ public class OrganizationUnitEntityRuleAppService : DataProtectionManagementAppl
{ {
throw new BusinessException(DataProtectionManagementErrorCodes.OrganizationUnitEntityRule.DuplicateEntityRule) throw new BusinessException(DataProtectionManagementErrorCodes.OrganizationUnitEntityRule.DuplicateEntityRule)
.WithData(nameof(OrganizationUnitEntityRule.OrgCode), input.OrgCode) .WithData(nameof(OrganizationUnitEntityRule.OrgCode), input.OrgCode)
.WithData(nameof(EntityTypeInfo.DisplayName), entityTypeInfo.DisplayName) .WithData(nameof(EntityTypeInfo.Name), entityTypeInfo.Name)
.WithData(nameof(EntityRuleBase.Operation), input.Operation); .WithData(nameof(EntityRuleBase.Operation), input.Operation.ToString());
} }
var entityRule = new OrganizationUnitEntityRule( var entityRule = new OrganizationUnitEntityRule(
@ -78,6 +78,7 @@ public class OrganizationUnitEntityRuleAppService : DataProtectionManagementAppl
{ {
entityRule.AllowProperties = allowPropertites; entityRule.AllowProperties = allowPropertites;
} }
entityRule.FilterGroup = input.FilterGroup;
entityRule = await _organizationUnitEntityRuleRepository.UpdateAsync(entityRule); entityRule = await _organizationUnitEntityRuleRepository.UpdateAsync(entityRule);

8
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/RoleEntityRuleAppService.cs

@ -34,10 +34,10 @@ public class RoleEntityRuleAppService : DataProtectionManagementApplicationServi
var entityTypeInfo = await _entityTypeInfoRepository.GetAsync(input.EntityTypeId); var entityTypeInfo = await _entityTypeInfoRepository.GetAsync(input.EntityTypeId);
if (await _roleEntityRuleRepository.FindEntityRuleAsync(input.RoleName, entityTypeInfo.TypeFullName, input.Operation) != null) if (await _roleEntityRuleRepository.FindEntityRuleAsync(input.RoleName, entityTypeInfo.TypeFullName, input.Operation) != null)
{ {
throw new BusinessException(DataProtectionManagementErrorCodes.OrganizationUnitEntityRule.DuplicateEntityRule) throw new BusinessException(DataProtectionManagementErrorCodes.RoleEntityRule.DuplicateEntityRule)
.WithData(nameof(RoleEntityRule.RoleName), input.RoleName) .WithData(nameof(RoleEntityRule.RoleName), input.RoleName)
.WithData(nameof(EntityTypeInfo.DisplayName), entityTypeInfo.DisplayName) .WithData(nameof(EntityTypeInfo.Name), entityTypeInfo.Name)
.WithData(nameof(EntityRuleBase.Operation), input.Operation); .WithData(nameof(EntityRuleBase.Operation), input.Operation.ToString());
} }
var entityRule = new RoleEntityRule( var entityRule = new RoleEntityRule(
@ -79,6 +79,8 @@ public class RoleEntityRuleAppService : DataProtectionManagementApplicationServi
entityRule.AllowProperties = allowPropertites; entityRule.AllowProperties = allowPropertites;
} }
entityRule.FilterGroup = input.FilterGroup;
entityRule = await _roleEntityRuleRepository.UpdateAsync(entityRule); entityRule = await _roleEntityRuleRepository.UpdateAsync(entityRule);
await CurrentUnitOfWork.SaveChangesAsync(); await CurrentUnitOfWork.SaveChangesAsync();

10
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN.Abp.DataProtectionManagement.Domain.Shared.csproj

@ -13,6 +13,16 @@
<RootNamespace /> <RootNamespace />
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\DataProtectionManagement\Localization\Resources\en.json" />
<None Remove="LINGYUN\Abp\DataProtectionManagement\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\DataProtectionManagement\Localization\Resources\en.json" />
<EmbeddedResource Include="LINGYUN\Abp\DataProtectionManagement\Localization\Resources\zh-Hans.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain.Shared" /> <PackageReference Include="Volo.Abp.Ddd.Domain.Shared" />
</ItemGroup> </ItemGroup>

26
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainSharedModule.cs

@ -1,10 +1,34 @@
using Volo.Abp.Domain; using LINGYUN.Abp.DataProtection;
using LINGYUN.Abp.DataProtection.Localization;
using Volo.Abp.Domain;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.DataProtectionManagement; namespace LINGYUN.Abp.DataProtectionManagement;
[DependsOn(typeof(AbpDddDomainSharedModule))] [DependsOn(typeof(AbpDddDomainSharedModule))]
[DependsOn(typeof(AbpDataProtectionAbstractionsModule))]
public class AbpDataProtectionManagementDomainSharedModule : AbpModule public class AbpDataProtectionManagementDomainSharedModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpDataProtectionManagementDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<DataProtectionResource>()
.AddVirtualJson("/LINGYUN/Abp/DataProtectionManagement/Localization/Resources");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace(DataProtectionManagementErrorCodes.Namespace, typeof(DataProtectionResource));
});
}
} }

8
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementErrorCodes.cs

@ -8,11 +8,11 @@ public static class DataProtectionManagementErrorCodes
{ {
public const string Prefix = Namespace + ":001"; public const string Prefix = Namespace + ":001";
/// <summary> /// <summary>
/// 已经存在相同的类型 /// 已经存在名为 {Name} 的实体类型定义
/// </summary> /// </summary>
public const string DuplicateTypeInfo = Prefix + "100"; public const string DuplicateTypeInfo = Prefix + "100";
/// <summary> /// <summary>
/// 已经存在相同的属性 /// 实体类型已经存在名为 {Name} 的属性定义
/// </summary> /// </summary>
public const string DuplicateProperty = Prefix + "200"; public const string DuplicateProperty = Prefix + "200";
} }
@ -21,7 +21,7 @@ public static class DataProtectionManagementErrorCodes
{ {
public const string Prefix = Namespace + ":002"; public const string Prefix = Namespace + ":002";
/// <summary> /// <summary>
/// 已经存在相同的实体数据访问规则 /// 已为角色 {RoleName} 分配了实体 {Name} 的 {Operation} 访问规则!
/// </summary> /// </summary>
public const string DuplicateEntityRule = Prefix + "100"; public const string DuplicateEntityRule = Prefix + "100";
} }
@ -30,7 +30,7 @@ public static class DataProtectionManagementErrorCodes
{ {
public const string Prefix = Namespace + ":003"; public const string Prefix = Namespace + ":003";
/// <summary> /// <summary>
/// 已经存在相同的实体数据访问规则 /// 已为组织机构 {OrgCode} 分配了实体 {Name} 的 {Operation} 访问规则!
/// </summary> /// </summary>
public const string DuplicateEntityRule = Prefix + "100"; public const string DuplicateEntityRule = Prefix + "100";
} }

9
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/Localization/Resources/en.json

@ -0,0 +1,9 @@
{
"culture": "en",
"texts": {
"DataProtectionManagement:001100": "There already exists an entity type definition named {Name}!",
"DataProtectionManagement:001200": "The entity type already has a property definition named {Name}!",
"DataProtectionManagement:002100": "The {Operation} access rule for entity {Name} has been assigned to role {RoleName}!",
"DataProtectionManagement:003100": "The {Operation} access rule for entity {Name} has been assigned to organization {RoleName}!"
}
}

9
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain.Shared/LINGYUN/Abp/DataProtectionManagement/Localization/Resources/zh-Hans.json

@ -0,0 +1,9 @@
{
"culture": "zh-Hans",
"texts": {
"DataProtectionManagement:001100": "已经存在名为 {Name} 的实体类型定义!",
"DataProtectionManagement:001200": "实体类型已经存在名为 {Name} 的属性定义!",
"DataProtectionManagement:002100": "已为角色 {RoleName} 分配了实体 {Name} 的 {Operation} 访问规则!",
"DataProtectionManagement:003100": "已为组织机构 {OrgCode} 分配了实体 {Name} 的 {Operation} 访问规则!"
}
}

7
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs

@ -1,6 +1,8 @@
using LINGYUN.Abp.DataProtection; using LINGYUN.Abp.DataProtection;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Volo.Abp.Caching;
using Volo.Abp.Domain; using Volo.Abp.Domain;
using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
@ -35,6 +37,11 @@ public class AbpDataProtectionManagementDomainModule : AbpModule
options.AutoEventSelectors.Add<OrganizationUnitEntityRule>(); options.AutoEventSelectors.Add<OrganizationUnitEntityRule>();
}); });
Configure<AbpDistributedCacheOptions>(options =>
{
options.ConfigureCache<DataProtectedResourceCacheItem>(new DistributedCacheEntryOptions());
});
context.Services.AddHostedService<ProtectedEntitiesSaverService>(); context.Services.AddHostedService<ProtectedEntitiesSaverService>();
} }
} }

2
aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/ProtectedEntitiesSaver.cs

@ -67,7 +67,7 @@ public class ProtectedEntitiesSaver : IProtectedEntitiesSaver, ITransientDepende
var newRecords = new List<EntityTypeInfo>(); var newRecords = new List<EntityTypeInfo>();
var changeRecords = new List<EntityTypeInfo>(); var changeRecords = new List<EntityTypeInfo>();
var entityTypeList = await EntityTypeInfoRepository.GetListAsync(); var entityTypeList = await EntityTypeInfoRepository.GetListAsync(includeDetails: true);
foreach (var protectedEntityMap in ManagementOptions.ProtectedEntities) foreach (var protectedEntityMap in ManagementOptions.ProtectedEntities)
{ {
var resourceType = protectedEntityMap.Key; var resourceType = protectedEntityMap.Key;

3
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

30
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

27
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN.Abp.Demo.Application.Contracts.csproj

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Authorization.Abstractions" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\framework\exporter\LINGYUN.Abp.Exporter.Application.Contracts\LINGYUN.Abp.Exporter.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Demo.Domain.Shared\LINGYUN.Abp.Demo.Domain.Shared.csproj" />
</ItemGroup>
</Project>

15
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/AbpDemoApplicationContractsModule.cs

@ -0,0 +1,15 @@
using LINGYUN.Abp.Exporter;
using Volo.Abp.Application;
using Volo.Abp.Authorization;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Demo;
[DependsOn(
typeof(AbpExporterApplicationContractsModule),
typeof(AbpAuthorizationAbstractionsModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpDemoDomainSharedModule))]
public class AbpDemoApplicationContractsModule : AbpModule
{
}

12
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/AuthorDto.cs

@ -0,0 +1,12 @@
using System;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Demo.Authors;
public class AuthorDto : EntityDto<Guid>
{
public string Name { get; set; }
public DateTime BirthDate { get; set; }
public string? ShortBio { get; set; }
}

15
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/CreateAuthorDto.cs

@ -0,0 +1,15 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.Demo.Authors;
public class CreateAuthorDto
{
[Required]
[StringLength(AuthorConsts.MaxNameLength)]
public string Name { get; set; }
[Required]
public DateTime BirthDate { get; set; }
public string? ShortBio { get; set; }
}

7
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/GetAuthorListDto.cs

@ -0,0 +1,7 @@
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Demo.Authors;
public class GetAuthorListDto : PagedAndSortedResultRequestDto
{
public string? Filter { get; set; }
}

18
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/IAuthorAppService.cs

@ -0,0 +1,18 @@
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace LINGYUN.Abp.Demo.Authors;
public interface IAuthorAppService : IApplicationService
{
Task<AuthorDto> GetAsync(Guid id);
Task<PagedResultDto<AuthorDto>> GetListAsync(GetAuthorListDto input);
Task<AuthorDto> CreateAsync(CreateAuthorDto input);
Task UpdateAsync(Guid id, UpdateAuthorDto input);
Task DeleteAsync(Guid id);
}

15
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Authors/UpdateAuthorDto.cs

@ -0,0 +1,15 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace LINGYUN.Abp.Demo.Authors;
public class UpdateAuthorDto
{
[Required]
[StringLength(AuthorConsts.MaxNameLength)]
public string Name { get; set; }
[Required]
public DateTime BirthDate { get; set; }
public string ShortBio { get; set; }
}

8
aspnet-core/modules/demo/LINGYUN.Abp.Demo.Application.Contracts/LINGYUN/Abp/Demo/Books/AuthorLookupDto.cs

@ -0,0 +1,8 @@
using System;
using Volo.Abp.Application.Dtos;
namespace LINGYUN.Abp.Demo.Books;
public class AuthorLookupDto : EntityDto<Guid>
{
public string Name { get; set; }
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save