From 0c80eb485cf23f93b75d32871b0d54d937fe607a Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 18 Feb 2025 11:07:48 +0800 Subject: [PATCH 1/2] feat: add Gdpr module --- .../LINGYUN.MicroService.SingleProject.sln | 52 + ...20250217124909_Add-Gdpr-Module.Designer.cs | 6307 +++++++++++++++++ .../20250217124909_Add-Gdpr-Module.cs | 77 + .../SingleMigrationsDbContextModelSnapshot.cs | 76 + .../RolePermissionDataSeedContributor.cs | 2 +- ...ications.Single.EntityFrameworkCore.csproj | 5 +- .../SingleDbMigrationEventHandler.cs | 10 +- .../SingleMigrationsDbContext.cs | 2 + ...ngleMigrationsEntityFrameworkCoreModule.cs | 2 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ...GYUN.Abp.Gdpr.Application.Contracts.csproj | 26 + .../Gdpr/AbpGdprApplicationContractsModule.cs | 14 + .../Abp/Gdpr/GdprRemoteServiceConsts.cs | 6 + .../LINGYUN/Abp/Gdpr/GdprRequestDto.cs | 11 + .../Abp/Gdpr/GdprRequestGetListInput.cs | 9 + .../Abp/Gdpr/IGdprRequestAppService.cs | 50 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../LINGYUN.Abp.Gdpr.Application.csproj | 28 + .../Abp/Gdpr/AbpGdprApplicationModule.cs | 26 + .../Abp/Gdpr/GdprApplicationMapperProfile.cs | 10 + .../Abp/Gdpr/GdprApplicationServiceBase.cs | 12 + .../LINGYUN/Abp/Gdpr/GdprRequestAppService.cs | 211 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../LINGYUN.Abp.Gdpr.Domain.Identity.csproj | 27 + .../Identity/AbpGdprDomainIdentityModule.cs | 36 + .../AbpGdprIdentityUserAccountProvider.cs | 27 + .../AbpGdprIdentityUserDataProvider.cs | 67 + .../Identity/Localization/Resources/en.json | 14 + .../Localization/Resources/zh-Hans.json | 14 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../LINGYUN.Abp.Gdpr.Domain.Shared.csproj | 28 + .../Abp/Gdpr/AbpGdprDomainSharedModule.cs | 38 + .../LINGYUN/Abp/Gdpr/GdprErrorCodes.cs | 14 + .../LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs | 17 + .../LINGYUN/Abp/Gdpr/GdprInfoConsts.cs | 6 + .../LINGYUN/Abp/Gdpr/GdprRequestCacheItem.cs | 33 + .../GdprUserAccountDeletionRequestedEto.cs | 12 + .../Abp/Gdpr/Localization/GdprResource.cs | 8 + .../Abp/Gdpr/Localization/Resources/en.json | 31 + .../Gdpr/Localization/Resources/zh-Hans.json | 31 + .../LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xml | 3 + .../LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xsd | 30 + .../LINGYUN.Abp.Gdpr.Domain.csproj | 26 + .../Abp/Gdpr/AbpCookieConsentOptions.cs | 44 + .../LINGYUN/Abp/Gdpr/AbpGdprDomainModule.cs | 29 + .../LINGYUN/Abp/Gdpr/AbpGdprOptions.cs | 40 + .../LINGYUN/Abp/Gdpr/GdprDbProterties.cs | 10 + .../Abp/Gdpr/GdprDeleteUserAccountContext.cs | 10 + .../Abp/Gdpr/GdprDeleteUserDataContext.cs | 10 + .../Abp/Gdpr/GdprDomainMapperProfile.cs | 10 + .../LINGYUN/Abp/Gdpr/GdprInfo.cs | 43 + .../Abp/Gdpr/GdprPrepareUserDataContext.cs | 11 + .../LINGYUN/Abp/Gdpr/GdprRequest.cs | 66 + .../Abp/Gdpr/GdprUserAccountProviderBase.cs | 10 + .../Gdpr/GdprUserDataPreparedEventHandler.cs | 38 + .../Abp/Gdpr/GdprUserDataProviderBase.cs | 33 + .../Gdpr/GdprUserDataRequestedEventHandler.cs | 71 + .../Abp/Gdpr/IGdprRequestRepository.cs | 26 + .../Abp/Gdpr/IGdprUserAccountProvider.cs | 19 + .../LINGYUN/Abp/Gdpr/IGdprUserDataProvider.cs | 24 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ...INGYUN.Abp.Gdpr.EntityFrameworkCore.csproj | 25 + .../AbpGdprEntityFrameworkCoreModule.cs | 22 + .../EfCoreGdprRequestRepository.cs | 52 + .../Gdpr/EntityFrameworkCore/GdprDbContext.cs | 19 + .../GdprDbContextModelCreatingExtensions.cs | 54 + .../GdprModelBuilderConfigurationOptions.cs | 10 + .../EntityFrameworkCore/IGdprDbContext.cs | 11 + .../LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xml | 3 + .../LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xsd | 30 + .../LINGYUN.Abp.Gdpr.HttpApi.csproj | 25 + .../LINGYUN/Abp/Gdpr/AbpGdprHttpApiModule.cs | 41 + .../LINGYUN/Abp/Gdpr/GdprRequestController.cs | 69 + .../GlobalUsings.cs | 1 - ...LY.MicroService.Applications.Single.csproj | 8 +- .../MicroServiceApplicationsSingleModule.cs | 13 + 81 files changed, 8428 insertions(+), 12 deletions(-) create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.Designer.cs create mode 100644 aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN.Abp.Gdpr.Application.Contracts.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/AbpGdprApplicationContractsModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRemoteServiceConsts.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestDto.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestGetListInput.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/IGdprRequestAppService.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN.Abp.Gdpr.Application.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/AbpGdprApplicationModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationMapperProfile.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationServiceBase.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprRequestAppService.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN.Abp.Gdpr.Domain.Identity.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprDomainIdentityModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserDataProvider.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/en.json create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/zh-Hans.json create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN.Abp.Gdpr.Domain.Shared.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/AbpGdprDomainSharedModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprErrorCodes.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoConsts.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprRequestCacheItem.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprUserAccountDeletionRequestedEto.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/GdprResource.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/en.json create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/zh-Hans.json create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN.Abp.Gdpr.Domain.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpCookieConsentOptions.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprDomainModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprOptions.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDbProterties.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserAccountContext.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserDataContext.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDomainMapperProfile.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprPrepareUserDataContext.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprRequest.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserAccountProviderBase.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataPreparedEventHandler.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataProviderBase.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataRequestedEventHandler.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprRequestRepository.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserAccountProvider.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserDataProvider.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN.Abp.Gdpr.EntityFrameworkCore.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/AbpGdprEntityFrameworkCoreModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/EfCoreGdprRequestRepository.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContext.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContextModelCreatingExtensions.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprModelBuilderConfigurationOptions.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/IGdprDbContext.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xml create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xsd create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN.Abp.Gdpr.HttpApi.csproj create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/AbpGdprHttpApiModule.cs create mode 100644 aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/GdprRequestController.cs diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 67b6de6b3..66b8ac06d 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -630,6 +630,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Platform.HttpApi.Cl EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Emailing.Platform", "modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj", "{9D357D4C-532A-4ADC-9CCB-C95B4E033547}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gdpr", "gdpr", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Domain", "modules\gdpr\LINGYUN.Abp.Gdpr.Domain\LINGYUN.Abp.Gdpr.Domain.csproj", "{C33DBB02-F788-4EE0-ABDD-22861FC40D79}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Domain.Shared", "modules\gdpr\LINGYUN.Abp.Gdpr.Domain.Shared\LINGYUN.Abp.Gdpr.Domain.Shared.csproj", "{E115487D-AAEF-4623-832B-94C14C79E991}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Application.Contracts", "modules\gdpr\LINGYUN.Abp.Gdpr.Application.Contracts\LINGYUN.Abp.Gdpr.Application.Contracts.csproj", "{67B2403C-FFC8-47C7-BD71-A9D730430024}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Application", "modules\gdpr\LINGYUN.Abp.Gdpr.Application\LINGYUN.Abp.Gdpr.Application.csproj", "{DA42E464-C824-461C-8D17-14FC2B293F65}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.HttpApi", "modules\gdpr\LINGYUN.Abp.Gdpr.HttpApi\LINGYUN.Abp.Gdpr.HttpApi.csproj", "{CDC0F589-D716-4FCE-9BBA-CD1A0B3D8409}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.EntityFrameworkCore", "modules\gdpr\LINGYUN.Abp.Gdpr.EntityFrameworkCore\LINGYUN.Abp.Gdpr.EntityFrameworkCore.csproj", "{57C95347-CF48-43DD-BFC9-597A43041AC5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Gdpr.Domain.Identity", "modules\gdpr\LINGYUN.Abp.Gdpr.Domain.Identity\LINGYUN.Abp.Gdpr.Domain.Identity.csproj", "{06FC3141-5F92-43A6-94C9-E2519EE9A91E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1664,6 +1680,34 @@ Global {9D357D4C-532A-4ADC-9CCB-C95B4E033547}.Debug|Any CPU.Build.0 = Debug|Any CPU {9D357D4C-532A-4ADC-9CCB-C95B4E033547}.Release|Any CPU.ActiveCfg = Release|Any CPU {9D357D4C-532A-4ADC-9CCB-C95B4E033547}.Release|Any CPU.Build.0 = Release|Any CPU + {C33DBB02-F788-4EE0-ABDD-22861FC40D79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C33DBB02-F788-4EE0-ABDD-22861FC40D79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C33DBB02-F788-4EE0-ABDD-22861FC40D79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C33DBB02-F788-4EE0-ABDD-22861FC40D79}.Release|Any CPU.Build.0 = Release|Any CPU + {E115487D-AAEF-4623-832B-94C14C79E991}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E115487D-AAEF-4623-832B-94C14C79E991}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E115487D-AAEF-4623-832B-94C14C79E991}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E115487D-AAEF-4623-832B-94C14C79E991}.Release|Any CPU.Build.0 = Release|Any CPU + {67B2403C-FFC8-47C7-BD71-A9D730430024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67B2403C-FFC8-47C7-BD71-A9D730430024}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67B2403C-FFC8-47C7-BD71-A9D730430024}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67B2403C-FFC8-47C7-BD71-A9D730430024}.Release|Any CPU.Build.0 = Release|Any CPU + {DA42E464-C824-461C-8D17-14FC2B293F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA42E464-C824-461C-8D17-14FC2B293F65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA42E464-C824-461C-8D17-14FC2B293F65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA42E464-C824-461C-8D17-14FC2B293F65}.Release|Any CPU.Build.0 = Release|Any CPU + {CDC0F589-D716-4FCE-9BBA-CD1A0B3D8409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDC0F589-D716-4FCE-9BBA-CD1A0B3D8409}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDC0F589-D716-4FCE-9BBA-CD1A0B3D8409}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDC0F589-D716-4FCE-9BBA-CD1A0B3D8409}.Release|Any CPU.Build.0 = Release|Any CPU + {57C95347-CF48-43DD-BFC9-597A43041AC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57C95347-CF48-43DD-BFC9-597A43041AC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57C95347-CF48-43DD-BFC9-597A43041AC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57C95347-CF48-43DD-BFC9-597A43041AC5}.Release|Any CPU.Build.0 = Release|Any CPU + {06FC3141-5F92-43A6-94C9-E2519EE9A91E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06FC3141-5F92-43A6-94C9-E2519EE9A91E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06FC3141-5F92-43A6-94C9-E2519EE9A91E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06FC3141-5F92-43A6-94C9-E2519EE9A91E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1970,6 +2014,14 @@ Global {A31C7F96-3AC6-44AF-B505-7D900C945291} = {F3449D35-8671-4BF6-8D1B-EFBB8AFD61DD} {6C9E816F-3ECD-4AD1-A592-C4EDA1F011A3} = {F3449D35-8671-4BF6-8D1B-EFBB8AFD61DD} {9D357D4C-532A-4ADC-9CCB-C95B4E033547} = {F3449D35-8671-4BF6-8D1B-EFBB8AFD61DD} + {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {0B58AA48-665A-443F-A6A8-751FB9629DAF} + {C33DBB02-F788-4EE0-ABDD-22861FC40D79} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {E115487D-AAEF-4623-832B-94C14C79E991} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {67B2403C-FFC8-47C7-BD71-A9D730430024} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {DA42E464-C824-461C-8D17-14FC2B293F65} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {CDC0F589-D716-4FCE-9BBA-CD1A0B3D8409} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {57C95347-CF48-43DD-BFC9-597A43041AC5} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} + {06FC3141-5F92-43A6-94C9-E2519EE9A91E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.Designer.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.Designer.cs new file mode 100644 index 000000000..1f824564c --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.Designer.cs @@ -0,0 +1,6307 @@ +// +using System; +using LY.MicroService.Applications.Single.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations +{ + [DbContext(typeof(SingleMigrationsDbContext))] + [Migration("20250217124909_Add-Gdpr-Module")] + partial class AddGdprModule + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("TypeFullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("TypeFullName"); + + b.Property("TypeInfoId") + .HasColumnType("char(36)"); + + b.Property("ValueRange") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("ValueRange"); + + b.HasKey("Id"); + + b.HasIndex("TypeInfoId", "TypeFullName"); + + b.ToTable("AbpAuthEntityProperties", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAuditEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("TypeFullName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("TypeFullName"); + + b.HasKey("Id"); + + b.HasIndex("TypeFullName"); + + b.ToTable("AbpAuthEntitites", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowProperties") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("AllowProperties"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("EntityTypeFullName") + .HasColumnType("longtext"); + + b.Property("EntityTypeId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FilterGroup") + .HasColumnType("longtext") + .HasColumnName("FilterGroup"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("OrgCode") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("OrgCode"); + + b.Property("OrgId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("AbpAuthOrganizationUnitEntityRules", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowProperties") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("AllowProperties"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("EntityTypeFullName") + .HasColumnType("longtext"); + + b.Property("EntityTypeId") + .HasColumnType("char(36)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FilterGroup") + .HasColumnType("longtext") + .HasColumnName("FilterGroup"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Operation") + .HasColumnType("int"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityTypeId"); + + b.ToTable("AbpAuthRoleEntityRules", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Demo.Authors.Author", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BirthDate") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuthorId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Price") + .HasColumnType("float"); + + b.Property("PublishDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("Demo_Books", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Data") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("Data"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Provider"); + + b.Property("RequestId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("RequestId"); + + b.ToTable("AbpGdprInfos", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ReadyTime") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpGdprRequests", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TwoLetterISOLanguageName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("TwoLetterISOLanguageName"); + + b.Property("UiCultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("UiCultureName"); + + b.HasKey("Id"); + + b.HasIndex("CultureName"); + + b.ToTable("AbpLocalizationLanguages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Resource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DefaultCultureName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DefaultCultureName"); + + b.Property("Description") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("DisplayName"); + + b.Property("Enable") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpLocalizationResources", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CultureName") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("CultureName"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Key"); + + b.Property("ResourceName") + .HasColumnType("longtext"); + + b.Property("Value") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)") + .HasColumnName("Value"); + + b.HasKey("Id"); + + b.HasIndex("Key"); + + b.ToTable("AbpLocalizationTexts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Age") + .HasColumnType("int"); + + b.Property("AvatarUrl") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Birthday") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastOnlineTime") + .HasColumnType("datetime(6)"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Sex") + .HasColumnType("int"); + + b.Property("Sign") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatFriend", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Black") + .HasColumnType("tinyint(1)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("DontDisturb") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrientId") + .HasColumnType("char(36)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("RemarkName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SpecialFocus") + .HasColumnType("tinyint(1)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "FrientId"); + + b.ToTable("AppUserChatFriends", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserChatSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("AllowAddFriend") + .HasColumnType("tinyint(1)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowReceiveMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("RequireAddFriendValition") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserChatSettings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Chat.UserMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("ReceiveUserId") + .HasColumnType("char(36)"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ReceiveUserId"); + + b.ToTable("AppUserMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.ChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Address") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("AdminUserId") + .HasColumnType("char(36)"); + + b.Property("AllowAnonymous") + .HasColumnType("tinyint(1)"); + + b.Property("AllowSendMessage") + .HasColumnType("tinyint(1)"); + + b.Property("AvatarUrl") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MaxUserCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)"); + + b.Property("Notice") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Tag") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AppChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupChatBlack", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("ShieldUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupChatBlacks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.GroupMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(1048576) + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("MessageId") + .HasColumnType("bigint"); + + b.Property("SendUserName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("State") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId"); + + b.ToTable("AppGroupMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserChatGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("GroupId") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "GroupId", "UserId"); + + b.ToTable("AppUserChatGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.MessageService.Groups.UserGroupCard", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsAdmin") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("NickName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("SilenceEnd") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AppUserGroupCards", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExpirationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationTypeName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("Severity") + .HasColumnType("tinyint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "NotificationName"); + + b.ToTable("AppNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionGroupRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitionGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.NotificationDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowSubscriptionToClients") + .HasColumnType("tinyint(1)"); + + b.Property("ContentType") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("DisplayName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("NotificationLifetime") + .HasColumnType("int"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Providers") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Template") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.ToTable("AppNotificationDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserNotification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.Property("ReadStatus") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationId") + .HasDatabaseName("IX_Tenant_User_Notification_Id"); + + b.ToTable("AppUserNotifications", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Notifications.UserSubscribe", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("NotificationName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasDefaultValue("/"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "UserId", "NotificationName") + .IsUnique() + .HasDatabaseName("IX_Tenant_User_Notification_Name"); + + b.ToTable("AppUserSubscribes", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Editions.Edition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.HasIndex("DisplayName"); + + b.ToTable("AbpEditions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisableTime") + .HasColumnType("datetime(6)"); + + b.Property("EditionId") + .HasColumnType("char(36)"); + + b.Property("EnableTime") + .HasColumnType("datetime(6)"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("NormalizedName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("EditionId"); + + b.HasIndex("Name"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpTenants", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("Paramters") + .HasColumnType("longtext") + .HasColumnName("Paramters"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("TK_BackgroundJobActions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobInfo", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("Args") + .HasColumnType("longtext") + .HasColumnName("Args"); + + b.Property("BeginTime") + .HasColumnType("datetime(6)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Cron") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("Cron"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Group"); + + b.Property("Interval") + .HasColumnType("int"); + + b.Property("IsAbandoned") + .HasColumnType("tinyint(1)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("JobType") + .HasColumnType("int"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastRunTime") + .HasColumnType("datetime(6)"); + + b.Property("LockTimeOut") + .HasColumnType("int"); + + b.Property("MaxCount") + .HasColumnType("int"); + + b.Property("MaxTryCount") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.Property("NextRunTime") + .HasColumnType("datetime(6)"); + + b.Property("NodeName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("NodeName"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Result") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Result"); + + b.Property("Source") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TriggerCount") + .HasColumnType("int"); + + b.Property("TryCount") + .HasColumnType("int"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Type"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Group"); + + b.ToTable("TK_BackgroundJobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TaskManagement.BackgroundJobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Exception") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Exception"); + + b.Property("JobGroup") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobGroup"); + + b.Property("JobId") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("JobId"); + + b.Property("JobName") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("JobName"); + + b.Property("JobType") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("JobType"); + + b.Property("Message") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)") + .HasColumnName("Message"); + + b.Property("RunTime") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("JobGroup", "JobName"); + + b.ToTable("TK_BackgroundJobLogs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasMaxLength(1048576) + .HasColumnType("longtext") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Culture") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Culture"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("DisplayName"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Name"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .HasDatabaseName("IX_Tenant_Text_Template_Name"); + + b.ToTable("AbpTextTemplates", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.TextTemplating.TextTemplateDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("DefaultCultureName") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("DefaultCultureName"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsInlineLocalized") + .HasColumnType("tinyint(1)"); + + b.Property("IsLayout") + .HasColumnType("tinyint(1)"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Layout") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("Layout"); + + b.Property("LocalizationResourceName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("LocalizationResourceName"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Name"); + + b.Property("RenderEngine") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RenderEngine"); + + b.HasKey("Id"); + + b.ToTable("AbpTextTemplateDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("RequiredFeatures") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhooks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("Data") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Data"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("WebhookName"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksEvents", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpWebhooksWebhookGroups", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("RequestHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("RequestHeaders"); + + b.Property("Response") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Response"); + + b.Property("ResponseHeaders") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("ResponseHeaders"); + + b.Property("ResponseStatusCode") + .HasColumnType("int"); + + b.Property("SendExactSameData") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("WebhookEventId") + .HasColumnType("char(36)"); + + b.Property("WebhookSubscriptionId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("WebhookEventId"); + + b.ToTable("AbpWebhooksSendAttempts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Description") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Description"); + + b.Property("Headers") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Headers"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)"); + + b.Property("Secret") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Secret"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.Property("TimeoutDuration") + .HasColumnType("int"); + + b.Property("WebhookUri") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("WebhookUri"); + + b.Property("Webhooks") + .HasMaxLength(2147483647) + .HasColumnType("longtext") + .HasColumnName("Webhooks"); + + b.HasKey("Id"); + + b.ToTable("AbpWebhooksSubscriptions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDatas", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowBeNull") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DefaultValue"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Description"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Name"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DataId"); + + b.HasIndex("Name"); + + b.ToTable("AppPlatformDataItems", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Feedbacks.Feedback", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Category") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Category"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformFeedbacks", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Feedbacks.FeedbackAttachment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("FeedbackId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("FeedbackId"); + + b.ToTable("AppPlatformFeedbackAttachments", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Feedbacks.FeedbackComment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Capacity") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Capacity"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("FeedbackId") + .HasColumnType("char(36)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("FeedbackId"); + + b.ToTable("AppPlatformFeedbackComments", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DataId") + .HasColumnType("char(36)"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformLayouts", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(23) + .HasColumnType("varchar(23)") + .HasColumnName("Code"); + + b.Property("Component") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Component"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LayoutId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("Redirect") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Redirect"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("RoleName"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleName", "MenuId"); + + b.ToTable("AppPlatformRoleMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserFavoriteMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AliasName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("AliasName"); + + b.Property("Color") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Color"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("Framework") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Framework"); + + b.Property("Icon") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Icon"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("Path") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Path"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserFavoriteMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Menus.UserMenu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("Startup") + .HasColumnType("tinyint(1)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "MenuId"); + + b.ToTable("AppPlatformUserMenus", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.EmailMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("BodyTransferEncoding") + .HasColumnType("int"); + + b.Property("CC") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("CC"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeliveryNotificationOptions") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("From") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("From"); + + b.Property("IsBodyHtml") + .HasColumnType("tinyint(1)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Normalize") + .HasColumnType("tinyint(1)"); + + b.Property("Priority") + .HasColumnType("int"); + + b.Property("Provider") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Provider"); + + b.Property("Reason") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Reason"); + + b.Property("Receiver") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Receiver"); + + b.Property("SendCount") + .HasColumnType("int"); + + b.Property("SendTime") + .HasColumnType("datetime(6)"); + + b.Property("Sender") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Sender"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Subject") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Subject"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformEmailMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.EmailMessageAttachment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("BlobName"); + + b.Property("MessageId") + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Name"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("MessageId"); + + b.ToTable("AppPlatformEmailMessageAttachments", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.EmailMessageHeader", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Key") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Key"); + + b.Property("MessageId") + .HasColumnType("char(36)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Value"); + + b.HasKey("Id"); + + b.HasIndex("MessageId"); + + b.ToTable("AppPlatformEmailMessageHeaders", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.SmsMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("Content"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Provider") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("Provider"); + + b.Property("Reason") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Reason"); + + b.Property("Receiver") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Receiver"); + + b.Property("SendCount") + .HasColumnType("int"); + + b.Property("SendTime") + .HasColumnType("datetime(6)"); + + b.Property("Sender") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Sender"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformSmsMessages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Description"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ForceUpdate") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("Note") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Note"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("Version"); + + b.HasKey("Id"); + + b.HasIndex("Name", "Version"); + + b.ToTable("AppPlatformPackages", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("Authors") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("Authors"); + + b.Property("ContentType") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ContentType"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DownloadCount") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("License") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("License"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("PackageId") + .HasColumnType("char(36)"); + + b.Property("SHA256") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SHA256"); + + b.Property("Size") + .HasColumnType("bigint"); + + b.Property("Summary") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)") + .HasColumnName("Summary"); + + b.Property("UpdatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Url"); + + b.HasKey("Id"); + + b.HasIndex("PackageId", "Name"); + + b.ToTable("AppPlatformPackageBlobs", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Platform.Portal.Enterprise", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Address") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Address"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("EnglishName") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("EnglishName"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LegalMan") + .HasMaxLength(60) + .HasColumnType("varchar(60)") + .HasColumnName("LegalMan"); + + b.Property("Logo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("Logo"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("Name"); + + b.Property("OrganizationCode") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("OrganizationCode"); + + b.Property("RegistrationCode") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("RegistrationCode"); + + b.Property("RegistrationDate") + .HasColumnType("datetime(6)"); + + b.Property("TaxCode") + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("TaxCode"); + + b.Property("TenantId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("AppPlatformEnterprises", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("longtext"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("char(36)") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("TenantName"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("char(36)") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime(6)") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditLogId") + .HasColumnType("char(36)") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime(6)") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint unsigned") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("char(36)"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EntityChangeId") + .HasColumnType("char(36)"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("varchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("SourceTenantId") + .HasColumnType("char(36)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("TargetTenantId") + .HasColumnType("char(36)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique(); + + b.ToTable("AbpLinkUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("tinyint(1)") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("tinyint(1)") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("varchar(96)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySession", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Device") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("DeviceInfo") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IpAddresses") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("LastAccessed") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("SignedIn") + .HasColumnType("datetime(6)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Device"); + + b.HasIndex("SessionId"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSessions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("tinyint(1)") + .HasColumnName("IsActive"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LastPasswordChangeTime") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("varchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("ShouldChangePasswordOnNextLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("varchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("SourceUserId") + .HasColumnType("char(36)"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("TargetUserId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("varchar(196)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("char(36)"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("varchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)") + .HasColumnName("DisplayName"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AllowedAccessTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiResourceId", "Key", "Value"); + + b.ToTable("IdentityServerApiResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiResourceId", "Scope"); + + b.ToTable("IdentityServerApiResourceScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiResourceSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ApiScopeId", "Type"); + + b.ToTable("IdentityServerApiScopeClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.Property("ApiScopeId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ApiScopeId", "Key", "Value"); + + b.ToTable("IdentityServerApiScopeProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("tinyint(1)"); + + b.Property("AllowOfflineAccess") + .HasColumnType("tinyint(1)"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("tinyint(1)"); + + b.Property("AllowRememberConsent") + .HasColumnType("tinyint(1)"); + + b.Property("AllowedIdentityTokenSigningAlgorithms") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("tinyint(1)"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("tinyint(1)"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("BackChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ClientClaimsPrefix") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("tinyint(1)"); + + b.Property("FrontChannelLogoutUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("PairWiseSubjectSalt") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ProtocolType") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("tinyint(1)"); + + b.Property("RequireConsent") + .HasColumnType("tinyint(1)"); + + b.Property("RequirePkce") + .HasColumnType("tinyint(1)"); + + b.Property("RequireRequestObject") + .HasColumnType("tinyint(1)"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("tinyint(1)"); + + b.Property("UserCodeType") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Origin") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("GrantType") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Provider") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("PostLogoutRedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "Key", "Value"); + + b.ToTable("IdentityServerClientProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("RedirectUri") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Scope") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Description") + .HasMaxLength(2000) + .HasColumnType("varchar(2000)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("DeviceCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("UserCode") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode"); + + b.ToTable("IdentityServerDeviceFlowCodes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsumedTime") + .HasColumnType("datetime(6)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .IsRequired() + .HasMaxLength(10000) + .HasColumnType("varchar(10000)"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Expiration") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.HasIndex("SubjectId", "SessionId", "Type"); + + b.ToTable("IdentityServerPersistedGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("varchar(1000)"); + + b.Property("DisplayName") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Emphasize") + .HasColumnType("tinyint(1)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Required") + .HasColumnType("tinyint(1)"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityResourceClaims", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.Property("IdentityResourceId") + .HasColumnType("char(36)"); + + b.Property("Key") + .HasMaxLength(250) + .HasColumnType("varchar(250)"); + + b.Property("Value") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.HasKey("IdentityResourceId", "Key", "Value"); + + b.ToTable("IdentityServerIdentityResourceProperties", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("ClientSecret") + .HasColumnType("longtext"); + + b.Property("ClientType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ClientUri") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ConsentType") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("JsonWebKeySet") + .HasColumnType("longtext"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("LogoUri") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("PostLogoutRedirectUris") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedirectUris") + .HasColumnType("longtext"); + + b.Property("Requirements") + .HasColumnType("longtext"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("OpenIddictApplications", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Scopes") + .HasColumnType("longtext"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictAuthorizations", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Scopes.OpenIddictScope", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("char(36)") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("char(36)") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime(6)") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("Descriptions") + .HasColumnType("longtext"); + + b.Property("DisplayName") + .HasColumnType("longtext"); + + b.Property("DisplayNames") + .HasColumnType("longtext"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime(6)") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("char(36)") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("Resources") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("OpenIddictScopes", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ApplicationId") + .HasColumnType("char(36)"); + + b.Property("AuthorizationId") + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Payload") + .HasColumnType("longtext"); + + b.Property("Properties") + .HasColumnType("longtext"); + + b.Property("RedemptionDate") + .HasColumnType("datetime(6)"); + + b.Property("ReferenceId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Status") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Subject") + .HasMaxLength(400) + .HasColumnType("varchar(400)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorizationId"); + + b.HasIndex("ReferenceId"); + + b.HasIndex("ApplicationId", "Status", "Subject", "Type"); + + b.ToTable("OpenIddictTokens", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint unsigned"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("TenantId") + .HasColumnType("char(36)") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("varchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey") + .IsUnique(); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("DefaultValue") + .HasMaxLength(2048) + .HasColumnType("varchar(2048)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("varchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("tinyint(1)"); + + b.Property("IsInherited") + .HasColumnType("tinyint(1)"); + + b.Property("IsVisibleToClients") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("Providers") + .HasMaxLength(1024) + .HasColumnType("varchar(1024)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityPropertyInfo", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "TypeInfo") + .WithMany("Properties") + .HasForeignKey("TypeInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.OrganizationUnitEntityRule", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityTypeInfo"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.RoleEntityRule", b => + { + b.HasOne("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", "EntityTypeInfo") + .WithMany() + .HasForeignKey("EntityTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("EntityTypeInfo"); + }); + + 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.Gdpr.GdprInfo", b => + { + b.HasOne("LINGYUN.Abp.Gdpr.GdprRequest", null) + .WithMany("Infos") + .HasForeignKey("RequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") + .WithMany() + .HasForeignKey("EditionId"); + + b.Navigation("Edition"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.TenantConnectionString", b => + { + b.HasOne("LINGYUN.Abp.Saas.Tenants.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", b => + { + b.HasOne("LINGYUN.Abp.WebhooksManagement.WebhookEventRecord", "WebhookEvent") + .WithOne() + .HasForeignKey("LINGYUN.Abp.WebhooksManagement.WebhookSendRecord", "WebhookEventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WebhookEvent"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b => + { + b.HasOne("LINGYUN.Platform.Datas.Data", null) + .WithMany("Items") + .HasForeignKey("DataId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Feedbacks.FeedbackAttachment", b => + { + b.HasOne("LINGYUN.Platform.Feedbacks.Feedback", null) + .WithMany("Attachments") + .HasForeignKey("FeedbackId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Feedbacks.FeedbackComment", b => + { + b.HasOne("LINGYUN.Platform.Feedbacks.Feedback", null) + .WithMany("Comments") + .HasForeignKey("FeedbackId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.EmailMessageAttachment", b => + { + b.HasOne("LINGYUN.Platform.Messages.EmailMessage", null) + .WithMany("Attachments") + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.EmailMessageHeader", b => + { + b.HasOne("LINGYUN.Platform.Messages.EmailMessage", null) + .WithMany("Headers") + .HasForeignKey("MessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.PackageBlob", b => + { + b.HasOne("LINGYUN.Platform.Packages.Package", "Package") + .WithMany("Blobs") + .HasForeignKey("PackageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Package"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Properties") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScopeProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiScopes.ApiScope", null) + .WithMany("Properties") + .HasForeignKey("ApiScopeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResourceProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("Properties") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + }); + + modelBuilder.Entity("Volo.Abp.OpenIddict.Tokens.OpenIddictToken", b => + { + b.HasOne("Volo.Abp.OpenIddict.Applications.OpenIddictApplication", null) + .WithMany() + .HasForeignKey("ApplicationId"); + + b.HasOne("Volo.Abp.OpenIddict.Authorizations.OpenIddictAuthorization", null) + .WithMany() + .HasForeignKey("AuthorizationId"); + }); + + modelBuilder.Entity("LINGYUN.Abp.DataProtectionManagement.EntityTypeInfo", b => + { + b.Navigation("Properties"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprRequest", b => + { + b.Navigation("Infos"); + }); + + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Feedbacks.Feedback", b => + { + b.Navigation("Attachments"); + + b.Navigation("Comments"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Messages.EmailMessage", b => + { + b.Navigation("Attachments"); + + b.Navigation("Headers"); + }); + + modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b => + { + b.Navigation("Blobs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Navigation("Properties"); + + b.Navigation("Scopes"); + + b.Navigation("Secrets"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiScopes.ApiScope", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Navigation("AllowedCorsOrigins"); + + b.Navigation("AllowedGrantTypes"); + + b.Navigation("AllowedScopes"); + + b.Navigation("Claims"); + + b.Navigation("ClientSecrets"); + + b.Navigation("IdentityProviderRestrictions"); + + b.Navigation("PostLogoutRedirectUris"); + + b.Navigation("Properties"); + + b.Navigation("RedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Navigation("Properties"); + + b.Navigation("UserClaims"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.cs new file mode 100644 index 000000000..34770744b --- /dev/null +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/20250217124909_Add-Gdpr-Module.cs @@ -0,0 +1,77 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migrations +{ + /// + public partial class AddGdprModule : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AbpGdprRequests", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + ReadyTime = table.Column(type: "datetime(6)", nullable: false), + ExtraProperties = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + ConcurrencyStamp = table.Column(type: "varchar(40)", maxLength: 40, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpGdprRequests", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "AbpGdprInfos", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RequestId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Data = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Provider = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_AbpGdprInfos", x => x.Id); + table.ForeignKey( + name: "FK_AbpGdprInfos_AbpGdprRequests_RequestId", + column: x => x.RequestId, + principalTable: "AbpGdprRequests", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_AbpGdprInfos_RequestId", + table: "AbpGdprInfos", + column: "RequestId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpGdprRequests_UserId", + table: "AbpGdprRequests", + column: "UserId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AbpGdprInfos"); + + migrationBuilder.DropTable( + name: "AbpGdprRequests"); + } + } +} diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs index 77af32daa..5f5a7515c 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/Migrations/SingleMigrationsDbContextModelSnapshot.cs @@ -399,6 +399,68 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migratio b.ToTable("Demo_Books", (string)null); }); + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Data") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("Data"); + + b.Property("Provider") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasColumnName("Provider"); + + b.Property("RequestId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("RequestId"); + + b.ToTable("AbpGdprInfos", (string)null); + }); + + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("varchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)") + .HasColumnName("CreationTime"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("ExtraProperties"); + + b.Property("ReadyTime") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpGdprRequests", (string)null); + }); + modelBuilder.Entity("LINGYUN.Abp.LocalizationManagement.Language", b => { b.Property("Id") @@ -5737,6 +5799,15 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migratio .IsRequired(); }); + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprInfo", b => + { + b.HasOne("LINGYUN.Abp.Gdpr.GdprRequest", null) + .WithMany("Infos") + .HasForeignKey("RequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => { b.HasOne("LINGYUN.Abp.Saas.Editions.Edition", "Edition") @@ -6113,6 +6184,11 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore.MySql.Migratio b.Navigation("Properties"); }); + modelBuilder.Entity("LINGYUN.Abp.Gdpr.GdprRequest", b => + { + b.Navigation("Infos"); + }); + modelBuilder.Entity("LINGYUN.Abp.Saas.Tenants.Tenant", b => { b.Navigation("ConnectionStrings"); diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/RolePermissionDataSeedContributor.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/RolePermissionDataSeedContributor.cs index 4c4bd0c00..4354910ed 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/RolePermissionDataSeedContributor.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/RolePermissionDataSeedContributor.cs @@ -44,7 +44,7 @@ public class RolePermissionDataSeedContributor : IDataSeedContributor await PermissionDataSeeder.SeedAsync( RolePermissionValueProvider.ProviderName, - "users", + "Users", new string[] { "Platform.Feedback.Create" }, context.TenantId); } diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj index 17fc25e76..a9216ee68 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/LY.MicroService.Applications.Single.EntityFrameworkCore.csproj @@ -24,11 +24,12 @@ - - + + + diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs index 7fa971af3..2aba407d4 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleDbMigrationEventHandler.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Data; using Volo.Abp.DistributedLocking; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EntityFrameworkCore.Migrations; @@ -48,7 +49,9 @@ public class SingleDbMigrationEventHandler : IJobStore jobStore, IJobScheduler jobScheduler, IOptions options) - : base("SingleDbMigrator", currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) + : base( + ConnectionStringNameAttribute.GetConnStringName(), + currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory) { GuidGenerator = guidGenerator; IdentityUserManager = identityUserManager; @@ -76,11 +79,6 @@ public class SingleDbMigrationEventHandler : protected async override Task AfterTenantCreated(TenantCreatedEto eventData, bool schemaMigrated) { - if (!schemaMigrated) - { - return; - } - using (CurrentTenant.Change(eventData.Id)) { await QueueBackgroundJobAsync(eventData); diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsDbContext.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsDbContext.cs index fb503d350..e5c3f1afa 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsDbContext.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsDbContext.cs @@ -1,5 +1,6 @@ using LINGYUN.Abp.DataProtectionManagement.EntityFrameworkCore; using LINGYUN.Abp.Demo.EntityFrameworkCore; +using LINGYUN.Abp.Gdpr.EntityFrameworkCore; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.MessageService.EntityFrameworkCore; using LINGYUN.Abp.Notifications.EntityFrameworkCore; @@ -52,6 +53,7 @@ public class SingleMigrationsDbContext : AbpDbContext modelBuilder.ConfigureMessageService(); modelBuilder.ConfigureDataProtectionManagement(); modelBuilder.ConfigureWebhooksManagement(); + modelBuilder.ConfigureGdpr(); modelBuilder.ConfigureDemo(); } diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs index 2207f8275..b1e964af5 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/SingleMigrationsEntityFrameworkCoreModule.cs @@ -1,5 +1,6 @@ using LINGYUN.Abp.AuditLogging.EntityFrameworkCore; using LINGYUN.Abp.Data.DbMigrator; +using LINGYUN.Abp.Gdpr.EntityFrameworkCore; using LINGYUN.Abp.Identity.EntityFrameworkCore; using LINGYUN.Abp.IdentityServer.EntityFrameworkCore; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; @@ -37,6 +38,7 @@ namespace LY.MicroService.Applications.Single.EntityFrameworkCore; typeof(AbpTextTemplatingEntityFrameworkCoreModule), typeof(WebhooksManagementEntityFrameworkCoreModule), typeof(TaskManagementEntityFrameworkCoreModule), + typeof(AbpGdprEntityFrameworkCoreModule), typeof(AbpWeChatModule), typeof(AbpDataDbMigratorModule) )] diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN.Abp.Gdpr.Application.Contracts.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN.Abp.Gdpr.Application.Contracts.csproj new file mode 100644 index 000000000..02b3eefc4 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN.Abp.Gdpr.Application.Contracts.csproj @@ -0,0 +1,26 @@ + + + + + + + netstandard2.0;netstandard2.1;net8.0;net9.0 + LINGYUN.Abp.Gdpr.Application.Contracts + LINGYUN.Abp.Gdpr.Application.Contracts + false + false + false + enable + + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/AbpGdprApplicationContractsModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/AbpGdprApplicationContractsModule.cs new file mode 100644 index 000000000..7cf9d0b41 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/AbpGdprApplicationContractsModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Application; +using Volo.Abp.Authorization; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Gdpr; + +[DependsOn( + typeof(AbpAuthorizationAbstractionsModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpGdprDomainSharedModule) + )] +public class AbpGdprApplicationContractsModule : AbpModule +{ +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRemoteServiceConsts.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRemoteServiceConsts.cs new file mode 100644 index 000000000..22cda4a2c --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRemoteServiceConsts.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.Gdpr; +public static class GdprRemoteServiceConsts +{ + public const string RemoteServiceName = "Gdpr"; + public const string ModuleName = "gdpr"; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestDto.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestDto.cs new file mode 100644 index 000000000..ebf4e457b --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestDto.cs @@ -0,0 +1,11 @@ +using System; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Auditing; + +namespace LINGYUN.Abp.Gdpr; + +public class GdprRequestDto : EntityDto, IHasCreationTime +{ + public DateTime CreationTime { get; set; } + public DateTime ReadyTime { get; set; } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestGetListInput.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestGetListInput.cs new file mode 100644 index 000000000..6c64b0c1d --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/GdprRequestGetListInput.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Application.Dtos; + +namespace LINGYUN.Abp.Gdpr; + +public class GdprRequestGetListInput : PagedAndSortedResultRequestDto +{ + public string? CreationTime { get; set; } + public string? ReadyTime { get; set; } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/IGdprRequestAppService.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/IGdprRequestAppService.cs new file mode 100644 index 000000000..70bed24e5 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application.Contracts/LINGYUN/Abp/Gdpr/IGdprRequestAppService.cs @@ -0,0 +1,50 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Content; + +namespace LINGYUN.Abp.Gdpr; + +public interface IGdprRequestAppService : IApplicationService +{ + /// + /// 获取个人数据请求详情 + /// + /// + /// + Task GetAsync(Guid id); + /// + /// 获取个人数据请求列表 + /// + /// + /// + Task> GetListAsync(GdprRequestGetListInput input); + /// + /// 下载已收集的用户数据 + /// + /// + /// + Task DownloadPersonalDataAsync(Guid requestId); + /// + /// 删除个人数据请求 + /// + /// + /// + Task DeleteAsync(Guid id); + /// + /// 准备用户数据 + /// + /// + Task PreparePersonalDataAsync(); + /// + /// 删除用户数据 + /// + /// + Task DeletePersonalDataAsync(); + /// + /// 删除用户账户 + /// + /// + Task DeletePersonalAccountAsync(); +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN.Abp.Gdpr.Application.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN.Abp.Gdpr.Application.csproj new file mode 100644 index 000000000..cc3d6aaf6 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN.Abp.Gdpr.Application.csproj @@ -0,0 +1,28 @@ + + + + + + + net9.0 + LINGYUN.Abp.Gdpr.Application + LINGYUN.Abp.Gdpr.Application + false + false + false + enable + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/AbpGdprApplicationModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/AbpGdprApplicationModule.cs new file mode 100644 index 000000000..72b562a04 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/AbpGdprApplicationModule.cs @@ -0,0 +1,26 @@ +using LINGYUN.Abp.Exporter; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Application; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Gdpr; + +[DependsOn( + typeof(AbpDddApplicationModule), + typeof(AbpGdprDomainModule), + typeof(AbpExporterCoreModule), + typeof(AbpGdprApplicationContractsModule) + )] +public class AbpGdprApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + + Configure(options => + { + options.AddMaps(validate: true); + }); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationMapperProfile.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationMapperProfile.cs new file mode 100644 index 000000000..e9b01cb4c --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationMapperProfile.cs @@ -0,0 +1,10 @@ +using AutoMapper; + +namespace LINGYUN.Abp.Gdpr; +public class GdprApplicationMapperProfile : Profile +{ + public GdprApplicationMapperProfile() + { + CreateMap(); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationServiceBase.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationServiceBase.cs new file mode 100644 index 000000000..a95bd0996 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprApplicationServiceBase.cs @@ -0,0 +1,12 @@ +using LINGYUN.Abp.Gdpr.Localization; +using Volo.Abp.Application.Services; + +namespace LINGYUN.Abp.Gdpr; +public abstract class GdprApplicationServiceBase : ApplicationService +{ + protected GdprApplicationServiceBase() + { + LocalizationResource = typeof(GdprResource); + ObjectMapperContext = typeof(AbpGdprApplicationModule); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprRequestAppService.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprRequestAppService.cs new file mode 100644 index 000000000..0d7f3e0c1 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Application/LINGYUN/Abp/Gdpr/GdprRequestAppService.cs @@ -0,0 +1,211 @@ +using LINGYUN.Abp.Exporter; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.Caching.Distributed; +using Microsoft.Extensions.Options; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Caching; +using Volo.Abp.Content; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Gdpr; +using Volo.Abp.Json; +using Volo.Abp.Users; + +namespace LINGYUN.Abp.Gdpr; + +[Authorize] +public class GdprRequestAppService( + IJsonSerializer jsonSerializer, + IExporterProvider exporterProvider, + IOptions gdprOptions, + IDistributedEventBus distributedEventBus, + IDistributedCache gdprRequestCache, + IGdprRequestRepository gdprRequestRepository +) : GdprApplicationServiceBase, + IGdprRequestAppService +{ + public async virtual Task DeleteAsync(Guid id) + { + var gdprRequest = await gdprRequestRepository.GetAsync(id); + + await gdprRequestRepository.DeleteAsync(gdprRequest); + } + + public async virtual Task DeletePersonalAccountAsync() + { + var userId = CurrentUser.GetId(); + + await DeletePersonalDataAsync(); + + await distributedEventBus.PublishAsync( + new GdprUserAccountDeletionRequestedEto() + { + UserId = userId, + }); + } + + public async virtual Task DeletePersonalDataAsync() + { + var userId = CurrentUser.GetId(); + + var specification = new Volo.Abp.Specifications.ExpressionSpecification(x => x.UserId == userId); + + var totalCount = await gdprRequestRepository.GetCountAsync(specification); + var gdprRequests = await gdprRequestRepository.GetListAsync(specification, maxResultCount: totalCount); + + await gdprRequestRepository.DeleteManyAsync(gdprRequests); + + await CurrentUnitOfWork!.SaveChangesAsync(); + + await distributedEventBus.PublishAsync( + new GdprUserDataDeletionRequestedEto() + { + UserId = userId, + }); + } + + public async virtual Task GetAsync(Guid id) + { + var gdprRequest = await gdprRequestRepository.GetAsync(id); + + return ObjectMapper.Map(gdprRequest); + } + + public async virtual Task> GetListAsync(GdprRequestGetListInput input) + { + Expression> expression = x => x.UserId == CurrentUser.GetId(); + + if (!input.CreationTime.IsNullOrWhiteSpace()) + { + var times = input.CreationTime.Split(';'); + if (times.Length >= 1 && DateTime.TryParse(times[0], out var beginCreationTime)) + { + expression = expression.And(x => x.CreationTime >= beginCreationTime); + } + if (times.Length >= 2 && DateTime.TryParse(times[1], out var endCreationTime)) + { + expression = expression.And(x => x.CreationTime <= endCreationTime); + } + } + if (!input.ReadyTime.IsNullOrWhiteSpace()) + { + var times = input.ReadyTime.Split(';'); + if (times.Length >= 1 && DateTime.TryParse(times[0], out var beginReadyTime)) + { + expression = expression.And(x => x.ReadyTime >= beginReadyTime); + } + if (times.Length >= 2 && DateTime.TryParse(times[1], out var endReadyTime)) + { + expression = expression.And(x => x.ReadyTime <= endReadyTime); + } + } + + var specification = new Volo.Abp.Specifications.ExpressionSpecification(expression); + + var totalCount = await gdprRequestRepository.GetCountAsync(specification); + var gdprRequests = await gdprRequestRepository.GetListAsync(specification, + input.Sorting, input.MaxResultCount, input.SkipCount); + + return new PagedResultDto(totalCount, + ObjectMapper.Map, List>(gdprRequests)); + } + + public async virtual Task DownloadPersonalDataAsync(Guid requestId) + { + var userId = CurrentUser.GetId(); + var cacheKey = GdprRequestCacheItem.CalculateCacheKey(userId, requestId); + var cacheItem = await gdprRequestCache.GetAsync(cacheKey); + if (cacheItem == null) + { + var gdprRequest = await gdprRequestRepository.GetAsync(requestId); + if (Clock.Now < gdprRequest.ReadyTime) + { + throw new BusinessException(GdprErrorCodes.DataNotPreparedYet) + .WithData(nameof(GdprRequest.ReadyTime), gdprRequest.ReadyTime.ToString("yyyy-MM-dd HH:mm:ss")); + } + + cacheItem = new GdprRequestCacheItem(userId, requestId) + { + Infos = gdprRequest.Infos.Select(x => new GdprInfoCacheItem(x.Provider, x.Data)).ToList() + }; + + await gdprRequestCache.SetAsync(cacheKey, cacheItem, new DistributedCacheEntryOptions + { + AbsoluteExpirationRelativeToNow = gdprOptions.Value.RequestTimeInterval + }); + } + + return await DownloadUserData(cacheItem); + } + + public async virtual Task PreparePersonalDataAsync() + { + var userId = CurrentUser.GetId(); + + await ValidationRequestTimeInterval(userId); + + var gdprRequest = new GdprRequest( + GuidGenerator.Create(), + userId, + Clock.Now.Add(gdprOptions.Value.MinutesForDataPreparation)); + + await gdprRequestRepository.InsertAsync(gdprRequest); + + await CurrentUnitOfWork!.SaveChangesAsync(); + + await distributedEventBus.PublishAsync( + new GdprUserDataRequestedEto() + { + RequestId = gdprRequest.Id, + UserId = gdprRequest.UserId, + }); + } + + protected async virtual Task DownloadUserData(GdprRequestCacheItem cacheItem) + { + var fileName = $"{L["PersonalData"]}.xlsx"; + + var emptyValue = !L["PersonalData:Empty"].ResourceNotFound ? L["PersonalData:Empty"] : "None"; + + var personalData = new List>(); + + foreach (var gdprInfo in cacheItem.Infos) + { + var gdprData = new Dictionary(); + var gdprInfoData = jsonSerializer.Deserialize>(gdprInfo.Data); + + foreach (var gdprDataItem in gdprInfoData) + { + // 导出数据本地化 + var gdprDataKey = gdprDataItem.Key; + var gdprDataLocalizaztionKey = L[$"PersonalData:{gdprDataKey.ToPascalCase()}"]; + if (!gdprDataLocalizaztionKey.ResourceNotFound) + { + gdprDataKey = gdprDataLocalizaztionKey.Value; + } + gdprData[gdprDataKey] = gdprDataItem.Value.IsNullOrWhiteSpace() ? emptyValue : gdprDataItem.Value; + } + personalData.Add(gdprData); + } + var stream = await exporterProvider.ExportAsync(personalData); + + return new RemoteStreamContent(stream, fileName); + } + + protected async Task ValidationRequestTimeInterval(Guid userId) + { + var latestRequestTime = await gdprRequestRepository.FindLatestRequestTimeAsync(userId); + if (latestRequestTime.HasValue && (Clock.Now - latestRequestTime) < gdprOptions.Value.RequestTimeInterval) + { + var nextRequestTime = latestRequestTime.Value.Add(gdprOptions.Value.RequestTimeInterval); + + throw new BusinessException(GdprErrorCodes.PersonalDataRequestAlreadyDays) + .WithData(nameof(AbpGdprOptions.RequestTimeInterval), nextRequestTime.ToString("yyyy-MM-dd HH:mm:ss")); + } + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN.Abp.Gdpr.Domain.Identity.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN.Abp.Gdpr.Domain.Identity.csproj new file mode 100644 index 000000000..14b0f9570 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN.Abp.Gdpr.Domain.Identity.csproj @@ -0,0 +1,27 @@ + + + + + + + net9.0 + LINGYUN.Abp.Gdpr.Domain.Identity + LINGYUN.Abp.Gdpr.Domain.Identity + false + false + false + enable + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprDomainIdentityModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprDomainIdentityModule.cs new file mode 100644 index 000000000..5e8741e2b --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprDomainIdentityModule.cs @@ -0,0 +1,36 @@ +using LINGYUN.Abp.Gdpr.Localization; +using LINGYUN.Abp.Identity; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace LINGYUN.Abp.Gdpr.Identity; + +[DependsOn( + typeof(AbpGdprDomainModule), + typeof(AbpIdentityDomainModule))] +public class AbpGdprDomainIdentityModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Get() + .AddVirtualJson("/LINGYUN/Abp/Gdpr/Identity/Localization/Resources"); + }); + + Configure(options => + { + // 用户数据提供者 + options.GdprUserDataProviders.Add(new AbpGdprIdentityUserDataProvider()); + // 用户账户提供者 + options.GdprUserAccountProviders.Add(new AbpGdprIdentityUserAccountProvider()); + }); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs new file mode 100644 index 000000000..6205471fe --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs @@ -0,0 +1,27 @@ +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.Identity; +using Volo.Abp.Uow; + +namespace LINGYUN.Abp.Gdpr.Identity; + +/// +/// 身份标识模块用户账户提供者 +/// +public class AbpGdprIdentityUserAccountProvider : GdprUserAccountProviderBase +{ + public const string ProviderName = "Identity"; + + public override string Name => ProviderName; + + [UnitOfWork] + public async override Task DeleteAsync(GdprDeleteUserAccountContext context) + { + var identityUserManager = context.ServiceProvider.GetRequiredService(); + + var identityUser = await identityUserManager.GetByIdAsync(context.UserId); + + (await identityUserManager.DeleteAsync(identityUser)).CheckErrors(); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserDataProvider.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserDataProvider.cs new file mode 100644 index 000000000..604440e0b --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserDataProvider.cs @@ -0,0 +1,67 @@ +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.ChangeTracking; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Gdpr; +using Volo.Abp.Identity; +using Volo.Abp.Users; + +namespace LINGYUN.Abp.Gdpr.Identity; + +/// +/// 身份标识模块用户数据提供者 +/// +public class AbpGdprIdentityUserDataProvider: GdprUserDataProviderBase +{ + public const string ProviderName = "Identity"; + + public override string Name => ProviderName; + + public async override Task DeleteAsync(GdprDeleteUserDataContext context) + { + var identityUserRepository = context.ServiceProvider.GetRequiredService(); + var identityUserManager = context.ServiceProvider.GetRequiredService(); + + var identityUser = await identityUserManager.GetByIdAsync(context.UserId); + + identityUser.Name = ""; + identityUser.Surname = ""; + identityUser.SetIsActive(false); + + await identityUserRepository.EnsureCollectionLoadedAsync(identityUser, u => u.Claims); + + identityUser.Claims.Clear(); + + // TODO: 应设置为空字符串, 但是abp框架不允许Email为空 + (await identityUserManager.SetEmailAsync(identityUser, $"{identityUser.UserName}@abp.io")).CheckErrors(); + (await identityUserManager.SetPhoneNumberAsync(identityUser, "")).CheckErrors(); + + (await identityUserManager.UpdateAsync(identityUser)).CheckErrors(); + } + + [DisableEntityChangeTracking] + public async override Task PorepareAsync(GdprPrepareUserDataContext context) + { + var identityUserRepository = context.ServiceProvider.GetRequiredService(); + var identityUser = await identityUserRepository.GetAsync(context.UserId); + + var gdprDataInfo = new GdprDataInfo + { + { nameof(UserData.UserName), identityUser.UserName }, + { nameof(UserData.Name), identityUser.Name }, + { nameof(UserData.Surname), identityUser.Surname }, + { nameof(UserData.Email), identityUser.Email }, + { nameof(UserData.PhoneNumber), identityUser.PhoneNumber }, + { nameof(IHasCreationTime.CreationTime), identityUser.CreationTime.ToString("yyyy-MM-dd HH:mm:ss") }, + }; + + foreach (var identityUserClaim in identityUser.Claims) + { + gdprDataInfo.Add(identityUserClaim.ClaimType, identityUserClaim.ClaimValue); + } + + await DispatchPrepareUserDataAsync(context, gdprDataInfo); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/en.json b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/en.json new file mode 100644 index 000000000..2084dcf80 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/en.json @@ -0,0 +1,14 @@ +{ + "culture": "en", + "texts": { + "PersonalData:UserName": "User Name", + "PersonalData:Name": "Name", + "PersonalData:Surname": "Surname", + "PersonalData:Email": "Email", + "PersonalData:PhoneNumber": "Phone Number", + "PersonalData:CreationTime": "Registration Time", + "PersonalData:AvatarUrl": "Avatar", + "PersonalData:Picture": "Picture", + "PersonalData:Website": "Website" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/zh-Hans.json b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/zh-Hans.json new file mode 100644 index 000000000..b6d8f76a8 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/Localization/Resources/zh-Hans.json @@ -0,0 +1,14 @@ +{ + "culture": "zh-Hans", + "texts": { + "PersonalData:UserName": "用户名", + "PersonalData:Name": "名称", + "PersonalData:Surname": "姓氏", + "PersonalData:Email": "邮件地址", + "PersonalData:PhoneNumber": "手机号", + "PersonalData:CreationTime": "注册时间", + "PersonalData:AvatarUrl": "头像", + "PersonalData:Picture": "头像", + "PersonalData:Website": "个人页" + } +} \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN.Abp.Gdpr.Domain.Shared.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN.Abp.Gdpr.Domain.Shared.csproj new file mode 100644 index 000000000..6e24028ed --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN.Abp.Gdpr.Domain.Shared.csproj @@ -0,0 +1,28 @@ + + + + + + + netstandard2.0;netstandard2.1;net8.0;net9.0 + LINGYUN.Abp.Gdpr.Domain.Shared + LINGYUN.Abp.Gdpr.Domain.Shared + false + false + false + enable + + + + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/AbpGdprDomainSharedModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/AbpGdprDomainSharedModule.cs new file mode 100644 index 000000000..6b6f421fc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/AbpGdprDomainSharedModule.cs @@ -0,0 +1,38 @@ +using LINGYUN.Abp.Gdpr.Localization; +using Volo.Abp.Domain; +using Volo.Abp.Features; +using Volo.Abp.Gdpr; +using Volo.Abp.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace LINGYUN.Abp.Gdpr; + +[DependsOn( + typeof(AbpFeaturesModule), + typeof(AbpDddDomainSharedModule), + typeof(AbpGdprAbstractionsModule) + )] +public class AbpGdprDomainSharedModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddVirtualJson("/LINGYUN/Abp/Gdpr/Localization/Resources"); + }); + + Configure(options => + { + options.MapCodeNamespace(GdprErrorCodes.Namespace, typeof(GdprResource)); + }); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprErrorCodes.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprErrorCodes.cs new file mode 100644 index 000000000..98e107212 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprErrorCodes.cs @@ -0,0 +1,14 @@ +namespace LINGYUN.Abp.Gdpr; + +public static class GdprErrorCodes +{ + public const string Namespace = "Gdpr"; + /// + /// 你已经提交了一个个人数据下载请求, 请在 {RequestTimeInterval} 后再次尝试. + /// + public const string PersonalDataRequestAlreadyDays = Namespace + ":010001"; + /// + /// 你的个人数据正在准备中, 请在 {ReadyTime} 后再次尝试下载. + /// + public const string DataNotPreparedYet = Namespace + ":010002"; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs new file mode 100644 index 000000000..0e01889e8 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoCacheItem.cs @@ -0,0 +1,17 @@ +namespace LINGYUN.Abp.Gdpr; + +public class GdprInfoCacheItem +{ + public string Data { get; set; } + public string Provider { get; set; } + public GdprInfoCacheItem() + { + + } + + public GdprInfoCacheItem(string provider, string data) + { + Data = data; + Provider = provider; + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoConsts.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoConsts.cs new file mode 100644 index 000000000..9b4a3e343 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprInfoConsts.cs @@ -0,0 +1,6 @@ +namespace LINGYUN.Abp.Gdpr; + +public class GdprInfoConsts +{ + public static int MaxProviderLength { get; set; } = 256; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprRequestCacheItem.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprRequestCacheItem.cs new file mode 100644 index 000000000..66fd80d31 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprRequestCacheItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.MultiTenancy; + +namespace LINGYUN.Abp.Gdpr; + +[Serializable] +[IgnoreMultiTenancy] +public class GdprRequestCacheItem +{ + private const string CacheKeyFormat = "uid:{0};rid:{1}"; + + public Guid UserId { get; set; } + public Guid RequestId { get; set; } + public List Infos { get; set; } + public GdprRequestCacheItem() + { + Infos = new List(); + } + + public GdprRequestCacheItem(Guid userId, Guid requestId) + { + UserId = userId; + RequestId = requestId; + + Infos = new List(); + } + + public static string CalculateCacheKey(Guid userId, Guid requestId) + { + return string.Format(CacheKeyFormat, userId, requestId); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprUserAccountDeletionRequestedEto.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprUserAccountDeletionRequestedEto.cs new file mode 100644 index 000000000..10167c005 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/GdprUserAccountDeletionRequestedEto.cs @@ -0,0 +1,12 @@ +using System; + +namespace LINGYUN.Abp.Gdpr; + +/// +/// 用户账户删除请求事件传输对象 +/// +[Serializable] +public class GdprUserAccountDeletionRequestedEto +{ + public Guid UserId { get; set; } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/GdprResource.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/GdprResource.cs new file mode 100644 index 000000000..74d731c6c --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/GdprResource.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Localization; + +namespace LINGYUN.Abp.Gdpr.Localization; + +[LocalizationResourceName("AbpGdpr")] +public class GdprResource +{ +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/en.json b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/en.json new file mode 100644 index 000000000..82ee9e89c --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/en.json @@ -0,0 +1,31 @@ +{ + "culture": "en", + "texts": { + "Gdpr:010001": "You have submitted a personal data download request, please try again after {RequestTimeInterval}.", + "Gdpr:010002": "Your personal data is being prepared, please try to download again after {ReadyTime}.", + "DisplayName:PersonalData": "Personal Data", + "DisplayName:Provider": "Provider", + "DisplayName:UserId": "User Id", + "DisplayName:CreationTime": "Creation Time", + "DisplayName:ReadyTime": "Ready Time", + "PersonalData:Empty": "None", + "Preparing": "Preparing", + "Download": "Download", + "RequestPersonalData": "Request Personal Data", + "DeletePersonalData": "Delete Personal Data", + "DeletePersonalAccount": "Delete Account", + "RequestedSuccessfully": "Requested Successfully", + "DeletePersonalAccountWarning": "This action will delete your account (including your personal data) and you will no longer be able to log in to the app!", + "PersonalAccountDeleteRequestReceived": "Your account deletion request is being processed and your personal data will be deleted at the end of the deletion process.", + "DeletePersonalDataWarning": "This action will delete your account personal data, and the deletion of some data may affect the page experience!", + "PersonalDataDeleteRequestReceived": "Your personal data deletion request is being processed, and you may need to log back into the app after the deletion process is complete.", + "PersonalDataPrepareRequestReceived": "Your personal data request is being processed and if the data is ready, you can download it on this page.", + "Accept": "Accept", + "PersonalData": "Personal Data", + "CookiePolicy": "Cookie Policy", + "PrivacyPolicy": "Privacy Policy", + "ThisWebsiteUsesCookie": "This website uses cookies to ensure you get the best experience on the website.", + "CookieConsentAgreePolicy": "If you continue to browse, then you agree to our {0}.", + "CookieConsentAgreePolicies": "If you continue to browse, then you agree to our {0} and {1}." + } +} \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/zh-Hans.json b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/zh-Hans.json new file mode 100644 index 000000000..af178f32d --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Shared/LINGYUN/Abp/Gdpr/Localization/Resources/zh-Hans.json @@ -0,0 +1,31 @@ +{ + "culture": "zh-Hans", + "texts": { + "Gdpr:010001": "你已经提交了一个个人数据下载请求, 请在 {RequestTimeInterval} 后再次尝试.", + "Gdpr:010002": "你的个人数据正在准备中, 请在 {ReadyTime} 后再次尝试下载.", + "DisplayName:PersonalData": "个人数据", + "DisplayName:Provider": "收集模块", + "DisplayName:UserId": "用户Id", + "DisplayName:CreationTime": "请求时间", + "DisplayName:ReadyTime": "就绪时间", + "PersonalData:Empty": "无", + "Preparing": "准备中", + "Download": "下载", + "RequestPersonalData": "请求个人数据", + "DeletePersonalData": "删除个人数据", + "DeletePersonalAccount": "注销账号", + "RequestedSuccessfully": "请求成功", + "DeletePersonalAccountWarning": "此操作将会删除你的账户(包括你的个人数据), 并且你将不能再登录到应用程序!", + "PersonalAccountDeleteRequestReceived": "你的账户删除请求正在处理中, 在删除过程结束后,你的个人数据将被删除.", + "DeletePersonalDataWarning": "此操作将会删除你的账户个人数据, 某些数据被删除可能会影响页面体验!", + "PersonalDataDeleteRequestReceived": "你的个人数据删除请求正在处理中, 在删除过程结束后, 你可能需要重新登录应用程序.", + "PersonalDataPrepareRequestReceived": "你的个人数据请求正在处理中, 如果数据准备就绪, 你可以在这个页面下载它.", + "Accept": "接受", + "PersonalData": "个人数据", + "CookiePolicy": "Cookie政策", + "PrivacyPolicy": "隐私政策", + "ThisWebsiteUsesCookie": "本网站使用cookie以确保您在网站上获得最佳体验.", + "CookieConsentAgreePolicy": "如果您继续浏览, 即表示您同意我们的 {0}.", + "CookieConsentAgreePolicies": "如果您继续浏览, 则表示您同意我们的 {0} 和 {1}." + } +} \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN.Abp.Gdpr.Domain.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN.Abp.Gdpr.Domain.csproj new file mode 100644 index 000000000..ec4c4ae14 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN.Abp.Gdpr.Domain.csproj @@ -0,0 +1,26 @@ + + + + + + + net9.0 + LINGYUN.Abp.Gdpr.Domain + LINGYUN.Abp.Gdpr.Domain + false + false + false + enable + + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpCookieConsentOptions.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpCookieConsentOptions.cs new file mode 100644 index 000000000..5b61f8564 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpCookieConsentOptions.cs @@ -0,0 +1,44 @@ +using System; + +namespace LINGYUN.Abp.Gdpr; +/// +/// AbpCookie同意选项 +/// See: https://abp.io/docs/latest/modules/gdpr#abpcookieconsentoptions +/// +public class AbpCookieConsentOptions +{ + /// + /// 启用或禁用Cookie Consent特征 + /// + public bool IsEnabled { get; set; } + /// + /// 定义 Cookie 策略页面 URL.
+ /// 设置后, "Cookie 策略"页面 URL 会自动添加到 Cookie 同意声明中.
+ /// 因此, 用户可以在接受 cookie 同意之前检查 cookie 政策.
+ /// 您可以将其设置为本地地址或完整 URL, 例如:
+ /// /CookiePolicy
+ /// https://example.com/cookie-policy + ///
+ public string CookiePolicyUrl { get; set; } + /// + /// 定义隐私政策页面 URL.
+ /// 设置后, "隐私政策"页面 URL 会自动添加到 Cookie 同意声明中.
+ /// 因此, 用户可以在接受 cookie 同意之前查看隐私政策.
+ /// 您可以将其设置为本地地址或完整 URL, 例如:
+ /// /PrivacyPolicy
+ /// https://example.com/privacy-policy + ///
+ public string PrivacyPolicyUrl { get; set; } + /// + /// 定义 Cookie 同意的 Cookie 过期时间.
+ /// 默认情况下, 当接受 Cookie 同意时, 它会将 Cookie 设置为有效期为 6 个月. + ///
+ public TimeSpan Expiration { get; set; } + public AbpCookieConsentOptions() + { + IsEnabled = true; + CookiePolicyUrl = "/CookiePolicy"; + PrivacyPolicyUrl = "/PrivacyPolicy"; + Expiration = TimeSpan.FromDays(180); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprDomainModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprDomainModule.cs new file mode 100644 index 000000000..8773d10ee --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprDomainModule.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Gdpr; + +[DependsOn( + typeof(AbpAutoMapperModule), + typeof(AbpDddDomainModule), + typeof(AbpGdprDomainSharedModule) + )] +public class AbpGdprDomainModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + + Configure(configuration.GetSection("Gdpr")); + Configure(configuration.GetSection("CookieConsent")); + + context.Services.AddAutoMapperObjectMapper(); + + Configure(options => + { + options.AddMaps(validate: true); + }); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprOptions.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprOptions.cs new file mode 100644 index 000000000..95f706761 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/AbpGdprOptions.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; + +namespace LINGYUN.Abp.Gdpr; +/// +/// AbpGdpr选项 +/// See: https://abp.io/docs/latest/modules/gdpr#abpgdproptions +/// +public class AbpGdprOptions +{ + /// + /// 用于指示允许的请求时间间隔.
+ /// 如果要增加或减少个人数据请求间隔,可以配置此属性.
+ /// 默认情况下, 用户可以每天请求一次其个人数据
+ /// 默认值: 1 天 + ///
+ public TimeSpan RequestTimeInterval { get; set; } + /// + /// 由于 GDPR 模块旨在支持分布式方案, 因此收集和准备个人数据应该需要一段时间. + /// 如果要根据应用程序的大小增加或减少数据准备时间, 可以配置此属性.
+ /// 默认值: 60 分钟 + ///
+ public TimeSpan MinutesForDataPreparation { get; set; } + /// + /// 用户数据提供者列表 + /// + public IList GdprUserDataProviders { get; } + /// + /// 用户账户提供者列表 + /// + public IList GdprUserAccountProviders { get; } + public AbpGdprOptions() + { + RequestTimeInterval = TimeSpan.FromDays(1); + MinutesForDataPreparation = TimeSpan.FromMinutes(60); + + GdprUserDataProviders = new List(); + GdprUserAccountProviders = new List(); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDbProterties.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDbProterties.cs new file mode 100644 index 000000000..ade18b881 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDbProterties.cs @@ -0,0 +1,10 @@ +namespace LINGYUN.Abp.Gdpr; +public static class GdprDbProterties +{ + public static string DbTablePrefix { get; set; } = "AbpGdpr"; + + public static string? DbSchema { get; set; } = null; + + + public const string ConnectionStringName = "AbpGdpr"; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserAccountContext.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserAccountContext.cs new file mode 100644 index 000000000..12fb2e0bb --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserAccountContext.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Gdpr; + +namespace LINGYUN.Abp.Gdpr; + +public class GdprDeleteUserAccountContext(IServiceProvider serviceProvider) : GdprUserDataProviderContext, IServiceProviderAccessor +{ + public IServiceProvider ServiceProvider { get; } = serviceProvider; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserDataContext.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserDataContext.cs new file mode 100644 index 000000000..787be03ee --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDeleteUserDataContext.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Gdpr; + +namespace LINGYUN.Abp.Gdpr; + +public class GdprDeleteUserDataContext(IServiceProvider serviceProvider) : GdprUserDataProviderContext, IServiceProviderAccessor +{ + public IServiceProvider ServiceProvider { get; } = serviceProvider; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDomainMapperProfile.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDomainMapperProfile.cs new file mode 100644 index 000000000..084bef33d --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprDomainMapperProfile.cs @@ -0,0 +1,10 @@ +using AutoMapper; + +namespace LINGYUN.Abp.Gdpr; +public class GdprDomainMapperProfile : Profile +{ + public GdprDomainMapperProfile() + { + + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs new file mode 100644 index 000000000..a300ddc11 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprInfo.cs @@ -0,0 +1,43 @@ +using System; +using Volo.Abp; +using Volo.Abp.Domain.Entities; + +namespace LINGYUN.Abp.Gdpr; + +/// +/// 表示用户的个人数据 +/// See: https://abp.io/docs/latest/modules/gdpr#gdprinfo +/// +public class GdprInfo : Entity +{ + /// + /// GDPR 请求的 ID + /// + public virtual Guid RequestId { get; protected set; } + + /// + /// 用于存储个人数据 + /// + public virtual string Data { get; protected set; } + + /// + /// 表示收集个人数据的模块 + /// + public virtual string Provider { get; protected set; } + + protected GdprInfo() + { + } + + public GdprInfo( + Guid id, + Guid requestId, + string data, + string provider) + : base(id) + { + RequestId = requestId; + Data = Check.NotNullOrWhiteSpace(data, nameof(data)); + Provider = Check.NotNullOrWhiteSpace(provider, nameof(provider), GdprInfoConsts.MaxProviderLength); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprPrepareUserDataContext.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprPrepareUserDataContext.cs new file mode 100644 index 000000000..7f78c05b7 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprPrepareUserDataContext.cs @@ -0,0 +1,11 @@ +using System; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Gdpr; + +namespace LINGYUN.Abp.Gdpr; + +public class GdprPrepareUserDataContext(Guid requestId, IServiceProvider serviceProvider) : GdprUserDataProviderContext, IServiceProviderAccessor +{ + public IServiceProvider ServiceProvider { get; } = serviceProvider; + public Guid RequestId { get; } = requestId; +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprRequest.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprRequest.cs new file mode 100644 index 000000000..eb08daffc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprRequest.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Guids; + +namespace LINGYUN.Abp.Gdpr; + +/// +/// 表示用户发出的 GDPR 请求 +/// See: https://abp.io/docs/latest/modules/gdpr#gdprrequest +/// +public class GdprRequest : AggregateRoot, IHasCreationTime +{ + ///// TODO: Abp Framework GDPR模块不支持多租户 + ///// + ///// 租户Id + ///// + ///// public virtual Guid? TenantId { get; protected set; } + + /// + /// 发出请求的用户的 ID + /// + public virtual Guid UserId { get; protected set; } + /// + /// 创建时间 + /// + public virtual DateTime CreationTime { get; protected set; } + /// + /// 数据准备过程的结束时间 + /// + public virtual DateTime ReadyTime { get; protected set; } + /// + /// 收集的用户个人数据 + /// + public virtual ICollection Infos { get; protected set; } + protected GdprRequest() + { + Infos = new Collection(); + } + + public GdprRequest( + Guid id, + Guid userId, + DateTime readyTime) + : base(id) + { + UserId = userId; + ReadyTime = readyTime; + Infos = new Collection(); + } + + public void AddData( + IGuidGenerator guidGenerator, + string data, + string provider) + { + Infos.Add( + new GdprInfo( + guidGenerator.Create(), + Id, + data, + provider)); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserAccountProviderBase.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserAccountProviderBase.cs new file mode 100644 index 000000000..198747f99 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserAccountProviderBase.cs @@ -0,0 +1,10 @@ +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Gdpr; + +public abstract class GdprUserAccountProviderBase : IGdprUserAccountProvider +{ + public abstract string Name { get; } + + public abstract Task DeleteAsync(GdprDeleteUserAccountContext context); +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataPreparedEventHandler.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataPreparedEventHandler.cs new file mode 100644 index 000000000..2d5cfea8b --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataPreparedEventHandler.cs @@ -0,0 +1,38 @@ +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Gdpr; +using Volo.Abp.Guids; +using Volo.Abp.Json; +using Volo.Abp.Uow; + +namespace LINGYUN.Abp.Gdpr; + +public class GdprUserDataPreparedEventHandler( + IGdprRequestRepository gdprRequestRepository, + IJsonSerializer jsonSerializer, + IGuidGenerator guidGenerator +): IDistributedEventHandler, + ITransientDependency +{ + [UnitOfWork] + public async virtual Task HandleEventAsync(GdprUserDataPreparedEto eventData) + { + if (eventData.Data.Any()) + { + var gdprRequest = await gdprRequestRepository.FindAsync(eventData.RequestId); + if (gdprRequest != null) + { + var data = jsonSerializer.Serialize(eventData.Data); + + gdprRequest.AddData( + guidGenerator, + data, + eventData.Provider); + + await gdprRequestRepository.UpdateAsync(gdprRequest); + } + } + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataProviderBase.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataProviderBase.cs new file mode 100644 index 000000000..e8ccf4609 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataProviderBase.cs @@ -0,0 +1,33 @@ +using Microsoft.Extensions.DependencyInjection; +using System.Threading.Tasks; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Gdpr; + +namespace LINGYUN.Abp.Gdpr; + +public abstract class GdprUserDataProviderBase: IGdprUserDataProvider +{ + public abstract string Name { get; } + + public abstract Task DeleteAsync(GdprDeleteUserDataContext context); + public abstract Task PorepareAsync(GdprPrepareUserDataContext context); + /// + /// 发布个人数据 + /// + /// + /// 个人数据 + /// + protected async virtual Task DispatchPrepareUserDataAsync(GdprPrepareUserDataContext context, GdprDataInfo gdprDataInfo) + { + var distributedEventBus = context.ServiceProvider.GetRequiredService(); + + var gdprUserData = new GdprUserDataPreparedEto + { + RequestId = context.RequestId, + Provider = Name, + Data = gdprDataInfo, + }; + + await distributedEventBus.PublishAsync(gdprUserData); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataRequestedEventHandler.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataRequestedEventHandler.cs new file mode 100644 index 000000000..44f3e2b9c --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/GdprUserDataRequestedEventHandler.cs @@ -0,0 +1,71 @@ +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Options; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Gdpr; +using Volo.Abp.Uow; + +namespace LINGYUN.Abp.Gdpr; + +/// +/// 用户个人数据收集事件监听器
+/// See: https://abp.io/docs/latest/modules/gdpr#gdpruserdatarequestedeto +///
+/// +/// +public class GdprUserDataRequestedEventHandler( + IOptions options, + IServiceScopeFactory serviceScopeFactory +) : IDistributedEventHandler, + IDistributedEventHandler, + IDistributedEventHandler, + ITransientDependency +{ + public async virtual Task HandleEventAsync(GdprUserDataRequestedEto eventData) + { + using var scope = serviceScopeFactory.CreateScope(); + + var context = new GdprPrepareUserDataContext(eventData.RequestId, scope.ServiceProvider) + { + UserId = eventData.UserId, + }; + + foreach (var gdprUserDataProvider in options.Value.GdprUserDataProviders) + { + await gdprUserDataProvider.PorepareAsync(context); + } + } + + [UnitOfWork] + public async virtual Task HandleEventAsync(GdprUserDataDeletionRequestedEto eventData) + { + using var scope = serviceScopeFactory.CreateScope(); + + var context = new GdprDeleteUserDataContext(scope.ServiceProvider) + { + UserId = eventData.UserId, + }; + + foreach (var gdprUserDataProvider in options.Value.GdprUserDataProviders) + { + await gdprUserDataProvider.DeleteAsync(context); + } + } + + [UnitOfWork] + public async virtual Task HandleEventAsync(GdprUserAccountDeletionRequestedEto eventData) + { + using var scope = serviceScopeFactory.CreateScope(); + + var context = new GdprDeleteUserAccountContext(scope.ServiceProvider) + { + UserId = eventData.UserId, + }; + + foreach (var gdprUserAccountProvider in options.Value.GdprUserAccountProviders) + { + await gdprUserAccountProvider.DeleteAsync(context); + } + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprRequestRepository.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprRequestRepository.cs new file mode 100644 index 000000000..668e2008d --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprRequestRepository.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Specifications; + +namespace LINGYUN.Abp.Gdpr; + +public interface IGdprRequestRepository : IBasicRepository +{ + Task FindLatestRequestTimeAsync( + Guid userId, + CancellationToken cancellationToken = default); + + Task GetCountAsync( + ISpecification specification, + CancellationToken cancellationToken = default); + + Task> GetListAsync( + ISpecification specification, + string? sorting = $"{nameof(GdprRequest.CreationTime)} DESC", + int maxResultCount = 10, + int skipCount = 0, + CancellationToken cancellationToken = default); +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserAccountProvider.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserAccountProvider.cs new file mode 100644 index 000000000..be8c7e7fd --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserAccountProvider.cs @@ -0,0 +1,19 @@ +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Gdpr; +/// +/// 用户个人账户提供者 +/// +public interface IGdprUserAccountProvider +{ + /// + /// 提供者名称 + /// + string Name { get; } + /// + /// 删除用户账户 + /// + /// + /// + Task DeleteAsync(GdprDeleteUserAccountContext context); +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserDataProvider.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserDataProvider.cs new file mode 100644 index 000000000..1c32195cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain/LINGYUN/Abp/Gdpr/IGdprUserDataProvider.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; + +namespace LINGYUN.Abp.Gdpr; +/// +/// 用户个人数据提供者
+/// 实现: https://abp.io/docs/latest/modules/gdpr#gdpruserdatarequestedeto +///
+public interface IGdprUserDataProvider +{ + /// + /// 提供者名称 + /// + string Name { get; } + /// + /// 准备用户数据 + /// + Task PorepareAsync(GdprPrepareUserDataContext context); + /// + /// 删除用户数据 + /// + /// + /// + Task DeleteAsync(GdprDeleteUserDataContext context); +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN.Abp.Gdpr.EntityFrameworkCore.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN.Abp.Gdpr.EntityFrameworkCore.csproj new file mode 100644 index 000000000..aca823eac --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN.Abp.Gdpr.EntityFrameworkCore.csproj @@ -0,0 +1,25 @@ + + + + + + + net9.0 + LINGYUN.Abp.Gdpr.EntityFrameworkCore + LINGYUN.Abp.Gdpr.EntityFrameworkCore + false + false + false + enable + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/AbpGdprEntityFrameworkCoreModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/AbpGdprEntityFrameworkCoreModule.cs new file mode 100644 index 000000000..a8a7cecd1 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/AbpGdprEntityFrameworkCoreModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace LINGYUN.Abp.Gdpr.EntityFrameworkCore; + +[DependsOn( + typeof(AbpGdprDomainModule), + typeof(AbpEntityFrameworkCoreModule) + )] +public class AbpGdprEntityFrameworkCoreModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + options.AddRepository(); + + options.AddDefaultRepositories(); + }); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/EfCoreGdprRequestRepository.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/EfCoreGdprRequestRepository.cs new file mode 100644 index 000000000..093a3da39 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/EfCoreGdprRequestRepository.cs @@ -0,0 +1,52 @@ +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Specifications; + +namespace LINGYUN.Abp.Gdpr.EntityFrameworkCore; + +public class EfCoreGdprRequestRepository(IDbContextProvider dbContextProvider) : + EfCoreRepository(dbContextProvider), + IGdprRequestRepository +{ + public async virtual Task FindLatestRequestTimeAsync(Guid userId, CancellationToken cancellationToken = default) + { + return await (await GetQueryableAsync()) + .Where(x => x.UserId == userId) + .OrderByDescending(x => x.CreationTime) + .Select(x => x.CreationTime) + .FirstOrDefaultAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task GetCountAsync(ISpecification specification, CancellationToken cancellationToken = default) + { + return await (await GetQueryableAsync()) + .Where(specification.ToExpression()) + .CountAsync(GetCancellationToken(cancellationToken)); + } + + public async virtual Task> GetListAsync( + ISpecification specification, + string? sorting = $"{nameof(GdprRequest.CreationTime)} DESC", + int maxResultCount = 10, + int skipCount = 0, + CancellationToken cancellationToken = default) + { + return await(await GetQueryableAsync()) + .Where(specification.ToExpression()) + .OrderBy(sorting.IsNullOrWhiteSpace() ? $"{nameof(GdprRequest.CreationTime)} DESC" : sorting) + .PageBy(skipCount, maxResultCount) + .ToListAsync(GetCancellationToken(cancellationToken)); + } + + public async override Task> WithDetailsAsync() + { + return (await base.WithDetailsAsync()).Include(x => x.Infos); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContext.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContext.cs new file mode 100644 index 000000000..d422979ef --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContext.cs @@ -0,0 +1,19 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace LINGYUN.Abp.Gdpr.EntityFrameworkCore; + +[ConnectionStringName(GdprDbProterties.ConnectionStringName)] +public class GdprDbContext(DbContextOptions options) : + AbpDbContext(options), IGdprDbContext +{ + public virtual DbSet Requests { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureGdpr(); ; + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContextModelCreatingExtensions.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContextModelCreatingExtensions.cs new file mode 100644 index 000000000..d8864fb53 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprDbContextModelCreatingExtensions.cs @@ -0,0 +1,54 @@ +using Microsoft.EntityFrameworkCore; +using System; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace LINGYUN.Abp.Gdpr.EntityFrameworkCore; +public static class GdprDbContextModelCreatingExtensions +{ + public static void ConfigureGdpr( + this ModelBuilder builder, + Action? optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new GdprModelBuilderConfigurationOptions( + GdprDbProterties.DbTablePrefix, + GdprDbProterties.DbSchema + ); + optionsAction?.Invoke(options); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Requests", options.Schema); + + b.HasMany(p => p.Infos) + .WithOne() + .HasForeignKey(fk => fk.RequestId) + .IsRequired(true); + + b.HasIndex(p => p.UserId); + + b.ConfigureByConvention(); + }); + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Infos", options.Schema); + + b.Property(p => p.Provider) + .HasColumnName(nameof(GdprInfo.Provider)) + .HasMaxLength(GdprInfoConsts.MaxProviderLength) + .IsRequired(); + + b.Property(p => p.Data) + .HasColumnName(nameof(GdprInfo.Data)) + .IsRequired(); + + b.HasIndex(p => p.RequestId); + + b.ConfigureByConvention(); + }); + + builder.TryConfigureObjectExtensions(); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprModelBuilderConfigurationOptions.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprModelBuilderConfigurationOptions.cs new file mode 100644 index 000000000..502040989 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/GdprModelBuilderConfigurationOptions.cs @@ -0,0 +1,10 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace LINGYUN.Abp.Gdpr.EntityFrameworkCore; +public class GdprModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string? schema = null) : + AbpModelBuilderConfigurationOptions(tablePrefix, schema) +{ +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/IGdprDbContext.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/IGdprDbContext.cs new file mode 100644 index 000000000..62d7c8c2d --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.EntityFrameworkCore/LINGYUN/Abp/Gdpr/EntityFrameworkCore/IGdprDbContext.cs @@ -0,0 +1,11 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace LINGYUN.Abp.Gdpr.EntityFrameworkCore; + +[ConnectionStringName(GdprDbProterties.ConnectionStringName)] +public interface IGdprDbContext : IEfCoreDbContext +{ + DbSet Requests { get; } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xml b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xsd b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN.Abp.Gdpr.HttpApi.csproj b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN.Abp.Gdpr.HttpApi.csproj new file mode 100644 index 000000000..b41c7e4e5 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN.Abp.Gdpr.HttpApi.csproj @@ -0,0 +1,25 @@ + + + + + + + net9.0 + LINGYUN.Abp.Gdpr.HttpApi + LINGYUN.Abp.Gdpr.HttpApi + false + false + false + enable + + + + + + + + + + + + diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/AbpGdprHttpApiModule.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/AbpGdprHttpApiModule.cs new file mode 100644 index 000000000..1070dec44 --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/AbpGdprHttpApiModule.cs @@ -0,0 +1,41 @@ +using LINGYUN.Abp.Gdpr.Localization; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.Validation.Localization; + +namespace LINGYUN.Abp.Gdpr; + +[DependsOn( + typeof(AbpAspNetCoreMvcModule), + typeof(AbpGdprApplicationContractsModule) + )] +public class AbpGdprHttpApiModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpGdprHttpApiModule).Assembly); + }); + + PreConfigure(options => + { + options.AddAssemblyResource( + typeof(GdprResource), + typeof(AbpGdprApplicationContractsModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpValidationResource)); + }); + } +} diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/GdprRequestController.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/GdprRequestController.cs new file mode 100644 index 000000000..4a41ebe4c --- /dev/null +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.HttpApi/LINGYUN/Abp/Gdpr/GdprRequestController.cs @@ -0,0 +1,69 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Content; + +namespace LINGYUN.Abp.Gdpr; + +[Authorize] +[Controller] +[Area(GdprRemoteServiceConsts.ModuleName)] +[RemoteService(Name = GdprRemoteServiceConsts.RemoteServiceName)] +[Route($"api/{GdprRemoteServiceConsts.ModuleName}/requests")] +public class GdprRequestController( + IGdprRequestAppService service +) : AbpControllerBase, + IGdprRequestAppService +{ + [HttpDelete] + [Route("{id}")] + public virtual Task DeleteAsync(Guid id) + { + return service.DeleteAsync(id); + } + + [HttpDelete] + [Route("personal-account")] + public virtual Task DeletePersonalAccountAsync() + { + return service.DeletePersonalAccountAsync(); + } + + [HttpDelete] + [Route("personal-data")] + public virtual Task DeletePersonalDataAsync() + { + return service.DeletePersonalDataAsync(); + } + + [HttpGet] + [Route("{id}")] + public virtual Task GetAsync(Guid id) + { + return service.GetAsync(id); + } + + [HttpGet] + public virtual Task> GetListAsync(GdprRequestGetListInput input) + { + return service.GetListAsync(input); + } + + [HttpGet] + [Route("personal-data/download/{requestId}")] + public virtual Task DownloadPersonalDataAsync(Guid requestId) + { + return service.DownloadPersonalDataAsync(requestId); + } + + [HttpPost] + [Route("personal-data/prepare")] + public virtual Task PreparePersonalDataAsync() + { + return service.PreparePersonalDataAsync(); + } +} diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs b/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs index 69483bf92..e6143f315 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/GlobalUsings.cs @@ -141,7 +141,6 @@ global using MiniExcelLibs.Attributes; global using OpenIddict.Server; global using OpenIddict.Server.AspNetCore; global using Quartz; -global using Savorboard.CAP.InMemoryMessageQueue; global using StackExchange.Redis; global using System.Security.Cryptography; global using System.Security.Cryptography.X509Certificates; diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj index eb5ecb7a4..cd2e4256e 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj +++ b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj @@ -1,4 +1,4 @@ - + @@ -16,7 +16,7 @@ - + @@ -155,6 +155,10 @@ + + + + diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index a55aa01a9..67e36571f 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -1,3 +1,7 @@ +using LINGYUN.Abp.Gdpr; +using LINGYUN.Abp.Gdpr.EntityFrameworkCore; +using LINGYUN.Abp.Gdpr.Identity; + namespace LY.MicroService.Applications.Single; [DependsOn( @@ -47,6 +51,15 @@ namespace LY.MicroService.Applications.Single; // 身份认证模块 实体框架 typeof(AbpIdentityEntityFrameworkCoreModule), + // Gdpr 身份认证提供者模块 + typeof(AbpGdprDomainIdentityModule), + // Gdpr 应用服务模块 + typeof(AbpGdprApplicationModule), + // Gdpr 控制器模块 + typeof(AbpGdprHttpApiModule), + // Gdpr 实体框架模块 + typeof(AbpGdprEntityFrameworkCoreModule), + // 多语言管理模块 领域服务 typeof(AbpLocalizationManagementDomainModule), // 多语言管理模块 应用服务 From b1b60b3be7cc646832fc2b2682ffbdc38b2fcee4 Mon Sep 17 00:00:00 2001 From: colin Date: Tue, 18 Feb 2025 11:11:25 +0800 Subject: [PATCH 2/2] fix(gdpr): remove unitwork scopr --- .../Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs index 6205471fe..d8de4a61c 100644 --- a/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs +++ b/aspnet-core/modules/gdpr/LINGYUN.Abp.Gdpr.Domain.Identity/LINGYUN/Abp/Gdpr/Identity/AbpGdprIdentityUserAccountProvider.cs @@ -2,7 +2,6 @@ using Microsoft.Extensions.DependencyInjection; using System.Threading.Tasks; using Volo.Abp.Identity; -using Volo.Abp.Uow; namespace LINGYUN.Abp.Gdpr.Identity; @@ -15,7 +14,6 @@ public class AbpGdprIdentityUserAccountProvider : GdprUserAccountProviderBase public override string Name => ProviderName; - [UnitOfWork] public async override Task DeleteAsync(GdprDeleteUserAccountContext context) { var identityUserManager = context.ServiceProvider.GetRequiredService();