Browse Source

Merge pull request #827 from colinin/rel-7.1.1

Version 7.1.1 is the last update
pull/830/head
yx lin 3 years ago
committed by GitHub
parent
commit
eee608323f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 26
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 868
      aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230506071509_Add-Portal-Login.Designer.cs
  3. 62
      aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230506071509_Add-Portal-Login.cs
  4. 873
      aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230509024453_Add-Logo-Property-With-Portal.Designer.cs
  5. 30
      aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230509024453_Add-Logo-Property-With-Portal.cs
  6. 103
      aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/PlatformMigrationsDbContextModelSnapshot.cs
  7. 2
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs
  8. 132
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.md
  9. 38
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Notifications/AbpWorkflowExecutionContextNotificationsExtensions.cs
  10. 3
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/FodyWeavers.xml
  11. 30
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/FodyWeavers.xsd
  12. 19
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN.Abp.IdentityServer.Portal.csproj
  13. 40
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/AbpIdentityServerPortalModule.cs
  14. 255
      aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs
  15. 3
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/FodyWeavers.xml
  16. 30
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/FodyWeavers.xsd
  17. 19
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN.Abp.OpenIddict.Portal.csproj
  18. 31
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/AbpOpenIddictPortalModule.cs
  19. 328
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrant.cs
  20. 5
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrantConsts.cs
  21. 11
      aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/Microsoft/Extensions/DependencyInjection/PortalOpenIddictServerBuilderExtensions.cs
  22. 12
      aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Portal/EnterpriseConsts.cs
  23. 109
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/Enterprise.cs
  24. 17
      aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/IEnterpriseRepository.cs
  25. 46
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs
  26. 64
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs
  27. 36
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs
  28. 112
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs
  29. 62
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs
  30. 40
      aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Portal/EfCoreEnterpriseRepository.cs
  31. 4
      aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs
  32. 2
      aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj
  33. 3
      aspnet-core/services/LY.MicroService.AuthServer/appsettings.Development.json
  34. 4
      aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs
  35. 2
      aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj
  36. 18
      aspnet-core/services/LY.MicroService.identityServer/appsettings.Development.json

26
aspnet-core/LINGYUN.MicroService.All.sln

@ -591,17 +591,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rules-management", "rules-m
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rules-engine", "rules-engine", "{F7103498-8B5B-4698-AACE-9E949F732E77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Domain.Shared", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Domain.Shared\LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj", "{2EAA690B-1395-4952-95A0-A52F929028C4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RulesEngineManagement.Domain.Shared", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Domain.Shared\LINGYUN.Abp.RulesEngineManagement.Domain.Shared.csproj", "{2EAA690B-1395-4952-95A0-A52F929028C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Domain", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Domain\LINGYUN.Abp.RulesEngineManagement.Domain.csproj", "{722FE012-8F23-4558-9E8F-A37C02902058}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RulesEngineManagement.Domain", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Domain\LINGYUN.Abp.RulesEngineManagement.Domain.csproj", "{722FE012-8F23-4558-9E8F-A37C02902058}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Application.Contracts", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application.Contracts\LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj", "{79D3C6D6-6433-471D-B354-477E07CB08EE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RulesEngineManagement.Application.Contracts", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application.Contracts\LINGYUN.Abp.RulesEngineManagement.Application.Contracts.csproj", "{79D3C6D6-6433-471D-B354-477E07CB08EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.Application", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application\LINGYUN.Abp.RulesEngineManagement.Application.csproj", "{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RulesEngineManagement.Application", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.Application\LINGYUN.Abp.RulesEngineManagement.Application.csproj", "{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore\LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj", "{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore\LINGYUN.Abp.RulesEngineManagement.EntityFrameworkCore.csproj", "{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.RulesEngineManagement.HttpApi", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.HttpApi\LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj", "{97062425-3379-4F8D-BFA2-D445C56C0801}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.RulesEngineManagement.HttpApi", "modules\rules-management\rules-engine\LINGYUN.Abp.RulesEngineManagement.HttpApi\LINGYUN.Abp.RulesEngineManagement.HttpApi.csproj", "{97062425-3379-4F8D-BFA2-D445C56C0801}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IdentityServer.Portal", "modules\identityServer\LINGYUN.Abp.IdentityServer.Portal\LINGYUN.Abp.IdentityServer.Portal.csproj", "{5B20BA13-40FF-4743-AEEE-2E3F887F50C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.OpenIddict.Portal", "modules\openIddict\LINGYUN.Abp.OpenIddict.Portal\LINGYUN.Abp.OpenIddict.Portal.csproj", "{03EC70B8-912C-4FBE-94DD-6327F4F23021}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -1537,6 +1541,14 @@ Global
{97062425-3379-4F8D-BFA2-D445C56C0801}.Debug|Any CPU.Build.0 = Debug|Any CPU
{97062425-3379-4F8D-BFA2-D445C56C0801}.Release|Any CPU.ActiveCfg = Release|Any CPU
{97062425-3379-4F8D-BFA2-D445C56C0801}.Release|Any CPU.Build.0 = Release|Any CPU
{5B20BA13-40FF-4743-AEEE-2E3F887F50C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B20BA13-40FF-4743-AEEE-2E3F887F50C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B20BA13-40FF-4743-AEEE-2E3F887F50C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B20BA13-40FF-4743-AEEE-2E3F887F50C6}.Release|Any CPU.Build.0 = Release|Any CPU
{03EC70B8-912C-4FBE-94DD-6327F4F23021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{03EC70B8-912C-4FBE-94DD-6327F4F23021}.Debug|Any CPU.Build.0 = Debug|Any CPU
{03EC70B8-912C-4FBE-94DD-6327F4F23021}.Release|Any CPU.ActiveCfg = Release|Any CPU
{03EC70B8-912C-4FBE-94DD-6327F4F23021}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1828,6 +1840,8 @@ Global
{5A3B9F4D-E6CC-410F-B307-0E69CCA213F5} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{4CDCD854-6E06-4076-AE94-53C1C1D7F6FA} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{97062425-3379-4F8D-BFA2-D445C56C0801} = {F7103498-8B5B-4698-AACE-9E949F732E77}
{5B20BA13-40FF-4743-AEEE-2E3F887F50C6} = {0439B173-F41E-4CE0-A44A-CCB70328F272}
{03EC70B8-912C-4FBE-94DD-6327F4F23021} = {83E698F6-F8CD-4604-AB80-01A203389501}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

868
aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230506071509_Add-Portal-Login.Designer.cs

@ -0,0 +1,868 @@
// <auto-generated />
using System;
using LY.MicroService.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations
{
[DbContext(typeof(PlatformMigrationsDbContext))]
[Migration("20230506071509_Add-Portal-Login")]
partial class AddPortalLogin
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "7.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Code");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AllowBeNull")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(true);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<string>("DefaultValue")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DefaultValue");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Name");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Name");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(23)
.HasColumnType("varchar(23)")
.HasColumnName("Code");
b.Property<string>("Component")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Component");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("LayoutId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("AppPlatformMenus", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("RoleName");
b.Property<bool>("Startup")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("AliasName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("AliasName");
b.Property<string>("Color")
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Color");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Framework");
b.Property<string>("Icon")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("Icon");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Name");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Path");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<bool>("Startup")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Authors")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("Authors");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("ForceUpdate")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Note");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Authors")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("Authors");
b.Property<string>("ContentType")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("ContentType");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("License")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("License");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<Guid>("PackageId")
.HasColumnType("char(36)");
b.Property<string>("SHA256")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("SHA256");
b.Property<long?>("Size")
.HasColumnType("bigint");
b.Property<string>("Summary")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Summary");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Address");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("EnglishName")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("EnglishName");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("LegalMan")
.HasMaxLength(60)
.HasColumnType("varchar(60)")
.HasColumnName("LegalMan");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<string>("OrganizationCode")
.HasMaxLength(16)
.HasColumnType("varchar(16)")
.HasColumnName("OrganizationCode");
b.Property<string>("RegistrationCode")
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("RegistrationCode");
b.Property<DateTime?>("RegistrationDate")
.HasColumnType("datetime(6)");
b.Property<string>("TaxCode")
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("TaxCode");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformEnterprises", (string)null);
});
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.Packages.PackageBlob", b =>
{
b.HasOne("LINGYUN.Platform.Packages.Package", "Package")
.WithMany("Blobs")
.HasForeignKey("PackageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Package");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b =>
{
b.Navigation("Blobs");
});
#pragma warning restore 612, 618
}
}
}

62
aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230506071509_Add-Portal-Login.cs

@ -0,0 +1,62 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations
{
/// <inheritdoc />
public partial class AddPortalLogin : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AppPlatformEnterprises",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
TenantId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EnglishName = table.Column<string>(type: "varchar(512)", maxLength: 512, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Address = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
LegalMan = table.Column<string>(type: "varchar(60)", maxLength: 60, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TaxCode = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
OrganizationCode = table.Column<string>(type: "varchar(16)", maxLength: 16, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RegistrationCode = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
RegistrationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ExpirationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
ExtraProperties = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
ConcurrencyStamp = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
CreationTime = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
LastModificationTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
LastModifierId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
IsDeleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
DeletionTime = table.Column<DateTime>(type: "datetime(6)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AppPlatformEnterprises", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AppPlatformEnterprises");
}
}
}

873
aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230509024453_Add-Logo-Property-With-Portal.Designer.cs

@ -0,0 +1,873 @@
// <auto-generated />
using System;
using LY.MicroService.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations
{
[DbContext(typeof(PlatformMigrationsDbContext))]
[Migration("20230509024453_Add-Logo-Property-With-Portal")]
partial class AddLogoPropertyWithPortal
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "7.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Code");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<Guid?>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<bool>("AllowBeNull")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(true);
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<string>("DefaultValue")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DefaultValue");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Description");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsStatic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Name");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<int>("ValueType")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DataId");
b.HasIndex("Name");
b.ToTable("AppPlatformDataItems", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Layouts.Layout", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid>("DataId")
.HasColumnType("char(36)");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Name");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("AppPlatformLayouts", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Menus.Menu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(23)
.HasColumnType("varchar(23)")
.HasColumnName("Code");
b.Property<string>("Component")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Component");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("longtext");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Framework");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<bool>("IsPublic")
.HasColumnType("tinyint(1)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("LayoutId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Name");
b.Property<Guid?>("ParentId")
.HasColumnType("char(36)");
b.Property<string>("Path")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Path");
b.Property<string>("Redirect")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Redirect");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.HasKey("Id");
b.ToTable("AppPlatformMenus", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Menus.RoleMenu", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("RoleName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("RoleName");
b.Property<bool>("Startup")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("AliasName")
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("AliasName");
b.Property<string>("Color")
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("Color");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("varchar(128)")
.HasColumnName("DisplayName");
b.Property<string>("Framework")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Framework");
b.Property<string>("Icon")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("Icon");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("varchar(64)")
.HasColumnName("Name");
b.Property<string>("Path")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Path");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<Guid>("MenuId")
.HasColumnType("char(36)");
b.Property<bool>("Startup")
.HasColumnType("tinyint(1)");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.HasIndex("UserId", "MenuId");
b.ToTable("AppPlatformUserMenus", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Authors")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("Authors");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Description");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("ForceUpdate")
.HasColumnType("tinyint(1)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<int>("Level")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<string>("Note")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Note");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
b.Property<string>("Authors")
.HasMaxLength(100)
.HasColumnType("varchar(100)")
.HasColumnName("Authors");
b.Property<string>("ContentType")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("ContentType");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<int>("DownloadCount")
.HasColumnType("int");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<string>("License")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("License");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<Guid>("PackageId")
.HasColumnType("char(36)");
b.Property<string>("SHA256")
.HasMaxLength(256)
.HasColumnType("varchar(256)")
.HasColumnName("SHA256");
b.Property<long?>("Size")
.HasColumnType("bigint");
b.Property<string>("Summary")
.HasMaxLength(1024)
.HasColumnType("varchar(1024)")
.HasColumnName("Summary");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)")
.HasColumnName("TenantId");
b.Property<DateTime?>("UpdatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("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<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Address");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("EnglishName")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("EnglishName");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("LegalMan")
.HasMaxLength(60)
.HasColumnType("varchar(60)")
.HasColumnName("LegalMan");
b.Property<string>("Logo")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("Logo");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<string>("OrganizationCode")
.HasMaxLength(16)
.HasColumnType("varchar(16)")
.HasColumnName("OrganizationCode");
b.Property<string>("RegistrationCode")
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("RegistrationCode");
b.Property<DateTime?>("RegistrationDate")
.HasColumnType("datetime(6)");
b.Property<string>("TaxCode")
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("TaxCode");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformEnterprises", (string)null);
});
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.Packages.PackageBlob", b =>
{
b.HasOne("LINGYUN.Platform.Packages.Package", "Package")
.WithMany("Blobs")
.HasForeignKey("PackageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Package");
});
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("LINGYUN.Platform.Packages.Package", b =>
{
b.Navigation("Blobs");
});
#pragma warning restore 612, 618
}
}
}

30
aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/20230509024453_Add-Logo-Property-With-Portal.cs

@ -0,0 +1,30 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations
{
/// <inheritdoc />
public partial class AddLogoPropertyWithPortal : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Logo",
table: "AppPlatformEnterprises",
type: "varchar(512)",
maxLength: 512,
nullable: true)
.Annotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Logo",
table: "AppPlatformEnterprises");
}
}
}

103
aspnet-core/migrations/LY.MicroService.Platform.EntityFrameworkCore/Migrations/PlatformMigrationsDbContextModelSnapshot.cs

@ -18,7 +18,7 @@ namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql)
.HasAnnotation("ProductVersion", "7.0.1")
.HasAnnotation("ProductVersion", "7.0.2")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("LINGYUN.Platform.Datas.Data", b =>
@ -734,6 +734,107 @@ namespace LY.MicroService.Platform.EntityFrameworkCore.Migrations
b.ToTable("AppPlatformPackageBlobs", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Portal.Enterprise", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<string>("Address")
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Address");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime(6)")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("char(36)")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("char(36)")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime(6)")
.HasColumnName("DeletionTime");
b.Property<string>("EnglishName")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("EnglishName");
b.Property<DateTime?>("ExpirationDate")
.HasColumnType("datetime(6)");
b.Property<string>("ExtraProperties")
.HasColumnType("longtext")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("tinyint(1)")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime(6)")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("char(36)")
.HasColumnName("LastModifierId");
b.Property<string>("LegalMan")
.HasMaxLength(60)
.HasColumnType("varchar(60)")
.HasColumnName("LegalMan");
b.Property<string>("Logo")
.HasMaxLength(512)
.HasColumnType("varchar(512)")
.HasColumnName("Logo");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("varchar(255)")
.HasColumnName("Name");
b.Property<string>("OrganizationCode")
.HasMaxLength(16)
.HasColumnType("varchar(16)")
.HasColumnName("OrganizationCode");
b.Property<string>("RegistrationCode")
.HasMaxLength(30)
.HasColumnType("varchar(30)")
.HasColumnName("RegistrationCode");
b.Property<DateTime?>("RegistrationDate")
.HasColumnType("datetime(6)");
b.Property<string>("TaxCode")
.HasMaxLength(40)
.HasColumnType("varchar(40)")
.HasColumnName("TaxCode");
b.Property<Guid?>("TenantId")
.HasColumnType("char(36)");
b.HasKey("Id");
b.ToTable("AppPlatformEnterprises", (string)null);
});
modelBuilder.Entity("LINGYUN.Platform.Datas.DataItem", b =>
{
b.HasOne("LINGYUN.Platform.Datas.Data", null)

2
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/LINGYUN/Abp/Elsa/Notifications/AbpElsaWorkflowNotificationHandler.cs

@ -112,7 +112,7 @@ public class AbpElsaWorkflowNotificationHandler :
await notificationSender.SendNofiterAsync(
notificationName,
notificationTemplate,
tenantId: currentTenant.Id ?? workflowInstance.GetTenantId(),
tenantId: executionContext.GetNotificationTenantId() ?? currentTenant.Id ?? workflowInstance.GetTenantId(),
severity: severity);
}
catch (Exception ex)

132
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Notifications/README.md

@ -1,67 +1,69 @@
# LINGYUN.Abp.Elsa.Notifications
工作流通知集成, 当工作流触发后, 发布相应事件通知
## 可用状态
* Faulted: 工作流执行出现错误
* Cancelled: 工作流取消
* Completed: 工作流执行完毕
* Suspended: 工作流暂停
## 配置使用
```csharp
[DependsOn(
typeof(AbpElsaNotificationsModule)
)]
public class YouProjectModule : AbpModule
{
}
```
```csharp
// 定义通知
public class DemoNotificationDefinitionProvider : NotificationDefinitionProvider
{
public override void Define(INotificationDefinitionContext context)
{
var demoGroup = context.AddGroup("Group");
// 由于通知的多样性, 需要使用模板消息来传递数据
demoGroup.AddNotification("Faulted")
.WithTemplate(template => { });
demoGroup.AddNotification("Cancelled")
.WithTemplate(template => { });
demoGroup.AddNotification("Suspended")
.WithTemplate(template => { });
demoGroup.AddNotification("Completed")
.WithTemplate(template => { });
}
}
```
```csharp
// 定义工作流
public class DemoWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.WithFaultedNotification("Faulted")
.WithCancelledNotification("Cancelled")
.WithSuspendedNotification("Suspended")
.WithCompletedNotification("Completed")
.SetVariable("demo", context =>
{
// 可传递自定义参数, 将作为瞬时变量写入到发布的通知数据中
# LINGYUN.Abp.Elsa.Notifications
工作流通知集成, 当工作流触发后, 发布相应事件通知
## 可用状态
* Faulted: 工作流执行出现错误
* Cancelled: 工作流取消
* Completed: 工作流执行完毕
* Suspended: 工作流暂停
## 配置使用
```csharp
[DependsOn(
typeof(AbpElsaNotificationsModule)
)]
public class YouProjectModule : AbpModule
{
}
```
```csharp
// 定义通知
public class DemoNotificationDefinitionProvider : NotificationDefinitionProvider
{
public override void Define(INotificationDefinitionContext context)
{
var demoGroup = context.AddGroup("Group");
// 由于通知的多样性, 需要使用模板消息来传递数据
demoGroup.AddNotification("Faulted")
.WithTemplate(template => { });
demoGroup.AddNotification("Cancelled")
.WithTemplate(template => { });
demoGroup.AddNotification("Suspended")
.WithTemplate(template => { });
demoGroup.AddNotification("Completed")
.WithTemplate(template => { });
}
}
```
```csharp
// 定义工作流
public class DemoWorkflow : IWorkflow
{
public void Build(IWorkflowBuilder builder)
{
builder
.WithFaultedNotification("Faulted")
.WithCancelledNotification("Cancelled")
.WithSuspendedNotification("Suspended")
.WithCompletedNotification("Completed")
.SetVariable("demo", context =>
{
// 可传递自定义参数, 将作为瞬时变量写入到发布的通知数据中
context.WithNotificationData("demo", "demo");
})
.WriteLine("Start a workflow.")
.WriteLine("Workflow finished.");
}
}
// 自定义用于发布通知的租户标识
context.WithNotificationTenantId(Guid.NewGuid());
})
.WriteLine("Start a workflow.")
.WriteLine("Workflow finished.");
}
}
```

38
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa/LINGYUN/Abp/Elsa/Notifications/AbpWorkflowExecutionContextNotificationsExtensions.cs

@ -1,14 +1,50 @@
using Elsa.Services.Models;
using System;
using System.Collections.Generic;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Elsa.Notifications;
public static class AbpWorkflowExecutionContextNotificationsExtensions
{
private const string NotificationDataKey = AbpWorkflowBuilderNotificationsExtensions.NotificationPrefix + "Data_";
#region MultiTenancy
public static void WithNotificationTenantId(this ActivityExecutionContext context, Guid? tenantId)
{
context.WorkflowExecutionContext.WithNotificationTenantId(tenantId);
}
public static void WithNotificationTenantId(this WorkflowExecutionContext context, Guid? tenantId)
{
if (tenantId.HasValue)
{
context.WithNotificationData(nameof(IMultiTenant.TenantId), tenantId.Value);
}
}
public static Guid? GetNotificationTenantId(this ActivityExecutionContext context)
{
return context.WorkflowExecutionContext.GetNotificationTenantId();
}
public static Guid? GetNotificationTenantId(this WorkflowExecutionContext context)
{
var data = context.GetNotificationData();
if (data.TryGetValue(nameof(IMultiTenant.TenantId), out var tenantIdObj) &&
tenantIdObj != null && Guid.TryParse(tenantIdObj.ToString(), out Guid tenantId))
{
return tenantId;
}
return null;
}
#endregion
public static void WithNotificationData(this ActivityExecutionContext context, string key, object data)
{
context.WorkflowExecutionContext.SetTransientVariable(key, data);
context.WorkflowExecutionContext.WithNotificationData(key, data);
}
public static void WithNotificationData(this WorkflowExecutionContext context, string key, object data)

3
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/FodyWeavers.xml

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

30
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/FodyWeavers.xsd

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

19
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN.Abp.IdentityServer.Portal.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.IdentityServer.Domain" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\platform\LINGYUN.Platform.Domain\LINGYUN.Platform.Domain.csproj" />
</ItemGroup>
</Project>

40
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/AbpIdentityServerPortalModule.cs

@ -0,0 +1,40 @@
using LINGYUN.Platform;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.IdentityServer;
using Volo.Abp.IdentityServer.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.IdentityServer.Portal;
[DependsOn(
typeof(AbpIdentityServerDomainModule),
typeof(PlatformDomainModule))]
public class AbpIdentityServerPortalModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
PreConfigure<IIdentityServerBuilder>(builder =>
{
builder.AddExtensionGrantValidator<PortalGrantValidator>();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpIdentityServerPortalModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<AbpIdentityServerResource>()
.AddVirtualJson("/LINGYUN/Abp/IdentityServer/Portal/Localization");
});
}
}

255
aspnet-core/modules/identityServer/LINGYUN.Abp.IdentityServer.Portal/LINGYUN/Abp/IdentityServer/Portal/PortalGrantValidator.cs

@ -0,0 +1,255 @@
using IdentityModel;
using IdentityServer4.Configuration;
using IdentityServer4.Events;
using IdentityServer4.Models;
using IdentityServer4.Services;
using IdentityServer4.Validation;
using LINGYUN.Platform.Portal;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Security.Claims;
using Volo.Abp.Uow;
using static IdentityModel.OidcConstants;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
namespace LINGYUN.Abp.IdentityServer.Portal;
public class PortalGrantValidator : IExtensionGrantValidator
{
public const string ProviderName = "portal";
public string GrantType => ProviderName;
private readonly ILogger<PortalGrantValidator> _logger;
private readonly IdentityServerOptions _options;
private readonly IEventService _events;
private readonly IResourceOwnerPasswordValidator _resourceOwnerValidator;
private readonly IdentitySecurityLogManager _identitySecurityLogManager;
private readonly UserManager<IdentityUser> _userManager;
private readonly ICurrentTenant _currentTenant;
private readonly IEnterpriseRepository _enterpriseRepository;
public PortalGrantValidator(
ILogger<PortalGrantValidator> logger,
IOptions<IdentityServerOptions> options,
IEventService events,
IResourceOwnerPasswordValidator resourceOwnerValidator,
IdentitySecurityLogManager identitySecurityLogManager,
UserManager<IdentityUser> userManager,
ICurrentTenant currentTenant,
IEnterpriseRepository enterpriseRepository)
{
_logger = logger;
_options = options.Value;
_events = events;
_resourceOwnerValidator = resourceOwnerValidator;
_identitySecurityLogManager = identitySecurityLogManager;
_userManager = userManager;
_currentTenant = currentTenant;
_enterpriseRepository = enterpriseRepository;
}
[UnitOfWork]
public async virtual Task ValidateAsync(ExtensionGrantValidationContext context)
{
/* ************************************
*
* 宿,
*
* 1使protal发起登录请求
* 2 EnterpriseId
* 2.1 EnterpriseId , ,
* 2.2 EnterpriseId , , password
* 3token
*
* *************************************/
var parameters = context.Request.Raw;
Guid? tenantId = null;
using (_currentTenant.Change(null))
{
var enterprise = parameters.Get("EnterpriseId");
if (enterprise.IsNullOrWhiteSpace() || !Guid.TryParse(enterprise, out var enterpriseId))
{
// TODO: configurabled
var enterprises = await _enterpriseRepository.GetEnterprisesInTenantListAsync(25);
context.Result = new GrantValidationResult(
TokenRequestErrors.InvalidGrant,
customResponse: new Dictionary<string, object>
{
// 是否可直接选择的模式
{ "Enterprises", JsonConvert.SerializeObject(enterprises.Select(x => new { Id = x.Id, Name = x.Name, Logo = x.Logo })) },
});
return;
}
tenantId = await _enterpriseRepository.GetEnterpriseInTenantAsync(enterpriseId);
}
using (_currentTenant.Change(tenantId))
{
var validatedRequest = new ValidatedTokenRequest
{
Raw = parameters ?? throw new ArgumentNullException(nameof(parameters)),
Options = _options
};
var userName = parameters.Get(OidcConstants.TokenRequest.UserName);
var password = parameters.Get(OidcConstants.TokenRequest.Password);
if (userName.IsNullOrWhiteSpace())
{
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant);
return;
}
if (password.IsNullOrWhiteSpace())
{
password = "";
}
if (userName.Length > _options.InputLengthRestrictions.UserName ||
password.Length > _options.InputLengthRestrictions.Password)
{
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant);
return;
}
var resourceOwnerContext = new ResourceOwnerPasswordValidationContext
{
UserName = userName,
Password = password,
Request = validatedRequest
};
await _resourceOwnerValidator.ValidateAsync(resourceOwnerContext);
if (resourceOwnerContext.Result.IsError)
{
// protect against bad validator implementations
resourceOwnerContext.Result.Error ??= OidcConstants.TokenErrors.InvalidGrant;
if (resourceOwnerContext.Result.Error == OidcConstants.TokenErrors.UnsupportedGrantType)
{
_logger.LogError("Resource owner password credential grant type not supported");
await RaiseFailedResourceOwnerAuthenticationEventAsync(userName, "password grant type not supported", resourceOwnerContext.Request.Client.ClientId);
context.Result = new GrantValidationResult(TokenRequestErrors.UnsupportedGrantType, customResponse: resourceOwnerContext.Result.CustomResponse);
return;
}
var errorDescription = "invalid_username_or_password";
if (!resourceOwnerContext.Result.ErrorDescription.IsNullOrWhiteSpace())
{
errorDescription = resourceOwnerContext.Result.ErrorDescription;
}
_logger.LogInformation("User authentication failed: ", errorDescription ?? resourceOwnerContext.Result.Error);
await RaiseFailedResourceOwnerAuthenticationEventAsync(userName, errorDescription, context.Request.Client.ClientId);
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant, errorDescription, resourceOwnerContext.Result.CustomResponse);
return;
}
if (resourceOwnerContext.Result.Subject == null)
{
var error = "User authentication failed: no principal returned";
_logger.LogError(error);
await RaiseFailedResourceOwnerAuthenticationEventAsync(userName, error, context.Request.Client.ClientId);
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant);
return;
}
var currentUser = await _userManager.GetUserAsync(resourceOwnerContext.Result.Subject);
await _events.RaiseAsync(new UserLoginSuccessEvent(userName, currentUser.Id.ToString(), currentUser.Name));
await SetSuccessResultAsync(context, currentUser);
}
}
protected async virtual Task SetSuccessResultAsync(ExtensionGrantValidationContext context, IdentityUser user)
{
var sub = await _userManager.GetUserIdAsync(user);
_logger.LogInformation("Credentials validated for username: {username}", user.UserName);
var additionalClaims = new List<Claim>();
await AddCustomClaimsAsync(additionalClaims, user, context);
context.Result = new GrantValidationResult(
sub,
AuthenticationMethods.ConfirmationBySms,
additionalClaims.ToArray()
);
await SaveSecurityLogAsync(
context,
user,
IdentityServerSecurityLogActionConsts.LoginSucceeded);
}
protected async virtual Task SaveSecurityLogAsync(
ExtensionGrantValidationContext context,
IdentityUser user,
string action)
{
var logContext = new IdentitySecurityLogContext
{
Identity = IdentityServerSecurityLogIdentityConsts.IdentityServer,
Action = action,
UserName = user.UserName,
ClientId = await FindClientIdAsync(context)
};
logContext.WithProperty("GrantType", GrantType);
await _identitySecurityLogManager.SaveAsync(logContext);
}
protected virtual Task<string> FindClientIdAsync(ExtensionGrantValidationContext context)
{
return Task.FromResult(context.Request?.Client?.ClientId);
}
protected virtual Task AddCustomClaimsAsync(
List<Claim> customClaims,
IdentityUser user,
ExtensionGrantValidationContext context)
{
if (user.TenantId.HasValue)
{
customClaims.Add(
new Claim(
AbpClaimTypes.TenantId,
user.TenantId?.ToString()
)
);
}
return Task.CompletedTask;
}
private Task RaiseFailedResourceOwnerAuthenticationEventAsync(string userName, string error, string clientId)
{
return _events.RaiseAsync(new UserLoginFailureEvent(userName, error, interactive: false, clientId: clientId));
}
}

3
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/FodyWeavers.xml

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

30
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/FodyWeavers.xsd

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

19
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN.Abp.OpenIddict.Portal.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\common.props" />
<Import Project="..\..\..\configureawait.props" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.OpenIddict.AspNetCore" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\platform\LINGYUN.Platform.Domain\LINGYUN.Platform.Domain.csproj" />
</ItemGroup>
</Project>

31
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/AbpOpenIddictPortalModule.cs

@ -0,0 +1,31 @@
using LINGYUN.Platform;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict;
using Volo.Abp.OpenIddict.ExtensionGrantTypes;
namespace LINGYUN.Abp.OpenIddict.Portal;
[DependsOn(
typeof(AbpOpenIddictAspNetCoreModule),
typeof(PlatformDomainModule))]
public class AbpOpenIddictPortalModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<OpenIddictServerBuilder>(builder =>
{
builder.AllowPortalFlow();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpOpenIddictExtensionGrantsOptions>(options =>
{
options.Grants.TryAdd(
PortalTokenExtensionGrantConsts.GrantType,
new PortalTokenExtensionGrant());
});
}
}

328
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrant.cs

@ -0,0 +1,328 @@
using LINGYUN.Platform.Portal;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using OpenIddict.Abstractions;
using OpenIddict.Server.AspNetCore;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.OpenIddict;
using Volo.Abp.OpenIddict.ExtensionGrantTypes;
using Volo.Abp.Uow;
using Volo.Abp.Validation;
using IdentityUser = Volo.Abp.Identity.IdentityUser;
using SignInResult = Microsoft.AspNetCore.Identity.SignInResult;
namespace LINGYUN.Abp.OpenIddict.Portal;
public class PortalTokenExtensionGrant : ITokenExtensionGrant
{
public string Name => PortalTokenExtensionGrantConsts.GrantType;
protected IAbpLazyServiceProvider LazyServiceProvider { get; set; }
protected ICurrentTenant CurrentTenant => LazyServiceProvider.LazyGetRequiredService<ICurrentTenant>();
protected IUnitOfWorkManager UnitOfWorkManager => LazyServiceProvider.LazyGetRequiredService<IUnitOfWorkManager>();
protected IEnterpriseRepository EnterpriseRepository => LazyServiceProvider.LazyGetRequiredService<IEnterpriseRepository>();
protected SignInManager<IdentityUser> SignInManager => LazyServiceProvider.LazyGetRequiredService<SignInManager<IdentityUser>>();
protected IdentityUserManager UserManager => LazyServiceProvider.LazyGetRequiredService<IdentityUserManager>();
protected IOpenIddictScopeManager ScopeManager => LazyServiceProvider.LazyGetRequiredService<IOpenIddictScopeManager>();
protected AbpOpenIddictClaimDestinationsManager OpenIddictClaimDestinationsManager => LazyServiceProvider.LazyGetRequiredService<AbpOpenIddictClaimDestinationsManager>();
protected ILoggerFactory LoggerFactory => LazyServiceProvider.LazyGetRequiredService<ILoggerFactory>();
protected ILogger Logger => LazyServiceProvider.LazyGetService<ILogger>(provider => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance);
protected IServiceScopeFactory ServiceScopeFactory => LazyServiceProvider.LazyGetRequiredService<IServiceScopeFactory>();
protected IOptions<AbpIdentityOptions> AbpIdentityOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpIdentityOptions>>();
protected IOptions<IdentityOptions> IdentityOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<IdentityOptions>>();
protected IOptions<AbpAspNetCoreMultiTenancyOptions> MultiTenancyOptions => LazyServiceProvider.LazyGetRequiredService<IOptions<AbpAspNetCoreMultiTenancyOptions>>();
protected IdentitySecurityLogManager IdentitySecurityLogManager => LazyServiceProvider.LazyGetRequiredService<IdentitySecurityLogManager>();
public async virtual Task<IActionResult> HandleAsync(ExtensionGrantContext context)
{
LazyServiceProvider = context.HttpContext.RequestServices.GetRequiredService<IAbpLazyServiceProvider>();
using var scope = ServiceScopeFactory.CreateScope();
using var unitOfWork = UnitOfWorkManager.Begin();
var enterprise = context.Request.GetParameter("EnterpriseId")?.ToString();
Guid? tenantId = null;
using (CurrentTenant.Change(null))
{
if (enterprise.IsNullOrWhiteSpace() || !Guid.TryParse(enterprise, out var enterpriseId))
{
// TODO: configurabled
var enterprises = await EnterpriseRepository.GetEnterprisesInTenantListAsync(25);
var properties = new AuthenticationProperties(
new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "invalid_enterprise"
},
new Dictionary<string, object>
{
// 是否可直接选择的模式
{ "Enterprises", JsonConvert.SerializeObject(enterprises.Select(x => new { Id = x.Id, Name = x.Name, Logo = x.Logo })) },
}
);
return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
tenantId = await EnterpriseRepository.GetEnterpriseInTenantAsync(enterpriseId);
}
using (CurrentTenant.Change(tenantId))
{
return await HandlePasswordAsync(context);
}
}
protected virtual async Task<IActionResult> HandlePasswordAsync(ExtensionGrantContext context)
{
await ReplaceEmailToUsernameOfInputIfNeeds(context.Request);
IdentityUser user = null;
if (AbpIdentityOptions.Value.ExternalLoginProviders.Any())
{
foreach (var externalLoginProviderInfo in AbpIdentityOptions.Value.ExternalLoginProviders.Values)
{
var externalLoginProvider = (IExternalLoginProvider)context.HttpContext.RequestServices
.GetRequiredService(externalLoginProviderInfo.Type);
if (await externalLoginProvider.TryAuthenticateAsync(context.Request.Username, context.Request.Password))
{
user = await UserManager.FindByNameAsync(context.Request.Username);
if (user == null)
{
user = await externalLoginProvider.CreateUserAsync(context.Request.Username, externalLoginProviderInfo.Name);
}
else
{
await externalLoginProvider.UpdateUserAsync(user, externalLoginProviderInfo.Name);
}
return await SetSuccessResultAsync(context, user);
}
}
}
await IdentityOptions.SetAsync();
user = await UserManager.FindByNameAsync(context.Request.Username);
if (user == null)
{
Logger.LogInformation("No user found matching username: {username}", context.Request.Username);
var properties = new AuthenticationProperties(new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Invalid username or password!"
});
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext()
{
Identity = OpenIddictSecurityLogIdentityConsts.OpenIddict,
Action = OpenIddictSecurityLogActionConsts.LoginInvalidUserName,
UserName = context.Request.Username,
ClientId = context.Request.ClientId
});
return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
var result = await SignInManager.CheckPasswordSignInAsync(user, context.Request.Password, true);
if (!result.Succeeded)
{
string errorDescription;
if (result.IsLockedOut)
{
Logger.LogInformation("Authentication failed for username: {username}, reason: locked out", context.Request.Username);
errorDescription = "The user account has been locked out due to invalid login attempts. Please wait a while and try again.";
}
else if (result.IsNotAllowed)
{
Logger.LogInformation("Authentication failed for username: {username}, reason: not allowed", context.Request.Username);
errorDescription = "You are not allowed to login! Your account is inactive or needs to confirm your email/phone number.";
}
else
{
Logger.LogInformation("Authentication failed for username: {username}, reason: invalid credentials", context.Request.Username);
errorDescription = "Invalid username or password!";
}
var properties = new AuthenticationProperties(new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = errorDescription
});
return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
if (await IsTfaEnabledAsync(user))
{
return await HandleTwoFactorLoginAsync(context, user);
}
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
{
Identity = OpenIddictSecurityLogIdentityConsts.OpenIddict,
Action = result.ToIdentitySecurityLogAction(),
UserName = context.Request.Username,
ClientId = context.Request.ClientId
});
return await SetSuccessResultAsync(context, user);
}
protected virtual async Task ReplaceEmailToUsernameOfInputIfNeeds(OpenIddictRequest request)
{
if (!ValidationHelper.IsValidEmailAddress(request.Username))
{
return;
}
var userByUsername = await UserManager.FindByNameAsync(request.Username);
if (userByUsername != null)
{
return;
}
var userByEmail = await UserManager.FindByEmailAsync(request.Username);
if (userByEmail == null)
{
return;
}
request.Username = userByEmail.UserName;
}
protected virtual async Task<IActionResult> HandleTwoFactorLoginAsync(ExtensionGrantContext context, IdentityUser user)
{
var twoFactorProvider = context.Request.GetParameter("TwoFactorProvider")?.ToString();
var twoFactorCode = context.Request.GetParameter("TwoFactorCode")?.ToString(); ;
if (!twoFactorProvider.IsNullOrWhiteSpace() && !twoFactorCode.IsNullOrWhiteSpace())
{
var providers = await UserManager.GetValidTwoFactorProvidersAsync(user);
if (providers.Contains(twoFactorProvider) && await UserManager.VerifyTwoFactorTokenAsync(user, twoFactorProvider, twoFactorCode))
{
return await SetSuccessResultAsync(context, user);
}
Logger.LogInformation("Authentication failed for username: {username}, reason: InvalidAuthenticatorCode", context.Request.Username);
var properties = new AuthenticationProperties(new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "Invalid authenticator code!"
});
return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
else
{
Logger.LogInformation("Authentication failed for username: {username}, reason: RequiresTwoFactor", context.Request.Username);
var twoFactorToken = await UserManager.GenerateUserTokenAsync(user, TokenOptions.DefaultProvider, nameof(SignInResult.RequiresTwoFactor));
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
{
Identity = OpenIddictSecurityLogIdentityConsts.OpenIddict,
Action = OpenIddictSecurityLogActionConsts.LoginRequiresTwoFactor,
UserName = context.Request.Username,
ClientId = context.Request.ClientId
});
var properties = new AuthenticationProperties(
items: new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.InvalidGrant,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] =
nameof(SignInResult.RequiresTwoFactor),
},
parameters: new Dictionary<string, object>
{
["userId"] = user.Id.ToString("N"),
["twoFactorToken"] = twoFactorToken
});
return Forbid(properties, OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);
}
}
protected virtual async Task<IActionResult> SetSuccessResultAsync(ExtensionGrantContext context, IdentityUser user)
{
// Create a new ClaimsPrincipal containing the claims that
// will be used to create an id_token, a token or a code.
var principal = await SignInManager.CreateUserPrincipalAsync(user);
principal.SetScopes(context.Request.GetScopes());
principal.SetResources(await GetResourcesAsync(context.Request.GetScopes()));
await SetClaimsDestinationsAsync(principal);
await IdentitySecurityLogManager.SaveAsync(
new IdentitySecurityLogContext
{
Identity = OpenIddictSecurityLogIdentityConsts.OpenIddict,
Action = OpenIddictSecurityLogActionConsts.LoginSucceeded,
UserName = context.Request.Username,
ClientId = context.Request.ClientId
}
);
if (user.TenantId.HasValue)
{
AbpMultiTenancyCookieHelper.SetTenantCookie(
context.HttpContext,
user.TenantId,
MultiTenancyOptions.Value.TenantKey);
}
return new Microsoft.AspNetCore.Mvc.SignInResult(OpenIddictServerAspNetCoreDefaults.AuthenticationScheme, principal);
}
protected virtual async Task<bool> IsTfaEnabledAsync(IdentityUser user)
{
return UserManager.SupportsUserTwoFactor &&
await UserManager.GetTwoFactorEnabledAsync(user) &&
(await UserManager.GetValidTwoFactorProvidersAsync(user)).Count > 0;
}
protected virtual async Task<IEnumerable<string>> GetResourcesAsync(ImmutableArray<string> scopes)
{
var resources = new List<string>();
if (!scopes.Any())
{
return resources;
}
await foreach (var resource in ScopeManager.ListResourcesAsync(scopes))
{
resources.Add(resource);
}
return resources;
}
protected virtual async Task SetClaimsDestinationsAsync(ClaimsPrincipal principal)
{
await OpenIddictClaimDestinationsManager.SetAsync(principal);
}
public virtual ForbidResult Forbid(AuthenticationProperties properties, params string[] authenticationSchemes)
{
return new ForbidResult(
authenticationSchemes,
properties);
}
}

5
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/LINGYUN/Abp/OpenIddict/Portal/PortalTokenExtensionGrantConsts.cs

@ -0,0 +1,5 @@
namespace LINGYUN.Abp.OpenIddict.Portal;
public static class PortalTokenExtensionGrantConsts
{
public const string GrantType = "portal";
}

11
aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.Portal/Microsoft/Extensions/DependencyInjection/PortalOpenIddictServerBuilderExtensions.cs

@ -0,0 +1,11 @@
using LINGYUN.Abp.OpenIddict.Portal;
namespace Microsoft.Extensions.DependencyInjection;
public static class PortalOpenIddictServerBuilderExtensions
{
public static OpenIddictServerBuilder AllowPortalFlow(this OpenIddictServerBuilder builder)
{
return builder.AllowCustomFlow(PortalTokenExtensionGrantConsts.GrantType);
}
}

12
aspnet-core/modules/platform/LINGYUN.Platform.Domain.Shared/LINGYUN/Platform/Portal/EnterpriseConsts.cs

@ -0,0 +1,12 @@
namespace LINGYUN.Platform.Portal;
public static class EnterpriseConsts
{
public static int MaxNameLength { get; set; } = 255;
public static int MaxEnglishNameLength { get; set; } = 512;
public static int MaxLogoLength { get; set; } = 512;
public static int MaxAddressLength { get; set; } = 255;
public static int MaxLegalManLength { get; set; } = 60;
public static int MaxTaxCodeLength { get; set; } = 40;
public static int MaxOrganizationCodeLength { get; set; } = 16;
public static int MaxRegistrationCodeLength { get; set; } = 30;
}

109
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/Enterprise.cs

@ -0,0 +1,109 @@
using System;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Domain.Entities.Auditing;
namespace LINGYUN.Platform.Portal;
/// <summary>
/// 企业信息
/// </summary>
public class Enterprise : FullAuditedAggregateRoot<Guid>
{
/// <summary>
/// 租户标识
/// </summary>
public virtual Guid? TenantId { get; protected set; }
/// <summary>
/// 名称
/// </summary>
public virtual string Name { get; protected set; }
/// <summary>
/// 英文名称
/// </summary>
public virtual string EnglishName { get; set; }
/// <summary>
/// Logo
/// </summary>
public virtual string Logo { get; set; }
/// <summary>
/// 地址
/// </summary>
public virtual string Address { get; set; }
/// <summary>
/// 法人代表
/// </summary>
public virtual string LegalMan { get; set; }
/// <summary>
/// 税务登记号
/// </summary>
public virtual string TaxCode { get; set; }
/// <summary>
/// 组织机构代码
/// </summary>
public virtual string OrganizationCode { get; protected set; }
/// <summary>
/// 注册代码
/// </summary>
public virtual string RegistrationCode { get; protected set; }
/// <summary>
/// 注册日期
/// </summary>
public virtual DateTime? RegistrationDate { get; protected set; }
/// <summary>
/// 过期日期
/// </summary>
public virtual DateTime? ExpirationDate { get; protected set; }
protected Enterprise()
{
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
}
public Enterprise(
string name,
string address,
string taxCode,
string organizationCode = null,
string registrationCode = null,
DateTime? registrationDate = null,
DateTime? expirationDate = null,
Guid? tenantId = null)
{
Address = Check.Length(address, nameof(address), EnterpriseConsts.MaxAddressLength);
TaxCode = Check.Length(taxCode, nameof(taxCode), EnterpriseConsts.MaxTaxCodeLength);
TenantId = tenantId;
SetName(name);
SetOrganization(organizationCode);
SetRegistration(registrationCode, registrationDate, expirationDate);
ExtraProperties = new ExtraPropertyDictionary();
this.SetDefaultsForExtraProperties();
}
public void SetTenantId(Guid? tenantId = null)
{
TenantId = tenantId;
}
public void SetName(string name, string englishName = null)
{
Name = Check.NotNullOrWhiteSpace(name, nameof(name), EnterpriseConsts.MaxNameLength);
EnglishName = Check.Length(englishName, nameof(englishName), EnterpriseConsts.MaxEnglishNameLength);
}
public void SetOrganization(string organizationCode)
{
OrganizationCode = Check.Length(organizationCode, nameof(organizationCode), EnterpriseConsts.MaxOrganizationCodeLength);
}
public void SetRegistration(
string registrationCode,
DateTime? registrationDate = null,
DateTime? expirationDate = null)
{
RegistrationCode = Check.Length(registrationCode, nameof(registrationCode), EnterpriseConsts.MaxRegistrationCodeLength);
RegistrationDate = registrationDate;
ExpirationDate = expirationDate;
}
}

17
aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Portal/IEnterpriseRepository.cs

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
namespace LINGYUN.Platform.Portal;
public interface IEnterpriseRepository : IBasicRepository<Enterprise, Guid>
{
Task<List<Enterprise>> GetEnterprisesInTenantListAsync(
int maxResultCount = 10,
CancellationToken cancellationToken = default);
Task<Guid?> GetEnterpriseInTenantAsync(
Guid id,
CancellationToken cancellationToken = default);
}

46
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/IPlatformDbContext.cs

@ -1,24 +1,26 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Packages;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.EntityFrameworkCore
{
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public interface IPlatformDbContext : IEfCoreDbContext
{
DbSet<Menu> Menus { get; }
DbSet<Layout> Layouts { get; }
DbSet<RoleMenu> RoleMenus { get; }
using LINGYUN.Platform.Portal;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.EntityFrameworkCore
{
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public interface IPlatformDbContext : IEfCoreDbContext
{
DbSet<Menu> Menus { get; }
DbSet<Layout> Layouts { get; }
DbSet<RoleMenu> RoleMenus { get; }
DbSet<UserMenu> UserMenus { get; }
DbSet<UserFavoriteMenu> UserFavoriteMenus { get; }
DbSet<Data> Datas { get; }
DbSet<DataItem> DataItems { get; }
DbSet<Package> Packages { get; }
DbSet<PackageBlob> PackageBlobs { get; }
}
}
DbSet<UserFavoriteMenu> UserFavoriteMenus { get; }
DbSet<Data> Datas { get; }
DbSet<DataItem> DataItems { get; }
DbSet<Package> Packages { get; }
DbSet<PackageBlob> PackageBlobs { get; }
DbSet<Enterprise> Enterprises { get; }
}
}

64
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContext.cs

@ -1,36 +1,38 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Packages;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.EntityFrameworkCore
{
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public class PlatformDbContext : AbpDbContext<PlatformDbContext>, IPlatformDbContext
{
using LINGYUN.Platform.Portal;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.EntityFrameworkCore
{
[ConnectionStringName(PlatformDbProperties.ConnectionStringName)]
public class PlatformDbContext : AbpDbContext<PlatformDbContext>, IPlatformDbContext
{
public DbSet<RoleMenu> RoleMenus { get; set; }
public DbSet<UserMenu> UserMenus { get; set; }
public DbSet<UserFavoriteMenu> UserFavoriteMenus { get; set; }
public DbSet<Menu> Menus { get; set; }
public DbSet<Layout> Layouts { get; set; }
public DbSet<UserFavoriteMenu> UserFavoriteMenus { get; set; }
public DbSet<Menu> Menus { get; set; }
public DbSet<Layout> Layouts { get; set; }
public DbSet<Data> Datas { get; set; }
public DbSet<DataItem> DataItems { get; set; }
public DbSet<DataItem> DataItems { get; set; }
public DbSet<Package> Packages { get; set; }
public DbSet<PackageBlob> PackageBlobs { get; set; }
public PlatformDbContext(DbContextOptions<PlatformDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigurePlatform();
}
}
}
public DbSet<PackageBlob> PackageBlobs { get; set; }
public DbSet<Enterprise> Enterprises { get; set; }
public PlatformDbContext(DbContextOptions<PlatformDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
builder.ConfigurePlatform();
}
}
}

36
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformDbContextModelBuilderExtensions.cs

@ -3,12 +3,14 @@ using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Packages;
using LINGYUN.Platform.Portal;
using LINGYUN.Platform.Routes;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
using static System.Runtime.CompilerServices.RuntimeHelpers;
namespace LINGYUN.Platform.EntityFrameworkCore
{
@ -241,6 +243,40 @@ namespace LINGYUN.Platform.EntityFrameworkCore
x.HasIndex(i => new { i.PackageId, i.Name });
});
builder.Entity<Enterprise>(x =>
{
x.ToTable(options.TablePrefix + "Enterprises", options.Schema);
x.Property(p => p.Name)
.IsRequired()
.HasColumnName(nameof(Enterprise.Name))
.HasMaxLength(EnterpriseConsts.MaxNameLength);
x.Property(p => p.EnglishName)
.HasColumnName(nameof(Enterprise.EnglishName))
.HasMaxLength(EnterpriseConsts.MaxEnglishNameLength);
x.Property(p => p.Address)
.HasColumnName(nameof(Enterprise.Address))
.HasMaxLength(EnterpriseConsts.MaxAddressLength);
x.Property(p => p.Logo)
.HasColumnName(nameof(Enterprise.Logo))
.HasMaxLength(EnterpriseConsts.MaxLogoLength);
x.Property(p => p.LegalMan)
.HasColumnName(nameof(Enterprise.LegalMan))
.HasMaxLength(EnterpriseConsts.MaxLegalManLength);
x.Property(p => p.TaxCode)
.HasColumnName(nameof(Enterprise.TaxCode))
.HasMaxLength(EnterpriseConsts.MaxTaxCodeLength);
x.Property(p => p.OrganizationCode)
.HasColumnName(nameof(Enterprise.OrganizationCode))
.HasMaxLength(EnterpriseConsts.MaxOrganizationCodeLength);
x.Property(p => p.RegistrationCode)
.HasColumnName(nameof(Enterprise.RegistrationCode))
.HasMaxLength(EnterpriseConsts.MaxRegistrationCodeLength);
x.ConfigureByConvention();
});
}
public static EntityTypeBuilder<TRoute> ConfigureRoute<TRoute>(

112
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEfCoreQueryableExtensions.cs

@ -1,57 +1,57 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Packages;
using Microsoft.EntityFrameworkCore;
using System.Linq;
namespace LINGYUN.Platform.EntityFrameworkCore
{
public static class PlatformEfCoreQueryableExtensions
{
public static IQueryable<Layout> IncludeDetails(this IQueryable<Layout> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable;
}
public static IQueryable<Menu> IncludeDetails(this IQueryable<Menu> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable;
}
public static IQueryable<Data> IncludeDetails(this IQueryable<Data> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
.AsSplitQuery()
.Include(x => x.Items);
}
public static IQueryable<Package> IncludeDetails(this IQueryable<Package> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
.AsSplitQuery()
.Include(x => x.Blobs);
}
}
}
using Microsoft.EntityFrameworkCore;
using System.Linq;
namespace LINGYUN.Platform.EntityFrameworkCore
{
public static class PlatformEfCoreQueryableExtensions
{
public static IQueryable<Layout> IncludeDetails(this IQueryable<Layout> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable;
}
public static IQueryable<Menu> IncludeDetails(this IQueryable<Menu> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable;
}
public static IQueryable<Data> IncludeDetails(this IQueryable<Data> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
.AsSplitQuery()
.Include(x => x.Items);
}
public static IQueryable<Package> IncludeDetails(this IQueryable<Package> queryable, bool include = true)
{
if (!include)
{
return queryable;
}
return queryable
.AsSplitQuery()
.Include(x => x.Blobs);
}
}
}

62
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/EntityFrameworkCore/PlatformEntityFrameworkCoreModule.cs

@ -1,32 +1,34 @@
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Datas;
using LINGYUN.Platform.Layouts;
using LINGYUN.Platform.Menus;
using LINGYUN.Platform.Packages;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace LINGYUN.Platform.EntityFrameworkCore
{
[DependsOn(
typeof(PlatformDomainModule),
typeof(AbpEntityFrameworkCoreModule))]
public class PlatformEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<PlatformDbContext>(options =>
{
options.AddRepository<Data, EfCoreDataRepository>();
options.AddRepository<Menu, EfCoreMenuRepository>();
options.AddRepository<UserMenu, EfCoreUserMenuRepository>();
using LINGYUN.Platform.Portal;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
namespace LINGYUN.Platform.EntityFrameworkCore
{
[DependsOn(
typeof(PlatformDomainModule),
typeof(AbpEntityFrameworkCoreModule))]
public class PlatformEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<PlatformDbContext>(options =>
{
options.AddRepository<Data, EfCoreDataRepository>();
options.AddRepository<Menu, EfCoreMenuRepository>();
options.AddRepository<UserMenu, EfCoreUserMenuRepository>();
options.AddRepository<RoleMenu, EfCoreRoleMenuRepository>();
options.AddRepository<UserFavoriteMenu, EfCoreUserFavoriteMenuRepository>();
options.AddRepository<Layout, EfCoreLayoutRepository>();
options.AddRepository<Package, EfCorePackageRepository>();
options.AddDefaultRepositories(includeAllEntities: true);
});
}
}
}
options.AddRepository<UserFavoriteMenu, EfCoreUserFavoriteMenuRepository>();
options.AddRepository<Layout, EfCoreLayoutRepository>();
options.AddRepository<Package, EfCorePackageRepository>();
options.AddRepository<Enterprise, EfCoreEnterpriseRepository>();
options.AddDefaultRepositories(includeAllEntities: true);
});
}
}
}

40
aspnet-core/modules/platform/LINGYUN.Platform.EntityFrameworkCore/LINGYUN/Platform/Portal/EfCoreEnterpriseRepository.cs

@ -0,0 +1,40 @@
using LINGYUN.Platform.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace LINGYUN.Platform.Portal;
public class EfCoreEnterpriseRepository : EfCoreRepository<IPlatformDbContext, Enterprise, Guid>, IEnterpriseRepository
{
public EfCoreEnterpriseRepository(
IDbContextProvider<IPlatformDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public async virtual Task<Guid?> GetEnterpriseInTenantAsync(
Guid id,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Where(x => x.Id == id)
.Select(x => x.TenantId)
.FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
}
public async virtual Task<List<Enterprise>> GetEnterprisesInTenantListAsync(
int maxResultCount = 10,
CancellationToken cancellationToken = default)
{
return await (await GetDbSetAsync())
.Where(x => x.TenantId.HasValue)
.Take(maxResultCount)
.OrderByDescending(x => x.CreationTime)
.ToListAsync(GetCancellationToken(cancellationToken));
}
}

4
aspnet-core/services/LY.MicroService.AuthServer/AuthServerModule.cs

@ -11,12 +11,14 @@ using LINGYUN.Abp.Identity.OrganizaztionUnits;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.OpenIddict.LinkUser;
using LINGYUN.Abp.OpenIddict.Portal;
using LINGYUN.Abp.OpenIddict.Sms;
using LINGYUN.Abp.OpenIddict.WeChat;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Platform.EntityFrameworkCore;
using LY.MicroService.AuthServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -58,9 +60,11 @@ namespace LY.MicroService.AuthServer;
typeof(AbpOpenIddictSmsModule),
typeof(AbpOpenIddictWeChatModule),
typeof(AbpOpenIddictLinkUserModule),
typeof(AbpOpenIddictPortalModule),
typeof(AbpAuthenticationQQModule),
typeof(AbpAuthenticationWeChatModule),
typeof(AbpIdentityOrganizaztionUnitsModule),
typeof(PlatformEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),

2
aspnet-core/services/LY.MicroService.AuthServer/LY.MicroService.AuthServer.csproj

@ -59,8 +59,10 @@
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.LinkUser\LINGYUN.Abp.OpenIddict.LinkUser.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.Portal\LINGYUN.Abp.OpenIddict.Portal.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.Sms\LINGYUN.Abp.OpenIddict.Sms.csproj" />
<ProjectReference Include="..\..\modules\openIddict\LINGYUN.Abp.OpenIddict.WeChat\LINGYUN.Abp.OpenIddict.WeChat.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.EntityFrameworkCore\LINGYUN.Platform.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\tenants\LINGYUN.Abp.MultiTenancy\LINGYUN.Abp.MultiTenancy.csproj" />
</ItemGroup>

3
aspnet-core/services/LY.MicroService.AuthServer/appsettings.Development.json

@ -33,7 +33,8 @@
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-V70;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456"
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AppPlatform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456"
},
"CAP": {
"EventBus": {

4
aspnet-core/services/LY.MicroService.identityServer/IdentityServerModule.cs

@ -12,12 +12,14 @@ using LINGYUN.Abp.Identity.EntityFrameworkCore;
using LINGYUN.Abp.Identity.OrganizaztionUnits;
using LINGYUN.Abp.IdentityServer;
using LINGYUN.Abp.IdentityServer.EntityFrameworkCore;
using LINGYUN.Abp.IdentityServer.Portal;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Aliyun;
using LINGYUN.Platform.EntityFrameworkCore;
using LY.MicroService.IdentityServer.EntityFrameworkCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -57,9 +59,11 @@ namespace LY.MicroService.IdentityServer;
// typeof(AbpIdentityHttpApiModule),
typeof(AbpIdentityServerEntityFrameworkCoreModule),
typeof(AbpIdentityServerSmsValidatorModule),
typeof(AbpIdentityServerPortalModule),
typeof(AbpAuthenticationWeChatModule),
typeof(AbpAuthenticationQQModule),
typeof(AbpIdentityOrganizaztionUnitsModule),
typeof(PlatformEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),

2
aspnet-core/services/LY.MicroService.identityServer/LY.MicroService.IdentityServer.csproj

@ -54,6 +54,7 @@
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Http.Client.Wrapper\LINGYUN.Abp.Http.Client.Wrapper.csproj" />
<ProjectReference Include="..\..\modules\common\LINGYUN.Abp.Sms.Aliyun\LINGYUN.Abp.Sms.Aliyun.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.EntityFrameworkCore\LINGYUN.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.Portal\LINGYUN.Abp.IdentityServer.Portal.csproj" />
<ProjectReference Include="..\..\modules\identityServer\LINGYUN.Abp.IdentityServer.SmsValidator\LINGYUN.Abp.IdentityServer.SmsValidator.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.EntityFrameworkCore\LINGYUN.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\localization\LINGYUN.Abp.Localization.CultureMap\LINGYUN.Abp.Localization.CultureMap.csproj" />
@ -61,6 +62,7 @@
<ProjectReference Include="..\..\modules\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\modules\lt\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Platform.EntityFrameworkCore\LINGYUN.Platform.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\tenants\LINGYUN.Abp.MultiTenancy\LINGYUN.Abp.MultiTenancy.csproj" />
</ItemGroup>

18
aspnet-core/services/LY.MicroService.identityServer/appsettings.Development.json

@ -26,13 +26,15 @@
}
},
"ConnectionStrings": {
"Default": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456",
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform;User Id=root;Password=123456"
"Default": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456",
"AbpIdentity": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456",
"AbpIdentityServer": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456",
"AbpSaas": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpSettingManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpPermissionManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpFeatureManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AbpLocalizationManagement": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456",
"AppPlatform": "Server=127.0.0.1;Database=Platform-v70;User Id=root;Password=123456"
},
"CAP": {
"EventBus": {
@ -44,7 +46,7 @@
},
"MySql": {
"TableNamePrefix": "auth",
"ConnectionString": "Server=127.0.0.1;Database=IdentityServer;User Id=root;Password=123456"
"ConnectionString": "Server=127.0.0.1;Database=IdentityServer-v70;User Id=root;Password=123456"
},
"RabbitMQ": {
"HostName": "127.0.0.1",

Loading…
Cancel
Save