diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302075529_Added_Content_To_BlogPost.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302075529_Added_Content_To_BlogPost.Designer.cs new file mode 100644 index 0000000000..8f6bd9239d --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302075529_Added_Content_To_BlogPost.Designer.cs @@ -0,0 +1,2016 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.EntityFrameworkCore; + +namespace Volo.CmsKit.Migrations +{ + [DbContext(typeof(UnifiedDbContext))] + [Migration("20210302075529_Added_Content_To_BlogPost")] + partial class Added_Content_To_BlogPost + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.3") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)") + .HasColumnName("Exceptions"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("varbinary(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ContainerId"); + + b.HasIndex("TenantId", "ContainerId", "Name"); + + b.ToTable("AbpBlobs"); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpBlobContainers"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogs"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogFeature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeatureName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogFeatures"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorId") + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ShortDescription") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("Slug", "BlogId"); + + b.ToTable("CmsBlogPosts"); + }); + + modelBuilder.Entity("Volo.CmsKit.Comments.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RepliedCommentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "RepliedCommentId"); + + b.HasIndex("TenantId", "EntityType", "EntityId"); + + b.ToTable("CmsComments"); + }); + + modelBuilder.Entity("Volo.CmsKit.Contents.Content", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId"); + + b.ToTable("CmsContents"); + }); + + modelBuilder.Entity("Volo.CmsKit.MediaDescriptors.MediaDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Size") + .HasMaxLength(2147483647) + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("CmsMediaDescriptors"); + }); + + modelBuilder.Entity("Volo.CmsKit.Pages.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Slug"); + + b.ToTable("CmsPages"); + }); + + modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StarCount") + .HasColumnType("smallint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId", "CreatorId"); + + b.ToTable("CmsRatings"); + }); + + modelBuilder.Entity("Volo.CmsKit.Reactions.UserReaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReactionName") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId", "ReactionName"); + + b.HasIndex("TenantId", "CreatorId", "EntityType", "EntityId", "ReactionName"); + + b.ToTable("CmsUserReactions"); + }); + + modelBuilder.Entity("Volo.CmsKit.Tags.EntityTag", b => + { + b.Property("EntityId") + .HasColumnType("nvarchar(450)"); + + b.Property("TagId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("EntityId", "TagId"); + + b.HasIndex("TenantId", "EntityId", "TagId"); + + b.ToTable("CmsEntityTags"); + }); + + modelBuilder.Entity("Volo.CmsKit.Tags.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("CmsTags"); + }); + + modelBuilder.Entity("Volo.CmsKit.Users.CmsUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Email"); + + b.HasIndex("TenantId", "UserName"); + + b.ToTable("CmsUsers"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null) + .WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => + { + b.HasOne("Volo.CmsKit.Users.CmsUser", "Author") + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302075529_Added_Content_To_BlogPost.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302075529_Added_Content_To_BlogPost.cs new file mode 100644 index 0000000000..836507c222 --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302075529_Added_Content_To_BlogPost.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Volo.CmsKit.Migrations +{ + public partial class Added_Content_To_BlogPost : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Content", + table: "CmsBlogPosts", + type: "nvarchar(max)", + maxLength: 2147483647, + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Content", + table: "CmsBlogPosts"); + } + } +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302091451_Added_Content_To_Page.Designer.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302091451_Added_Content_To_Page.Designer.cs new file mode 100644 index 0000000000..6c89519250 --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302091451_Added_Content_To_Page.Designer.cs @@ -0,0 +1,2020 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Volo.CmsKit.EntityFrameworkCore; + +namespace Volo.CmsKit.Migrations +{ + [DbContext(typeof(UnifiedDbContext))] + [Migration("20210302091451_Added_Content_To_Page")] + partial class Added_Content_To_Page + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.3") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)") + .HasColumnName("ApplicationName"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("BrowserInfo"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientId"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ClientIpAddress"); + + b.Property("ClientName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("ClientName"); + + b.Property("Comments") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Comments"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)") + .HasColumnName("Exceptions"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("HttpMethod") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("HttpMethod"); + + b.Property("HttpStatusCode") + .HasColumnType("int") + .HasColumnName("HttpStatusCode"); + + b.Property("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorTenantId"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Url"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("UserId"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2") + .HasColumnName("ExecutionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("MethodName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("MethodName"); + + b.Property("Parameters") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)") + .HasColumnName("Parameters"); + + b.Property("ServiceName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ServiceName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnType("uniqueidentifier") + .HasColumnName("AuditLogId"); + + b.Property("ChangeTime") + .HasColumnType("datetime2") + .HasColumnName("ChangeTime"); + + b.Property("ChangeType") + .HasColumnType("tinyint") + .HasColumnName("ChangeType"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityId"); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("EntityTypeFullName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("NewValue"); + + b.Property("OriginalValue") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)") + .HasColumnName("OriginalValue"); + + b.Property("PropertyName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("PropertyName"); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("PropertyTypeFullName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContainerId") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("varbinary(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("ContainerId"); + + b.HasIndex("TenantId", "ContainerId", "Name"); + + b.ToTable("AbpBlobs"); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("AbpBlobContainers"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Regex") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("RegexDescription") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityLinkUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("SourceTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId") + .IsUnique() + .HasFilter("[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL"); + + b.ToTable("AbpLinkUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDefault") + .HasColumnType("bit") + .HasColumnName("IsDefault"); + + b.Property("IsPublic") + .HasColumnType("bit") + .HasColumnName("IsPublic"); + + b.Property("IsStatic") + .HasColumnType("bit") + .HasColumnName("IsStatic"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentitySecurityLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Action") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("ApplicationName") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("BrowserInfo") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("ClientId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ClientIpAddress") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Identity") + .HasMaxLength(96) + .HasColumnType("nvarchar(96)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Action"); + + b.HasIndex("TenantId", "ApplicationName"); + + b.HasIndex("TenantId", "Identity"); + + b.HasIndex("TenantId", "UserId"); + + b.ToTable("AbpSecurityLogs"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsExternal") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsExternal"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("LockoutEnabled"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("NormalizedEmail") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedEmail"); + + b.Property("NormalizedUserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("NormalizedUserName"); + + b.Property("PasswordHash") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("PasswordHash"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("SecurityStamp"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("TwoFactorEnabled"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ClaimValue") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderDisplayName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(196) + .HasColumnType("nvarchar(196)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(95) + .HasColumnType("nvarchar(95)") + .HasColumnName("Code"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)") + .HasColumnName("DisplayName"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ProviderKey") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProviderName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.Blog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogs"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogFeature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FeatureName") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.HasKey("Id"); + + b.ToTable("CmsBlogFeatures"); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuthorId") + .HasColumnType("uniqueidentifier"); + + b.Property("BlogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("ShortDescription") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("Slug", "BlogId"); + + b.ToTable("CmsBlogPosts"); + }); + + modelBuilder.Entity("Volo.CmsKit.Comments.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RepliedCommentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "RepliedCommentId"); + + b.HasIndex("TenantId", "EntityType", "EntityId"); + + b.ToTable("CmsComments"); + }); + + modelBuilder.Entity("Volo.CmsKit.Contents.Content", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId"); + + b.ToTable("CmsContents"); + }); + + modelBuilder.Entity("Volo.CmsKit.MediaDescriptors.MediaDescriptor", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Size") + .HasMaxLength(2147483647) + .HasColumnType("bigint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("CmsMediaDescriptors"); + }); + + modelBuilder.Entity("Volo.CmsKit.Pages.Page", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Slug") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Slug"); + + b.ToTable("CmsPages"); + }); + + modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StarCount") + .HasColumnType("smallint"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId", "CreatorId"); + + b.ToTable("CmsRatings"); + }); + + modelBuilder.Entity("Volo.CmsKit.Reactions.UserReaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("EntityId") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReactionName") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "EntityType", "EntityId", "ReactionName"); + + b.HasIndex("TenantId", "CreatorId", "EntityType", "EntityId", "ReactionName"); + + b.ToTable("CmsUserReactions"); + }); + + modelBuilder.Entity("Volo.CmsKit.Tags.EntityTag", b => + { + b.Property("EntityId") + .HasColumnType("nvarchar(450)"); + + b.Property("TagId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("EntityId", "TagId"); + + b.HasIndex("TenantId", "EntityId", "TagId"); + + b.ToTable("CmsEntityTags"); + }); + + modelBuilder.Entity("Volo.CmsKit.Tags.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EntityType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Name"); + + b.ToTable("CmsTags"); + }); + + modelBuilder.Entity("Volo.CmsKit.Users.CmsUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("Email"); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("EmailConfirmed"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Name"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("nvarchar(16)") + .HasColumnName("PhoneNumber"); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("PhoneNumberConfirmed"); + + b.Property("Surname") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("Surname"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("UserName"); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "Email"); + + b.HasIndex("TenantId", "UserName"); + + b.ToTable("CmsUsers"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b => + { + b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null) + .WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.CmsKit.Blogs.BlogPost", b => + { + b.HasOne("Volo.CmsKit.Users.CmsUser", "Author") + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Navigation("Actions"); + + b.Navigation("EntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Navigation("PropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Navigation("Claims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Navigation("Claims"); + + b.Navigation("Logins"); + + b.Navigation("OrganizationUnits"); + + b.Navigation("Roles"); + + b.Navigation("Tokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Navigation("Roles"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Navigation("ConnectionStrings"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302091451_Added_Content_To_Page.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302091451_Added_Content_To_Page.cs new file mode 100644 index 0000000000..b7ae92ccc7 --- /dev/null +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/20210302091451_Added_Content_To_Page.cs @@ -0,0 +1,24 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Volo.CmsKit.Migrations +{ + public partial class Added_Content_To_Page : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Content", + table: "CmsPages", + type: "nvarchar(max)", + maxLength: 2147483647, + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Content", + table: "CmsPages"); + } + } +} diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index cd61c93ff2..c14e469499 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -1269,6 +1269,10 @@ namespace Volo.CmsKit.Migrations .HasColumnType("nvarchar(40)") .HasColumnName("ConcurrencyStamp"); + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -1533,6 +1537,10 @@ namespace Volo.CmsKit.Migrations .HasColumnType("nvarchar(40)") .HasColumnName("ConcurrencyStamp"); + b.Property("Content") + .HasMaxLength(2147483647) + .HasColumnType("nvarchar(max)"); + b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); diff --git a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml index 885034b055..31267b61aa 100644 --- a/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml +++ b/modules/cms-kit/host/Volo.CmsKit.Web.Unified/Pages/Index.cshtml @@ -8,7 +8,6 @@ @using Volo.CmsKit.GlobalFeatures @using Volo.CmsKit.Pages @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Commenting -@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Contents @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.ReactionSelection @using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Tags @@ -31,11 +30,6 @@ - @if (GlobalFeatureManager.Instance.IsEnabled()) - { - @await Component.InvokeAsync(typeof(ContentViewComponent), new {entityType = "quote", entityId = "1"}) - } - @if (GlobalFeatureManager.Instance.IsEnabled()) { @await Component.InvokeAsync(typeof(TagViewComponent), new diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs index d12a2f2982..5222b50fe8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/BlogPostDto.cs @@ -11,6 +11,9 @@ namespace Volo.CmsKit.Admin.Blogs public string Title { get; set; } public string Slug { get; set; } - public string ShortDescription { get; protected set; } + + public string ShortDescription { get; set; } + + public string Content { get; set; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs index 7780a21669..3e339c738c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/CreateBlogPostDto.cs @@ -21,5 +21,8 @@ namespace Volo.CmsKit.Admin.Blogs [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxShortDescriptionLength))] public string ShortDescription { get; set; } + + [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxContentLength))] + public string Content { get; set; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs index eeb4548c8e..7aaf775427 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Blogs/UpdateBlogPostDto.cs @@ -18,6 +18,8 @@ namespace Volo.CmsKit.Admin.Blogs [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxShortDescriptionLength))] public string ShortDescription { get; set; } - + + [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxContentLength))] + public string Content { get; set; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentCreateDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentCreateDto.cs deleted file mode 100644 index 6832d26bd3..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentCreateDto.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Validation; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Admin.Contents -{ - [Serializable] - public class ContentCreateDto - { - [Required] - [DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxEntityTypeLength))] - public string EntityType { get; set; } - - [Required] - [DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxEntityIdLength))] - public string EntityId { get; set; } - - [Required] - [DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxValueLength))] - public string Value { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentDto.cs deleted file mode 100644 index 8cfb2e2e7c..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.CmsKit.Admin.Contents -{ - [Serializable] - public class ContentDto : EntityDto - { - public string EntityType { get; set; } - - public string EntityId { get; set; } - - public string Value { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListDto.cs deleted file mode 100644 index ba44253ae9..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.CmsKit.Admin.Contents -{ - [Serializable] - public class ContentGetListDto : EntityDto - { - public string EntityType { get; set; } - - public string EntityId { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListInput.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListInput.cs deleted file mode 100644 index fbca53a7b9..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentGetListInput.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.CmsKit.Admin.Contents -{ - [Serializable] - public class ContentGetListInput : PagedAndSortedResultRequestDto - { - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentUpdateDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentUpdateDto.cs deleted file mode 100644 index c59075cc8d..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/ContentUpdateDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Validation; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Admin.Contents -{ - [Serializable] - public class ContentUpdateDto - { - [Required] - [DynamicMaxLength(typeof(ContentConsts), nameof(ContentConsts.MaxValueLength))] - public string Value { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs deleted file mode 100644 index 52bd07aa86..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Contents/IContentAdminAppService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; -using Volo.CmsKit.Admin.Contents; - -namespace Volo.CmsKit.Admin.Contents -{ - public interface IContentAdminAppService - : ICrudAppService< - ContentDto, - ContentGetListDto, - Guid, - ContentGetListInput, - ContentCreateDto, - ContentUpdateDto> - { - Task GetAsync(string entityType, string entityId); - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs index 465408a8bf..174278d829 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/CreatePageInputDto.cs @@ -16,5 +16,8 @@ namespace Volo.CmsKit.Admin.Pages [Required] [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] public string Slug { get; set; } + + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxContentLength))] + public string Content { get; set; } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs index e8117ed7b1..5297e9b7d0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/PageDto.cs @@ -9,5 +9,7 @@ namespace Volo.CmsKit.Admin.Pages public string Title { get; set; } public string Slug { get; set; } + + public string Content { get; set; } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs index f33c40be6a..eff3cb2919 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application.Contracts/Volo/CmsKit/Admin/Pages/UpdatePageInputDto.cs @@ -16,5 +16,8 @@ namespace Volo.CmsKit.Admin.Pages [Required] [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] public string Slug { get; set; } + + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxContentLength))] + public string Content { get; set; } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs index 4fbbf88675..a25aa07a09 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Blogs/BlogPostAdminAppService.cs @@ -54,7 +54,7 @@ namespace Volo.CmsKit.Admin.Blogs input.Title, input.Slug, input.ShortDescription, - CurrentTenant.Id); + input.Content); await BlogPostRepository.InsertAsync(blogPost); @@ -68,7 +68,8 @@ namespace Volo.CmsKit.Admin.Blogs blogPost.SetTitle(input.Title); blogPost.SetShortDescription(input.ShortDescription); - + blogPost.SetContent(input.Content); + if (blogPost.Slug != input.Slug) { await BlogPostManager.SetSlugUrlAsync(blogPost, input.Slug); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs index b78910ce01..a2615292f0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationAutoMapperProfile.cs @@ -2,13 +2,11 @@ using Volo.Abp.AutoMapper; using Volo.CmsKit.Admin.Blogs; using Volo.CmsKit.Admin.Comments; -using Volo.CmsKit.Admin.Contents; using Volo.CmsKit.Admin.MediaDescriptors; using Volo.CmsKit.Admin.Pages; using Volo.CmsKit.Blogs; using Volo.CmsKit.Admin.Tags; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.Pages; using Volo.CmsKit.Tags; @@ -28,11 +26,6 @@ namespace Volo.CmsKit.Admin CreateMap(); - CreateMap(MemberList.Destination); - CreateMap(MemberList.Destination); - CreateMap(MemberList.Source); - CreateMap(MemberList.Source); - CreateMap(MemberList.Destination); CreateMap(MemberList.Source); CreateMap(MemberList.Source); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs index 17c242755e..575e8950a6 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/CmsKitAdminApplicationModule.cs @@ -21,15 +21,12 @@ namespace Volo.CmsKit.Admin )] public class CmsKitAdminApplicationModule : AbpModule { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - ConfigureTagOptions(); - } - public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAutoMapperObjectMapper(); + ConfigureTagOptions(); + Configure(options => { options.AddMaps(validate: true); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs deleted file mode 100644 index 1aa0bffcfa..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Contents/ContentAdminAppService.cs +++ /dev/null @@ -1,71 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.AspNetCore.Authorization; -using System; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Repositories; -using Volo.CmsKit.Contents; -using Volo.CmsKit.Permissions; - -namespace Volo.CmsKit.Admin.Contents -{ - [Authorize(CmsKitAdminPermissions.Contents.Default)] - public class ContentAdminAppService : - CrudAppService< - Content, - ContentDto, - ContentGetListDto, - Guid, - ContentGetListInput, - ContentCreateDto, - ContentUpdateDto - >, IContentAdminAppService - { - protected IContentManager ContentManager { get; } - - protected IContentRepository ContentRepository { get; } - - public ContentAdminAppService( - IRepository repository, - IContentManager contentManager, - IContentRepository contentRepository) : base(repository) - { - ContentManager = contentManager; - ContentRepository = contentRepository; - - GetListPolicyName = CmsKitAdminPermissions.Contents.Default; - GetPolicyName = CmsKitAdminPermissions.Contents.Default; - CreatePolicyName = CmsKitAdminPermissions.Contents.Create; - UpdatePolicyName = CmsKitAdminPermissions.Contents.Update; - DeletePolicyName = CmsKitAdminPermissions.Contents.Delete; - } - - [Authorize(CmsKitAdminPermissions.Contents.Create)] - public override async Task CreateAsync(ContentCreateDto input) - { - var entity = new Content( - GuidGenerator.Create(), - input.EntityType, - input.EntityId, - input.Value, - CurrentTenant?.Id); - - await ContentManager.InsertAsync(entity); - - return await MapToGetOutputDtoAsync(entity); - } - - public virtual async Task GetAsync( - [NotNull] string entityType, - [NotNull] string entityId) - { - Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); - Check.NotNullOrWhiteSpace(entityId, nameof(entityId)); - - var content = await ContentRepository.GetAsync(entityType, entityId, CurrentTenant?.Id); - - return ObjectMapper.Map(content); - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs index 9016a620c8..102b2a6afd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Application/Volo/CmsKit/Admin/Pages/PageAdminAppService.cs @@ -50,7 +50,7 @@ namespace Volo.CmsKit.Admin.Pages { await CheckPageSlugAsync(input.Slug); - var page = new Page(GuidGenerator.Create(), input.Title, input.Slug, CurrentTenant.Id); + var page = new Page(GuidGenerator.Create(), input.Title, input.Slug, input.Content, CurrentTenant.Id); await PageRepository.InsertAsync(page); @@ -69,6 +69,7 @@ namespace Volo.CmsKit.Admin.Pages page.SetTitle(input.Title); page.SetSlug(input.Slug); + page.SetContent(input.Content); await PageRepository.UpdateAsync(page); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs deleted file mode 100644 index 4e3a56a8e2..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.HttpApi/Volo/CmsKit/Admin/Contents/ContentAdminController.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.Admin.Contents; -using Volo.CmsKit.GlobalFeatures; -using Volo.CmsKit.Permissions; - -namespace Volo.CmsKit.Admin.Contents -{ - [Authorize(CmsKitAdminPermissions.Contents.Default)] - [RequiresGlobalFeature(typeof(ContentsFeature))] - [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] - [Area("cms-kit")] - [Route("api/cms-kit-admin/contents")] - public class ContentAdminController : CmsKitAdminController, IContentAdminAppService - { - protected IContentAdminAppService ContentAdminAppService { get; } - - public ContentAdminController(IContentAdminAppService contentAdminAppService) - { - ContentAdminAppService = contentAdminAppService; - } - - [HttpPost] - [Authorize(CmsKitAdminPermissions.Contents.Create)] - public Task CreateAsync(ContentCreateDto input) - { - return ContentAdminAppService.CreateAsync(input); - } - - [HttpDelete("{id}")] - [Authorize(CmsKitAdminPermissions.Contents.Delete)] - public Task DeleteAsync(Guid id) - { - return ContentAdminAppService.DeleteAsync(id); - } - - [HttpGet("{id}")] - [Authorize(CmsKitAdminPermissions.Contents.Default)] - public Task GetAsync(Guid id) - { - return ContentAdminAppService.GetAsync(id); - } - - [HttpGet] - [Authorize(CmsKitAdminPermissions.Contents.Default)] - public Task> GetListAsync(ContentGetListInput input) - { - return ContentAdminAppService.GetListAsync(input); - } - - [HttpPut] - [Authorize(CmsKitAdminPermissions.Contents.Update)] - public Task UpdateAsync(Guid id, ContentUpdateDto input) - { - return ContentAdminAppService.UpdateAsync(id, input); - } - - [HttpGet] - [Route("{entityType}/{entityId}")] - [Authorize(CmsKitAdminPermissions.Contents.Default)] - public Task GetAsync(string entityType, string entityId) - { - return ContentAdminAppService.GetAsync(entityType, entityId); - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs index 4834670b3c..25dd69cd63 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/CmsKitAdminWebModule.cs @@ -76,11 +76,11 @@ namespace Volo.CmsKit.Admin.Web options.Conventions.AddPageRoute("/CmsKit/Tags/Index", "/Cms/Tags"); options.Conventions.AddPageRoute("/CmsKit/Pages/Index", "/Cms/Pages"); options.Conventions.AddPageRoute("/CmsKit/Pages/Create", "/Cms/Pages/Create"); - options.Conventions.AddPageRoute("/CmsKit/Pages/Update", "/Cms/Pages/Update"); + options.Conventions.AddPageRoute("/CmsKit/Pages/Update", "/Cms/Pages/Update/{Id}"); options.Conventions.AddPageRoute("/CmsKit/Blogs/Index", "/Cms/Blogs"); options.Conventions.AddPageRoute("/CmsKit/BlogPosts/Index", "/Cms/BlogPosts"); options.Conventions.AddPageRoute("/CmsKit/BlogPosts/Create", "/Cms/BlogPosts/Create"); - options.Conventions.AddPageRoute("/CmsKit/BlogPosts/Update", "/Cms/BlogPosts/Update"); + options.Conventions.AddPageRoute("/CmsKit/BlogPosts/Update", "/Cms/BlogPosts/Update/{Id}"); options.Conventions.AddPageRoute("/CmsKit/Comments/Index", "/Cms/Comments"); options.Conventions.AddPageRoute("/CmsKit/Comments/Details", "/Cms/Details"); }); diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml index ae5c3ce9bd..4659ca4198 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml @@ -1,6 +1,7 @@ @page -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor +@using System.Globalization +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar @using Volo.CmsKit.Admin.Web.Pages @using Volo.CmsKit.Admin.Web.Menus @@ -22,12 +23,19 @@ @section scripts { - - - + + + + } +@section styles { + + + +} + @section content_toolbar { @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(CreateModel).FullName }) } @@ -50,15 +58,14 @@ - - @await Component.InvokeAsync(typeof(EntityContentEditorViewComponent), new - { - entityType = BlogPostConsts.EntityType, - displaySubmitButton = false - }) - + +
+
diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs index 2d01e55668..2d3c7d36ab 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Create.cshtml.cs @@ -58,6 +58,10 @@ namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.BlogPosts [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxShortDescriptionLength))] public string ShortDescription { get; set; } + + [HiddenInput] + [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxContentLength))] + public string Content { get; set; } } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml index b4692365ef..7c56152b8e 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml @@ -1,9 +1,10 @@ @page "{Id}" +@using System.Globalization +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor @using Volo.CmsKit.Blogs @using Volo.CmsKit.Admin.Web.Pages @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor @using Volo.CmsKit.Admin.Web.Menus @using Volo.CmsKit.Admin.Web.Pages.CmsKit.BlogPosts @using Volo.CmsKit.Admin.Web.Pages.CmsKit.Tags.Components.TagEditor @@ -22,12 +23,19 @@ @section scripts { - - - + + + + } +@section styles { + + + +} + @section content_toolbar { @await Component.InvokeAsync(typeof(AbpPageToolbarViewComponent), new { pageName = typeof(UpdateModel).FullName }) } @@ -49,14 +57,14 @@ - @await Component.InvokeAsync(typeof(EntityContentEditorViewComponent), new - { - entityType = BlogPostConsts.EntityType, - entityId = Model.Id.ToString(), - displaySubmitButton = false - }) - + +
+
+ @if (Model.TagsFeature?.IsEnabled == true) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml.cs index 29c839a947..5fef40f8a1 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Update.cshtml.cs @@ -72,6 +72,10 @@ namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.BlogPosts [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxShortDescriptionLength))] [DisplayOrder(10001)] public string ShortDescription { get; set; } + + [HiddenInput] + [DynamicMaxLength(typeof(BlogPostConsts), nameof(BlogPostConsts.MaxContentLength))] + public string Content { get; set; } } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js index b2fd0613e6..e1e132e2a0 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js @@ -41,7 +41,12 @@ $formCreate.ajaxSubmit({ success: function (result) { - submitEntityContent(result.id); + if (isTagsEnabled) { + submitEntityTags(result.id); + } + else { + submitCoverImage(result.id); + } }, error: function (result) { abp.notify.error(result.responseJSON.error.message); @@ -55,29 +60,16 @@ e.preventDefault(); $formCreate.submit(); }); - - function submitEntityContent(blogPostId) { - volo.cmsKit.admin.contents.contentAdmin - .create( - { - entityType: 'BlogPost', - entityId: blogPostId, - value: $pageContentInput.val() - }) - .then(function (result) { - if (isTagsEnabled) { - submitEntityTags(blogPostId) - } - else { - submitCoverImage(blogPostId); - } - }); - } - + function submitEntityTags(blogPostId) { - var tags = $tagsInput.val().split(","); - + var tags = $tagsInput.val().split(',').map(x => x.trim()).filter(x => x); + + if(tags.length === 0){ + submitCoverImage(blogPostId); + return; + } + volo.cmsKit.admin.tags.entityTagAdmin .setEntityTags({ entityType: 'BlogPost', @@ -209,4 +201,77 @@ } }); }); + + // ----------------------------------- + var fileUploadUri = "/api/cms-kit-admin/media/blogpost"; + var fileUriPrefix = "/api/cms-kit/media/"; + + var editorDataKey = "tuiEditor"; + + initAllEditors(); + + function initAllEditors() { + $('.content-editor').each(function (i, item) { + initEditor(item); + }); + } + + function initEditor(element) { + var $editorContainer = $(element); + var inputName = $editorContainer.data('input-id'); + var $editorInput = $('#' + inputName); + var initialValue = $editorInput.val(); + + var editor = $editorContainer.tuiEditor({ + usageStatistics: false, + useCommandShortcut: true, + initialValue: initialValue, + previewStyle: 'tab', + height: "25em", + minHeight: "25em", + initialEditType: initialValue ? 'wysiwyg' : 'markdown', + language: $editorContainer.data("language"), + hooks: { + addImageBlobHook: uploadFile, + }, + events: { + change: function (_val) { + $editorInput.val(editor.getHtml()); + $editorInput.trigger("change"); + } + } + }).data(editorDataKey); + } + + function uploadFile(blob, callback, source) { + var UPPY_OPTIONS = { + endpoint: fileUploadUri, + formData: true, + fieldName: "file", + method: "post", + headers: getUppyHeaders() + }; + + var UPPY = Uppy.Core().use(Uppy.XHRUpload, UPPY_OPTIONS); + + UPPY.reset(); + + UPPY.addFile({ + id: "content-file", + name: blob.name, + type: blob.type, + data: blob, + }); + + UPPY.upload().then((result) => { + if (result.failed.length > 0) { + abp.message.error("File upload failed"); + } else { + var mediaDto = result.successful[0].response.body; + var fileUrl = (fileUriPrefix + mediaDto.id); + + callback(fileUrl, mediaDto.name); + } + }); + } }); \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js index 7302299419..e2f19079b7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/index.js @@ -27,7 +27,7 @@ $(function () { text: l('Edit'), visible: abp.auth.isGranted('CmsKit.Blogs.Update'), action: function (data) { - location.href = "/CmsKit/BlogPosts/Update/" + data.record.id + location.href = "BlogPosts/Update/" + data.record.id } }, { @@ -63,6 +63,6 @@ $(function () { $('#AbpContentToolbar button[name=CreateBlogPost]').on('click', function (e) { e.preventDefault(); - window.location.href = "/CmsKit/BlogPosts/Create" + window.location.href = "BlogPosts/Create" }); }); \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js index 9a2fb3c69a..ee6da62f6a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js @@ -8,15 +8,15 @@ var $titleClone = $('#title-clone'); var $slug = $('#ViewModel_Slug'); var $buttonSubmit = $('#button-blog-post-update'); - var $contentValueInput = $('#ViewModel_Value'); var $blogPostIdInput = $('#Id'); - var $contentIdInput = $('#ViewModel_Id'); var $tagsInput = $('.tag-editor-form input[name=tags]'); var $fileInput = $('#BlogPostCoverImage'); var UPPY_UPLOAD_ENDPOINT = "/api/cms-kit-admin/blogs/blog-posts/{0}/cover-image"; var UPPY_FILE_ID = "uppy-upload-file"; + var isTagsEnabled = true; + $formUpdate.data('validator').settings.ignore = ":hidden, [contenteditable='true']:not([name]), .tui-popup-wrapper"; function initSelectBlog() { @@ -40,7 +40,12 @@ $formUpdate.ajaxSubmit({ success: function (result) { - submitEntityContent(); + if (isTagsEnabled) { + submitEntityTags($blogPostIdInput.val()); + } + else { + submitCoverImage($blogPostIdInput.val()); + } }, error: function (result) { abp.ui.clearBusy(); abp.notify.error(result.responseJSON.error.message); @@ -53,49 +58,16 @@ e.preventDefault(); $formUpdate.submit(); }); + + function submitEntityTags(blogPostId) { - function submitEntityContent() { - - var contentId = $contentIdInput.val(); - var blogPostId = $blogPostIdInput.val(); - var contentValue = $contentValueInput.val(); - - if (contentId) { - volo.cmsKit.admin.contents.contentAdmin - .update(contentId, - { - value: contentValue - }) - .then(function (result) { - entityContentCallback(blogPostId); - }); - } - else { - volo.cmsKit.admin.contents.contentAdmin - .create({ - entityType: 'BlogPost', - entityId: blogPostId, - value: contentValue - }) - .then(function (result) { - entityContentCallback(blogPostId); - }); - } - } + var tags = $tagsInput.val().split(',').map(x => x.trim()).filter(x => x); - function entityContentCallback(blogPostId) { - if ($tagsInput.val()) { - submitEntityTags(blogPostId); - } - else { + if(tags.length === 0){ submitCoverImage(blogPostId); + return; } - } - - function submitEntityTags(blogPostId) { - - var tags = $tagsInput.val().split(","); - + volo.cmsKit.admin.tags.entityTagAdmin .setEntityTags({ entityType: 'BlogPost', @@ -154,7 +126,7 @@ function finishSaving(result) { abp.notify.success(l('SuccessfullySaved')); abp.ui.clearBusy(); - location.href = "../BlogPosts/"; + location.href = "../../BlogPosts"; } $titleClone.on('change paste keyup', function () { @@ -177,4 +149,78 @@ }); } } + + + // ----------------------------------- + var fileUploadUri = "/api/cms-kit-admin/media/blogpost"; + var fileUriPrefix = "/api/cms-kit/media/"; + + var editorDataKey = "tuiEditor"; + + initAllEditors(); + + function initAllEditors() { + $('.content-editor').each(function (i, item) { + initEditor(item); + }); + } + + function initEditor(element) { + var $editorContainer = $(element); + var inputName = $editorContainer.data('input-id'); + var $editorInput = $('#' + inputName); + var initialValue = $editorInput.val(); + + var editor = $editorContainer.tuiEditor({ + usageStatistics: false, + useCommandShortcut: true, + initialValue: initialValue, + previewStyle: 'tab', + height: "25em", + minHeight: "25em", + initialEditType: initialValue ? 'wysiwyg' : 'markdown', + language: $editorContainer.data("language"), + hooks: { + addImageBlobHook: uploadFile, + }, + events: { + change: function (_val) { + $editorInput.val(editor.getHtml()); + $editorInput.trigger("change"); + } + } + }).data(editorDataKey); + } + + function uploadFile(blob, callback, source) { + var UPPY_OPTIONS = { + endpoint: fileUploadUri, + formData: true, + fieldName: "file", + method: "post", + headers: getUppyHeaders() + }; + + var UPPY = Uppy.Core().use(Uppy.XHRUpload, UPPY_OPTIONS); + + UPPY.reset(); + + UPPY.addFile({ + id: "content-file", + name: blob.name, + type: blob.type, + data: blob, + }); + + UPPY.upload().then((result) => { + if (result.failed.length > 0) { + abp.message.error("File upload failed"); + } else { + var mediaDto = result.successful[0].response.body; + var fileUrl = (fileUriPrefix + mediaDto.id); + + callback(fileUrl, mediaDto.name); + } + }); + } }); \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/ContentEditorViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/ContentEditorViewComponent.cs deleted file mode 100644 index bba95a0e45..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/ContentEditorViewComponent.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using System.Threading.Tasks; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor; -using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy; -using Volo.Abp.AspNetCore.Mvc.UI.Widgets; - -namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.ContentEditor -{ - [Widget( - StyleTypes = new[] - { - typeof(TuiEditorStyleContributor) - }, - ScriptTypes = new[] - { - typeof(TuiEditorScriptContributor), - typeof(UppyScriptContributor) - }, - ScriptFiles = new[] - { - "/Pages/CmsKit/Contents/Components/ContentEditor/default.js" - })] - public class ContentEditorViewComponent : AbpViewComponent - { - public async Task InvokeAsync(string inputId) - { - return View( - "~/Pages/CmsKit/Contents/Components/ContentEditor/Default.cshtml", - new ContentEditorViewModel(inputId)); - } - - public class ContentEditorViewModel - { - public ContentEditorViewModel(string inputId) - { - InputId = inputId; - } - - public string InputId { get; set; } - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/Default.cshtml deleted file mode 100644 index cde532b02c..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/Default.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@using System.Globalization -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.ContentEditor - -@model ContentEditorViewComponent.ContentEditorViewModel - -
-
diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/default.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/default.js deleted file mode 100644 index a6ccbbde65..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/ContentEditor/default.js +++ /dev/null @@ -1,80 +0,0 @@ -$(function () { - var fileUploadUri = "/api/cms-kit-admin/media"; - var fileUriPrefix = "/api/cms-kit/media/"; - - var editorDataKey = "tuiEditor"; - - initAllEditors(); - - function initAllEditors() { - $('.content-editor').each(function (i, item) { - initEditor(item); - }); - } - - function initEditor(element) { - var $editorContainer = $(element); - var inputName = $editorContainer.data('input-id'); - var $editorInput = $('#' + inputName); - var initialValue = $editorInput.val(); - - var editor = $editorContainer.tuiEditor({ - usageStatistics: false, - useCommandShortcut: true, - initialValue: initialValue, - previewStyle: 'tab', - height: "25em", - minHeight: "25em", - initialEditType: initialValue ? 'wysiwyg' : 'markdown', - language: $editorContainer.data("language"), - hooks: { - addImageBlobHook: uploadFile, - }, - events: { - change: function (_val) { - $editorInput.val(editor.getHtml()); - $editorInput.trigger("change"); - } - } - }).data(editorDataKey); - } - - function getUppyHeaders() { - var headers = {}; - headers[abp.security.antiForgery.tokenHeaderName] = abp.security.antiForgery.getToken(); - - return headers; - } - - function uploadFile(blob, callback, source) { - var UPPY_OPTIONS = { - endpoint: fileUploadUri, - formData: true, - fieldName: "file", - method: "post", - headers: getUppyHeaders() - }; - - var UPPY = Uppy.Core().use(Uppy.XHRUpload, UPPY_OPTIONS); - - UPPY.reset(); - - UPPY.addFile({ - id: "content-file", - name: blob.name, - type: blob.type, - data: blob, - }); - - UPPY.upload().then((result) => { - if (result.failed.length > 0) { - abp.message.error("File upload failed"); - } else { - var mediaDto = result.successful[0].response.body; - var fileUrl = (fileUriPrefix + mediaDto.id); - - callback(fileUrl, mediaDto.name); - } - }); - } -}); \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/ContentViewModel.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/ContentViewModel.cs deleted file mode 100644 index 891fe50bd1..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/ContentViewModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; - -namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor -{ - public class ContentViewModel - { - public ContentViewModel(string entityType, string entityId, string value = null, Guid? id = null) - { - EntityType = entityType; - EntityId = entityId; - Value = value; - Id = id; - } - - [HiddenInput] - public string EntityType { get; set; } - - [HiddenInput] - public string EntityId { get; set; } - - [HiddenInput] - public string Value { get; set; } - - [HiddenInput] - public Guid? Id { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/Default.cshtml deleted file mode 100644 index ba8132ccc1..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/Default.cshtml +++ /dev/null @@ -1,27 +0,0 @@ -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.ContentEditor -@using Volo.CmsKit.Localization -@using Microsoft.Extensions.Localization - -@model EntityContentEditorViewComponent.EntityContentEditorViewModel - -@inject IStringLocalizer L - -@if (Model.DisplaySubmitButton) -{ - - - - - - -} -else -{ - - - - -} - -@await Component.InvokeAsync(typeof(ContentEditorViewComponent), new { inputId = Html.IdFor(m => m.ViewModel.Value) }) diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/EntityContentEditorViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/EntityContentEditorViewComponent.cs deleted file mode 100644 index 44db557f16..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/EntityContentEditorViewComponent.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; -using Volo.Abp.AspNetCore.Mvc.UI.Widgets; -using Volo.Abp.Domain.Entities; -using Volo.CmsKit.Admin.Contents; - -namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor -{ - [Widget( - ScriptFiles = new[] - { - "/Pages/CmsKit/Contents/Components/EntityContentEditor/default.js" - })] - public class EntityContentEditorViewComponent : AbpViewComponent - { - private readonly IContentAdminAppService contentAdminAppService; - - public EntityContentEditorViewComponent(IContentAdminAppService contentAdminAppService) - { - this.contentAdminAppService = contentAdminAppService; - } - - public async Task InvokeAsync(string entityType, string entityId, bool displaySubmitButton = true) - { - var viewModel = new ContentViewModel(entityType, entityId); - - try - { - if (entityId != null) - { - var content = await contentAdminAppService.GetAsync(entityType, entityId); - viewModel.Value = content.Value; - viewModel.Id = content.Id; - } - } - catch (EntityNotFoundException) - { - // Initialize editor even content doesn't exist. - } - - return View( - "~/Pages/CmsKit/Contents/Components/EntityContentEditor/Default.cshtml", - new EntityContentEditorViewModel(viewModel, displaySubmitButton)); - } - - public class EntityContentEditorViewModel - { - public ContentViewModel ViewModel { get; set; } - - public bool DisplaySubmitButton { get; set; } - - public EntityContentEditorViewModel(ContentViewModel viewModel, bool displaySubmitButton) - { - ViewModel = viewModel; - DisplaySubmitButton = displaySubmitButton; - } - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/default.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/default.js deleted file mode 100644 index 34f84f8419..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Contents/Components/EntityContentEditor/default.js +++ /dev/null @@ -1,34 +0,0 @@ -$(function () { - - $entityContentEditors = $('.form-entity-content-editor'); - - var contentAdminService = volo.cmsKit.admin.contents.contentAdmin; - - $entityContentEditors.on('submit', function (e, obj) { - e.preventDefault(); - - var $form = $(e.currentTarget); - - if ($form.valid()) { - - var data = form.serializeFormToObject().viewModel; - - abp.ui.setBusy(e); - if (data.id) { - contentAdminService - .update(data.id, data) - .then(function (result) { - abp.ui.clearBusy(); - }); - - } - else { - contentAdminService - .create(data) - .then(function (result) { - abp.ui.clearBusy(); - }); - } - } - }) -}) \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml index fe9f8d4b69..b4896a7449 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml @@ -1,14 +1,15 @@ @page -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor +@using System.Globalization +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy @using Volo.CmsKit.Admin.Web.Pages @using Volo.CmsKit.Admin.Web.Menus -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages @using Volo.CmsKit.Admin.Web.Bundles @inherits CmsKitAdminPageBase -@model CreateModel +@model Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages.CreateModel @{ PageLayout.Content.Title = L["Pages"].Value; @@ -17,27 +18,36 @@ } @section scripts { - - - - + + + + + + +} + +@section styles { + + + } - - - +
+ + - - - @await Component.InvokeAsync(typeof(EntityContentEditorViewComponent), new - { - entityType = "Page", - displaySubmitButton = false - }) - + + + +
+
+
diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml.cs index a4d90abafb..430c516ce3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Create.cshtml.cs @@ -2,10 +2,8 @@ using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; using Volo.Abp.Validation; using Volo.CmsKit.Admin.Pages; -using Volo.CmsKit.Admin.Web.Pages; using Volo.CmsKit.Pages; namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages @@ -34,14 +32,17 @@ namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages [AutoMap(typeof(CreatePageInputDto), ReverseMap = true)] public class CreatePageViewModel { - [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxTitleLength))] [Required] + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxTitleLength))] public string Title { get; set; } - [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] [Required] - [DynamicFormIgnore] + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] public string Slug { get; set; } + + [HiddenInput] + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] + public string Content { get; set; } } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Index.cshtml index 59fa975e24..c85d4759ba 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Index.cshtml @@ -1,6 +1,4 @@ @page - -@using Volo.Abp.AspNetCore.Mvc.UI.Layout @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageToolbar @using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Pages.Shared.Components.AbpPageSearchBox @using Volo.CmsKit.Admin.Web.Pages diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml index 90f043e89e..1b35e6c913 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml @@ -1,13 +1,15 @@ @page "{Id}" -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Contents.Components.EntityContentEditor +@using System.Globalization +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.TuiEditor +@using Volo.Abp.AspNetCore.Mvc.UI.Packages.Uppy +@using Volo.CmsKit.Admin.Web.Bundles @using Volo.CmsKit.Admin.Web.Menus -@using Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages @using Volo.CmsKit.Admin.Web.Pages @inherits CmsKitAdminPageBase -@model UpdateModel +@model Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages.UpdateModel @{ PageLayout.Content.Title = L["Pages"].Value; @@ -17,27 +19,38 @@ @section scripts { - + + + + + + +} + +@section styles { + + + } - - - - +
+ + + - - + - @await Component.InvokeAsync(typeof(EntityContentEditorViewComponent), new - { - entityType = "Page", - entityId = Model.Id.ToString(), - displaySubmitButton = false - }) + +
+
+
diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml.cs b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml.cs index e0b2d8b1b1..c21f8f587c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/Update.cshtml.cs @@ -1,10 +1,7 @@ using AutoMapper; using Microsoft.AspNetCore.Mvc; using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; using Volo.Abp.Validation; @@ -49,14 +46,17 @@ namespace Volo.CmsKit.Admin.Web.Pages.CmsKit.Pages [AutoMap(typeof(UpdatePageInputDto), ReverseMap = true)] public class UpdatePageViewModel { - [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxTitleLength))] [Required] + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxTitleLength))] public string Title { get; set; } - [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] [Required] - [DynamicFormIgnore] + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] public string Slug { get; set; } + + [HiddenInput] + [DynamicMaxLength(typeof(PageConsts), nameof(PageConsts.MaxSlugLength))] + public string Content { get; set; } } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js index d0a27aefe3..029ab189cd 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js @@ -1,22 +1,25 @@ $(function () { var l = abp.localization.getResource("CmsKit"); - var $formCreate = $('#form-page-create'); + var $createForm = $('#form-page-create'); var $title = $('#ViewModel_Title'); var $slug = $('#ViewModel_Slug'); var $buttonSubmit = $('#button-page-create'); - var $pageContentInput = $('#ViewModel_Value'); - $formCreate.on('submit', function (e) { + $createForm.data('validator').settings.ignore = ":hidden, [contenteditable='true']:not([name]), .tui-popup-wrapper"; + + $createForm.on('submit', function (e) { e.preventDefault(); - if ($formCreate.valid()) { + if ($createForm.valid()) { abp.ui.setBusy(); - $formCreate.ajaxSubmit({ + $createForm.ajaxSubmit({ success: function (result) { - submitEntityContent(result.id); + abp.notify.success(l('SuccessfullySaved')); + abp.ui.clearBusy(); + location.href = "/CmsKit/Pages/"; } }); } @@ -24,28 +27,9 @@ $buttonSubmit.click(function (e) { e.preventDefault(); - $formCreate.submit(); + $createForm.submit(); }); - function submitEntityContent(pageId) { - volo.cmsKit.admin.contents.contentAdmin - .create( - { - entityType: 'Page', - entityId: pageId, - value: $pageContentInput.val() - }) - .then(function (result) { - finishSaving(); - }); - } - - function finishSaving() { - abp.notify.success(l('SuccessfullySaved')); - abp.ui.clearBusy(); - location.href = "/CmsKit/Pages/"; - } - var slugEdited = false; $title.on('change paste keyup', function () { @@ -69,4 +53,84 @@ $slug.change(function () { slugEdited = true; }); + + // ----------------------------------- + function getUppyHeaders() { + var headers = {}; + headers[abp.security.antiForgery.tokenHeaderName] = abp.security.antiForgery.getToken(); + + return headers; + } + + var fileUploadUri = "/api/cms-kit-admin/media/page"; + var fileUriPrefix = "/api/cms-kit/media/"; + + var editorDataKey = "tuiEditor"; + + initAllEditors(); + + function initAllEditors() { + $('.content-editor').each(function (i, item) { + initEditor(item); + }); + } + + function initEditor(element) { + var $editorContainer = $(element); + var inputName = $editorContainer.data('input-id'); + var $editorInput = $('#' + inputName); + var initialValue = $editorInput.val(); + + var editor = $editorContainer.tuiEditor({ + usageStatistics: false, + useCommandShortcut: true, + initialValue: initialValue, + previewStyle: 'tab', + height: "25em", + minHeight: "25em", + initialEditType: initialValue ? 'wysiwyg' : 'markdown', + language: $editorContainer.data("language"), + hooks: { + addImageBlobHook: uploadFile, + }, + events: { + change: function (_val) { + $editorInput.val(editor.getHtml()); + $editorInput.trigger("change"); + } + } + }).data(editorDataKey); + } + + function uploadFile(blob, callback, source) { + var UPPY_OPTIONS = { + endpoint: fileUploadUri, + formData: true, + fieldName: "file", + method: "post", + headers: getUppyHeaders() + }; + + var UPPY = Uppy.Core().use(Uppy.XHRUpload, UPPY_OPTIONS); + + UPPY.reset(); + + UPPY.addFile({ + id: "content-file", + name: blob.name, + type: blob.type, + data: blob, + }); + + UPPY.upload().then((result) => { + if (result.failed.length > 0) { + abp.message.error("File upload failed"); + } else { + var mediaDto = result.successful[0].response.body; + var fileUrl = (fileUriPrefix + mediaDto.id); + + callback(fileUrl, mediaDto.name); + } + }); + } }); \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js index 3f8b971866..1dd4734150 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js +++ b/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js @@ -4,9 +4,8 @@ var $formUpdate = $('#form-page-update'); var $buttonSubmit = $('#button-page-update'); - var $pageContentInput = $('#ViewModel_Value'); - var $pageIdInput = $('#Id'); - var $contentIdInput = $('#ViewModel_Id'); + + $formUpdate.data('validator').settings.ignore = ":hidden, [contenteditable='true']:not([name]), .tui-popup-wrapper"; $formUpdate.on('submit', function (e) { e.preventDefault(); @@ -17,7 +16,9 @@ $formUpdate.ajaxSubmit({ success: function (result) { - submitEntityContent(); + abp.notify.success(l('SuccessfullySaved')); + abp.ui.clearBusy(); + location.href = "/CmsKit/Pages/"; } }); } @@ -28,38 +29,83 @@ $formUpdate.submit(); }); - function submitEntityContent() { - - var contentId = $contentIdInput.val(); - var pageId = $pageIdInput.val(); - var contentValue = $pageContentInput.val(); - - if (contentId) { - volo.cmsKit.admin.contents.contentAdmin - .update(contentId, - { - value: contentValue - }) - .then(function (result) { - finishSaving(result); - }); - } - else { - volo.cmsKit.admin.contents.contentAdmin - .create({ - entityType: 'Page', - entityId: pageId, - value: contentValue - }) - .then(function (result) { - finishSaving(result); - }); - } + // ----------------------------------- + function getUppyHeaders() { + var headers = {}; + headers[abp.security.antiForgery.tokenHeaderName] = abp.security.antiForgery.getToken(); + + return headers; + } + + var fileUploadUri = "/api/cms-kit-admin/media/page"; + var fileUriPrefix = "/api/cms-kit/media/"; + + var editorDataKey = "tuiEditor"; + + initAllEditors(); + + function initAllEditors() { + $('.content-editor').each(function (i, item) { + initEditor(item); + }); } - function finishSaving(result) { - abp.notify.success(l('SuccessfullySaved')); - abp.ui.clearBusy(); - location.href = "/CmsKit/Pages/"; + function initEditor(element) { + var $editorContainer = $(element); + var inputName = $editorContainer.data('input-id'); + var $editorInput = $('#' + inputName); + var initialValue = $editorInput.val(); + + var editor = $editorContainer.tuiEditor({ + usageStatistics: false, + useCommandShortcut: true, + initialValue: initialValue, + previewStyle: 'tab', + height: "25em", + minHeight: "25em", + initialEditType: initialValue ? 'wysiwyg' : 'markdown', + language: $editorContainer.data("language"), + hooks: { + addImageBlobHook: uploadFile, + }, + events: { + change: function (_val) { + $editorInput.val(editor.getHtml()); + $editorInput.trigger("change"); + } + } + }).data(editorDataKey); + } + + function uploadFile(blob, callback, source) { + var UPPY_OPTIONS = { + endpoint: fileUploadUri, + formData: true, + fieldName: "file", + method: "post", + headers: getUppyHeaders() + }; + + var UPPY = Uppy.Core().use(Uppy.XHRUpload, UPPY_OPTIONS); + + UPPY.reset(); + + UPPY.addFile({ + id: "content-file", + name: blob.name, + type: blob.type, + data: blob, + }); + + UPPY.upload().then((result) => { + if (result.failed.length > 0) { + abp.message.error("File upload failed"); + } else { + var mediaDto = result.successful[0].response.body; + var fileUrl = (fileUriPrefix + mediaDto.id); + + callback(fileUrl, mediaDto.name); + } + }); } }); \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs index 7e1de6e7c0..91748dc1e3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostConsts.cs @@ -11,6 +11,8 @@ namespace Volo.CmsKit.Blogs public static int MinSlugLength { get; set; } = 2; public static int MaxShortDescriptionLength { get; set; } = 256; + + public static int MaxContentLength { get; set; } = int.MaxValue; public const string EntityType = "BlogPost"; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs index fc4c5c75ad..7b9b8a1f5c 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Pages/PageConsts.cs @@ -7,5 +7,7 @@ public static int MaxTitleLength { get; set; } = 256; public static int MaxSlugLength { get; set; } = 256; + + public static int MaxContentLength { get; set; } = int.MaxValue; } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs index dc10725359..251a9c2895 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs @@ -21,9 +21,10 @@ namespace Volo.CmsKit.Blogs [NotNull] public virtual string ShortDescription { get; protected set; } + public virtual string Content { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - [NotNull] public Guid AuthorId { get; set; } public virtual CmsUser Author { get; set; } @@ -38,13 +39,17 @@ namespace Volo.CmsKit.Blogs Guid authorId, [NotNull] string title, [NotNull] string slug, - [CanBeNull] string shortDescription = null) : base(id) + [CanBeNull] string shortDescription = null, + [CanBeNull] string content = null, + [CanBeNull] Guid? tenantId = null) : base(id) { + TenantId = tenantId; BlogId = blogId; AuthorId = authorId; SetTitle(title); SetSlug(slug); - ShortDescription = shortDescription; + SetShortDescription(shortDescription); + SetContent(content); } public virtual void SetTitle(string title) @@ -63,5 +68,10 @@ namespace Volo.CmsKit.Blogs { ShortDescription = Check.Length(shortDescription, nameof(shortDescription), BlogPostConsts.MaxShortDescriptionLength); } + + public virtual void SetContent(string content) + { + Content = Check.Length(content, nameof(content), BlogPostConsts.MaxContentLength); + } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs index 4ee29608b4..3e15b91117 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPostManager.cs @@ -27,7 +27,7 @@ namespace Volo.CmsKit.Blogs [NotNull] string title, [NotNull] string slug, [CanBeNull] string shortDescription = null, - [CanBeNull] Guid? tenantId = null) + [CanBeNull] string content = null) { Check.NotNull(author, nameof(author)); Check.NotNull(blog, nameof(blog)); @@ -42,7 +42,9 @@ namespace Volo.CmsKit.Blogs author.Id, title, slug, - shortDescription + shortDescription, + content, + CurrentTenant.Id ); await CheckSlugExistenceAsync(blog.Id, blogPost.Slug); diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs deleted file mode 100644 index 392abfbc6f..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/Content.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace Volo.CmsKit.Contents -{ - public class Content : FullAuditedAggregateRoot, IMultiTenant - { - [CanBeNull] public virtual Guid? TenantId { get; protected set; } - - [NotNull] public virtual string EntityType { get; protected set; } - - [NotNull] public virtual string EntityId { get; protected set; } - - [NotNull] public virtual string Value { get; protected set; } - - protected Content() - { - } - - public Content(Guid id, [NotNull] string entityType, [NotNull] string entityId, [NotNull] string value, - Guid? tenantId = null) : base(id) - { - EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); - EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); - Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength); - - TenantId = tenantId; - } - - public virtual void SetValue([NotNull] string value) - { - Value = Check.NotNullOrEmpty(value, nameof(value), ContentConsts.MaxValueLength); - } - - public virtual void SetEntity([NotNull] string entityType, [NotNull] string entityId) - { - EntityType = Check.NotNullOrEmpty(entityType, nameof(entityType), ContentConsts.MaxEntityTypeLength); - EntityId = Check.NotNullOrWhiteSpace(entityId, nameof(entityId), ContentConsts.MaxEntityIdLength); - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentAlreadyExistException.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentAlreadyExistException.cs deleted file mode 100644 index 8ea4d4c54a..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentAlreadyExistException.cs +++ /dev/null @@ -1,17 +0,0 @@ -using JetBrains.Annotations; -using System; -using Volo.Abp; - -namespace Volo.CmsKit.Contents -{ - [Serializable] - public class ContentAlreadyExistException : BusinessException - { - public ContentAlreadyExistException([NotNull] string entityType, [NotNull] string entityId) - { - Code = CmsKitErrorCodes.ContentAlreadyExist; - WithData(nameof(Content.EntityType), entityType); - WithData(nameof(Content.EntityId), entityId); - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs deleted file mode 100644 index 707f15bbb9..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/ContentManager.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Services; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Contents -{ - public class ContentManager : DomainService, IContentManager - { - protected IContentRepository ContentRepository { get; } - - public ContentManager(IContentRepository contentRepository) - { - ContentRepository = contentRepository; - } - - public virtual async Task InsertAsync(Content content, CancellationToken cancellationToken = default) - { - if (await ContentRepository.ExistsAsync(content.EntityType, content.EntityId, content.TenantId, - cancellationToken)) - { - throw new ContentAlreadyExistException(content.EntityType, content.EntityId); - } - - return await ContentRepository.InsertAsync(content, cancellationToken: cancellationToken); - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentManager.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentManager.cs deleted file mode 100644 index d64bd0effe..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentManager.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Contents -{ - public interface IContentManager - { - Task InsertAsync(Content content, CancellationToken cancellationToken = default); - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentRepository.cs deleted file mode 100644 index 3b767b4722..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Contents/IContentRepository.cs +++ /dev/null @@ -1,35 +0,0 @@ -using JetBrains.Annotations; -using System; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace Volo.CmsKit.Contents -{ - public interface IContentRepository : IBasicRepository - { - Task GetAsync( - [NotNull] string entityType, - [NotNull] string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default); - - Task FindAsync( - [NotNull] string entityType, - [NotNull] string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default); - - Task DeleteAsync( - [NotNull] string entityType, - [NotNull] string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default); - - Task ExistsAsync( - [NotNull] string entityType, - [NotNull] string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default); - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/MediaDescriptors/DefaultMediaDescriptorDefinitionStore.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/MediaDescriptors/DefaultMediaDescriptorDefinitionStore.cs index 5a1553c3fc..752f921da7 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/MediaDescriptors/DefaultMediaDescriptorDefinitionStore.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/MediaDescriptors/DefaultMediaDescriptorDefinitionStore.cs @@ -29,7 +29,7 @@ namespace Volo.CmsKit.MediaDescriptors { Check.NotNullOrWhiteSpace(entityType, nameof(entityType)); - var result = Options.EntityTypes.SingleOrDefault(x => x.EntityType == entityType) ?? + var result = Options.EntityTypes.SingleOrDefault(x => x.EntityType.Equals(entityType, StringComparison.InvariantCultureIgnoreCase)) ?? throw new EntityCantHaveMediaException(entityType); return Task.FromResult(result); @@ -39,7 +39,7 @@ namespace Volo.CmsKit.MediaDescriptors { Check.NotNullOrEmpty(entityType, nameof(entityType)); - var isDefined = Options.EntityTypes.Any(a => a.EntityType == entityType); + var isDefined = Options.EntityTypes.Any(a => a.EntityType.Equals(entityType, StringComparison.InvariantCultureIgnoreCase)); return Task.FromResult(isDefined); } diff --git a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs index 9c0ee2d6b9..dd759ebd08 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Pages/Page.cs @@ -8,22 +8,25 @@ namespace Volo.CmsKit.Pages { public class Page : FullAuditedAggregateRoot, IMultiTenant { - [CanBeNull] public virtual Guid? TenantId { get; protected set; } + public virtual Guid? TenantId { get; protected set; } - [NotNull] public virtual string Title { get; protected set; } + public virtual string Title { get; protected set; } - [NotNull] public virtual string Slug { get; protected set; } + public virtual string Slug { get; protected set; } + public virtual string Content { get; protected set; } + protected Page() { } - public Page(Guid id, [NotNull] string title, [NotNull] string slug, [CanBeNull]Guid? tenantId = null) : base(id) + public Page(Guid id, [NotNull] string title, [NotNull] string slug, string content = null, Guid? tenantId = null) : base(id) { - Title = Check.NotNullOrEmpty(title, nameof(title), PageConsts.MaxTitleLength); - Slug = Check.NotNullOrEmpty(slug, nameof(slug), PageConsts.MaxSlugLength); - TenantId = tenantId; + + SetTitle(title); + SetSlug(slug); + SetContent(content); } public virtual void SetTitle(string title) @@ -35,5 +38,10 @@ namespace Volo.CmsKit.Pages { Slug = Check.NotNullOrEmpty(slug, nameof(slug), PageConsts.MaxSlugLength); } + + public virtual void SetContent(string content) + { + Content = Check.Length(content, nameof(content), PageConsts.MaxContentLength); + } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs deleted file mode 100644 index 9a99bc5eca..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/Contents/EfCoreContentRepository.cs +++ /dev/null @@ -1,86 +0,0 @@ -using JetBrains.Annotations; -using Microsoft.EntityFrameworkCore; -using System; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; -using Volo.CmsKit.EntityFrameworkCore; - -namespace Volo.CmsKit.Contents -{ - public class EfCoreContentRepository : EfCoreRepository, IContentRepository - { - public EfCoreContentRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - - public virtual Task GetAsync( - string entityType, - string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return GetAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken) - ); - } - - public virtual Task FindAsync( - string entityType, - string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return FindAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken) - ); - } - - public virtual Task DeleteAsync( - string entityType, - string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return DeleteAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken)); - } - - public virtual async Task ExistsAsync( - [NotNull] string entityType, - [NotNull] string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - var dbSet = await GetDbSetAsync(); - return await dbSet.AnyAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken)); - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs index 749a0653f9..7fc05ea042 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContext.cs @@ -3,7 +3,6 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.Pages; using Volo.CmsKit.Ratings; @@ -16,7 +15,6 @@ namespace Volo.CmsKit.EntityFrameworkCore [ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] public class CmsKitDbContext : AbpDbContext, ICmsKitDbContext { - public DbSet Contents { get; set; } public DbSet Comments { get; set; } public DbSet User { get; set; } public DbSet Reactions { get; set; } diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs index 476e2a3111..57a8e062fc 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs @@ -8,7 +8,6 @@ using Volo.CmsKit.Comments; using Volo.CmsKit.Reactions; using Volo.CmsKit.Users; using Volo.Abp.Users.EntityFrameworkCore; -using Volo.CmsKit.Contents; using Volo.CmsKit.GlobalFeatures; using Volo.CmsKit.Pages; using Volo.CmsKit.Ratings; @@ -111,26 +110,6 @@ namespace Volo.CmsKit.EntityFrameworkCore builder.Ignore(); } - if (GlobalFeatureManager.Instance.IsEnabled()) - { - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "Contents", options.Schema); - - b.ConfigureByConvention(); - - b.Property(x => x.EntityType).IsRequired().HasMaxLength(ContentConsts.MaxEntityTypeLength); - b.Property(x => x.EntityId).IsRequired().HasMaxLength(ContentConsts.MaxEntityIdLength); - b.Property(x => x.Value).IsRequired().HasMaxLength(ContentConsts.MaxValueLength); - - b.HasIndex(x => new { x.TenantId, x.EntityType, x.EntityId }); - }); - } - else - { - builder.Ignore(); - } - if (GlobalFeatureManager.Instance.IsEnabled()) { builder.Entity(b => @@ -179,6 +158,7 @@ namespace Volo.CmsKit.EntityFrameworkCore b.Property(x => x.Title).IsRequired().HasMaxLength(PageConsts.MaxTitleLength); b.Property(x => x.Slug).IsRequired().HasMaxLength(PageConsts.MaxSlugLength); + b.Property(x => x.Content).HasMaxLength(PageConsts.MaxContentLength); b.HasIndex(x => new { x.TenantId, Url = x.Slug }); }); @@ -207,14 +187,12 @@ namespace Volo.CmsKit.EntityFrameworkCore b.ConfigureByConvention(); + b.Property(p => p.AuthorId).IsRequired(); b.Property(p => p.Title).IsRequired().HasMaxLength(BlogPostConsts.MaxTitleLength); - b.Property(p => p.Slug).IsRequired().HasMaxLength(BlogPostConsts.MaxSlugLength); - b.Property(p => p.ShortDescription).HasMaxLength(BlogPostConsts.MaxShortDescriptionLength); - - b.Property(p => p.AuthorId).IsRequired(); - + b.Property(p => p.Content).HasMaxLength(BlogPostConsts.MaxContentLength); + b.HasIndex(x => new { x.Slug, x.BlogId }); }); diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs index 335bbb9f78..0bbb9ea58b 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitEntityFrameworkCoreModule.cs @@ -29,7 +29,6 @@ namespace Volo.CmsKit.EntityFrameworkCore options.AddRepository(); options.AddRepository(); options.AddRepository(); - options.AddRepository(); options.AddRepository(); options.AddRepository(); options.AddRepository(); diff --git a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs index 0299856341..0484676a94 100644 --- a/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/ICmsKitDbContext.cs @@ -3,7 +3,6 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.Pages; using Volo.CmsKit.Ratings; @@ -16,7 +15,6 @@ namespace Volo.CmsKit.EntityFrameworkCore [ConnectionStringName(CmsKitDbProperties.ConnectionStringName)] public interface ICmsKitDbContext : IEfCoreDbContext { - DbSet Contents { get; } DbSet Comments { get; } DbSet User { get; } DbSet Reactions { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs index cd03531448..4d8f86b823 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContext.cs @@ -24,8 +24,6 @@ namespace Volo.CmsKit.MongoDB public IMongoCollection CmsUsers => Collection(); public IMongoCollection Ratings => Collection(); - - public IMongoCollection Contents => Collection(); public IMongoCollection Tags => Collection(); diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs index 2a542472d2..8585f988f9 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbContextExtensions.cs @@ -47,11 +47,6 @@ namespace Volo.CmsKit.MongoDB x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Ratings"; }); - builder.Entity(x => - { - x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Contents"; - }); - builder.Entity(x => { x.CollectionName = CmsKitDbProperties.DbTablePrefix + "Tags"; diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbModule.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbModule.cs index 11e3a0eb86..f18e92e2ba 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbModule.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/CmsKitMongoDbModule.cs @@ -4,11 +4,9 @@ using Volo.Abp.MongoDB; using Volo.Abp.Users.MongoDB; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.MongoDB.Blogs; using Volo.CmsKit.MongoDB.Comments; -using Volo.CmsKit.MongoDB.Contents; using Volo.CmsKit.MongoDB.MediaDescriptors; using Volo.CmsKit.MongoDB.Pages; using Volo.CmsKit.MongoDB.Ratings; @@ -38,7 +36,6 @@ namespace Volo.CmsKit.MongoDB options.AddRepository(); options.AddRepository(); options.AddRepository(); - options.AddRepository(); options.AddRepository(); options.AddRepository(); options.AddRepository(); diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs deleted file mode 100644 index fded228c16..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/Contents/MongoContentRepository.cs +++ /dev/null @@ -1,80 +0,0 @@ -using JetBrains.Annotations; -using MongoDB.Driver.Linq; -using System; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Domain.Repositories.MongoDB; -using Volo.Abp.MongoDB; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.MongoDB.Contents -{ - public class MongoContentRepository : MongoDbRepository, IContentRepository - { - public MongoContentRepository(IMongoDbContextProvider dbContextProvider) : base( - dbContextProvider) - { - } - - public virtual Task GetAsync( - string entityType, - string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return GetAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken) - ); - } - - public virtual Task FindAsync( - string entityType, - string entityId, - Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return FindAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken) - ); - } - - public virtual Task DeleteAsync(string entityType, string entityId, Guid? tenantId = null, - CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return DeleteAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken)); - } - - public virtual async Task ExistsAsync([NotNull] string entityType, [NotNull] string entityId, - Guid? tenantId = null, CancellationToken cancellationToken = default) - { - Check.NotNullOrEmpty(entityType, nameof(entityType)); - Check.NotNullOrEmpty(entityId, nameof(entityId)); - - return await (await GetMongoQueryableAsync(cancellationToken)).AnyAsync(x => - x.EntityType == entityType && - x.EntityId == entityId && - x.TenantId == tenantId, - cancellationToken: GetCancellationToken(cancellationToken)); - } - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs index 742d40dfc6..5110bca501 100644 --- a/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs +++ b/modules/cms-kit/src/Volo.CmsKit.MongoDB/Volo/CmsKit/MongoDB/ICmsKitMongoDbContext.cs @@ -25,8 +25,6 @@ namespace Volo.CmsKit.MongoDB IMongoCollection Ratings { get; } - IMongoCollection Contents { get; } - IMongoCollection Tags { get; } IMongoCollection EntityTags { get; } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs index ece2704513..a7358f176a 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Blogs/BlogPostPublicDto.cs @@ -15,6 +15,8 @@ namespace Volo.CmsKit.Public.Blogs public string ShortDescription { get; set; } + public string Content { get; set; } + public CmsUserDto Author { get; set; } } } diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/ContentDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/ContentDto.cs deleted file mode 100644 index f11b4c8681..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/ContentDto.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace Volo.CmsKit.Public.Contents -{ - [Serializable] - public class ContentDto : EntityDto - { - public string Value { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/GetContentInput.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/GetContentInput.cs deleted file mode 100644 index 26a127e105..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/GetContentInput.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Volo.CmsKit.Public.Contents -{ - [Serializable] - public class GetContentInput - { - public string EntityType { get; set; } - - public string EntityId { get; set; } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentPublicAppService.cs deleted file mode 100644 index df8b07cfce..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Contents/IContentPublicAppService.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Public.Contents -{ - public interface IContentPublicAppService - { - Task GetAsync(GetContentInput input); - } -} \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs index 2add3c9d38..682c90b8c8 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application.Contracts/Volo/CmsKit/Public/Pages/PageDto.cs @@ -9,5 +9,7 @@ namespace Volo.CmsKit.Public.Pages public string Title { get; set; } public string Slug { get; set; } + + public string Content { get; set; } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs deleted file mode 100644 index 995c99c2ed..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/Contents/ContentPublicAppService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Threading.Tasks; -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.Public.Contents -{ - public class ContentPublicAppService : CmsKitPublicAppServiceBase, IContentPublicAppService - { - protected IContentRepository ContentRepository { get; } - - public ContentPublicAppService(IContentRepository contentRepository) - { - ContentRepository = contentRepository; - } - - public virtual async Task GetAsync(GetContentInput input) - { - var entity = await ContentRepository.GetAsync( - input.EntityType, - input.EntityId, - CurrentTenant.Id); - - return ObjectMapper.Map(entity); - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs index 46dab5a9a1..b8684f2463 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Application/Volo/CmsKit/Public/PublicApplicationAutoMapperProfile.cs @@ -2,11 +2,9 @@ using Volo.Abp.AutoMapper; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.Pages; using Volo.CmsKit.Public.Blogs; using Volo.CmsKit.Public.Comments; -using Volo.CmsKit.Public.Contents; using Volo.CmsKit.Public.Pages; using Volo.CmsKit.Public.Ratings; using Volo.CmsKit.Ratings; @@ -29,8 +27,6 @@ namespace Volo.CmsKit.Public CreateMap(); - CreateMap(); - CreateMap(); CreateMap(MemberList.None); diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs b/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs deleted file mode 100644 index 9ba368f03d..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.HttpApi/Volo/CmsKit/Public/Contents/ContentController.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.GlobalFeatures; -using Volo.CmsKit.Contents; -using Volo.CmsKit.GlobalFeatures; - -namespace Volo.CmsKit.Public.Contents -{ - [RequiresGlobalFeature(typeof(ContentsFeature))] - [RemoteService(Name = CmsKitCommonRemoteServiceConsts.RemoteServiceName)] - [Area("cms-kit")] - [Route("api/cms-kit-public/contents")] - public class ContentController : CmsKitControllerBase, IContentPublicAppService - { - protected IContentPublicAppService ContentAppService { get; } - - public ContentController(IContentPublicAppService contentAppService) - { - ContentAppService = contentAppService; - } - - [HttpGet] - public virtual Task GetAsync(GetContentInput input) - { - return ContentAppService.GetAsync(input); - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml index 39737ba8df..0ed8987d72 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Blogs/BlogPost/Default.cshtml @@ -1,6 +1,4 @@ @model Volo.CmsKit.Public.Blogs.BlogPostPublicDto -@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Contents -@using Volo.Abp.AspNetCore.Mvc.UI.Layout @using Volo.CmsKit.Localization @using Microsoft.Extensions.Localization @@ -14,11 +12,7 @@ - @await Component.InvokeAsync(typeof(ContentViewComponent), new - { - entityType = Volo.CmsKit.Blogs.BlogPostConsts.EntityType, - entityId = Model.Id.ToString() - }) + @Html.Raw(Model.Content) @Model.CreationTime diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs deleted file mode 100644 index 70baaf4436..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/ContentViewComponent.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Domain.Entities; -using Volo.CmsKit.Public.Contents; -using Volo.CmsKit.Web.Contents; - -namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Contents -{ - [ViewComponent(Name = "CmsContent")] - public class ContentViewComponent : AbpViewComponent - { - private readonly IContentRenderer contentRenderer; - private readonly IContentPublicAppService contentAppService; - - public ContentViewComponent( - IContentRenderer contentRenderer, - IContentPublicAppService contentAppService) - { - this.contentRenderer = contentRenderer; - this.contentAppService = contentAppService; - } - - public virtual async Task InvokeAsync( - string entityType, - string entityId) - { - var content = string.Empty; - - try - { - var contentDto = await contentAppService.GetAsync(new GetContentInput - { - EntityId = entityId, - EntityType = entityType - }); - - content = contentDto.Value; - } - catch (EntityNotFoundException e) - { - // ContentDto can be null, we will render empty content. - } - - var viewModel = new ContentViewModel - { - Value = await contentRenderer.RenderAsync(content) - }; - - return View("~/Pages/CmsKit/Shared/Components/Contents/Default.cshtml", viewModel); - } - - public class ContentViewModel - { - public string Value { get; set; } - } - } -} diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/Default.cshtml deleted file mode 100644 index 0f1ddedfe5..0000000000 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Contents/Default.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Contents.ContentViewComponent.ContentViewModel - -@Html.Raw(Model.Value) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml index e10fa0754a..ae23d5757f 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/Default.cshtml @@ -1,8 +1,5 @@ @addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap - -@using Microsoft.AspNetCore.Mvc.RazorPages @using Volo.Abp.AspNetCore.Mvc.UI.Layout -@using Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Contents @model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages.PageViewModel @inject IPageLayout PageLayout @@ -12,11 +9,6 @@ - @await Component.InvokeAsync(typeof(ContentViewComponent), - new - { - entityType = nameof(Page), - entityId = Model.Id.ToString() - }) + @Html.Raw(Model.Content) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs index c972643359..3c8be1c2c3 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Pages/DefaultPageViewComponent.cs @@ -16,12 +16,13 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages PagePublicAppService = pagePublicAppService; } - public virtual async Task InvokeAsync(Guid pageId, string title, string description) + public virtual async Task InvokeAsync(Guid pageId, string title, string content) { var model = new PageViewModel { Id = pageId, - Title = title + Title = title, + Content = content }; return View("~/Pages/CmsKit/Shared/Components/Pages/Default.cshtml", model); @@ -33,5 +34,7 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Pages public Guid Id { get; set; } public string Title { get; set; } + + public string Content { get; set; } } } \ No newline at end of file diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml index 6060c00304..426b5ebacf 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/Public/CmsKit/Pages/Index.cshtml @@ -9,5 +9,6 @@ new { pageId = Model.Page.Id, - title = Model.Page.Title + title = Model.Page.Title, + content = Model.Page.Content }) \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs index 4fe6f2e23e..28e3daea8d 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Blogs/BlogPostAdminAppService_Tests.cs @@ -30,13 +30,15 @@ namespace Volo.CmsKit.Blogs var title = "My awesome new Post"; var slug = "my-awesome-new-post"; var shortDescription = "This blog is all about awesomeness 🤗!"; - + var content = "Another blog post shared on internet"; + var created = await blogPostAdminAppService.CreateAsync(new CreateBlogPostDto { BlogId = cmsKitTestData.Blog_Id, Title = title, Slug = slug, - ShortDescription = shortDescription + ShortDescription = shortDescription, + Content = content }); created.Id.ShouldNotBe(Guid.Empty); @@ -46,6 +48,7 @@ namespace Volo.CmsKit.Blogs blogPost.Title.ShouldBe(title); blogPost.Slug.ShouldBe(slug); blogPost.ShortDescription.ShouldBe(shortDescription); + blogPost.Content.ShouldBe(content); } [Fact] @@ -54,6 +57,7 @@ namespace Volo.CmsKit.Blogs var title = "Another My Awesome New Post"; var slug = "another-my-awesome-new-post"; var shortDescription = "This blog is all about awesomeness 🤗!"; + var content = "Another blog post shared on internet"; var dto = new CreateBlogPostDto { @@ -61,7 +65,8 @@ namespace Volo.CmsKit.Blogs BlogId = Guid.NewGuid(), Title = title, Slug = slug, - ShortDescription = shortDescription + ShortDescription = shortDescription, + Content = content }; var exception = await Should.ThrowAsync(async () => @@ -107,12 +112,14 @@ namespace Volo.CmsKit.Blogs var shortDescription = "Another short description"; var title = "[Solved] Another Blog Post"; var slug = "another-short-blog-post"; + var content = "Another blog post shared on internet"; await blogPostAdminAppService.UpdateAsync(cmsKitTestData.BlogPost_2_Id, new UpdateBlogPostDto { ShortDescription = shortDescription, Title = title, Slug = slug, + Content = content }); var blogPost = await blogPostRepository.GetAsync(cmsKitTestData.BlogPost_2_Id); @@ -120,6 +127,7 @@ namespace Volo.CmsKit.Blogs blogPost.Title.ShouldBe(title); blogPost.ShortDescription.ShouldBe(shortDescription); blogPost.Slug.ShouldBe(slug); + blogPost.Content.ShouldBe(content); } [Fact] diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs deleted file mode 100644 index 5c7e5969f1..0000000000 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Contents/ContentAdminAppService_Tests.cs +++ /dev/null @@ -1,142 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using NSubstitute; -using Shouldly; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Users; -using Volo.CmsKit.Admin.Contents; -using Xunit; - -namespace Volo.CmsKit.Contents -{ - public class ContentAdminAppService_Tests : CmsKitApplicationTestBase - { - private ICurrentUser _currentUser; - private readonly CmsKitTestData _data; - private readonly IContentAdminAppService _service; - public ContentAdminAppService_Tests() - { - _data = GetRequiredService(); - _service = GetRequiredService(); - } - - protected override void AfterAddApplication(IServiceCollection services) - { - _currentUser = Substitute.For(); - services.AddSingleton(_currentUser); - } - - [Fact] - public async Task ShouldGetListAsync() - { - var result = await _service.GetListAsync(new ContentGetListInput()); - - result.ShouldNotBeNull(); - result.Items.ShouldNotBeEmpty(); - result.Items.Count.ShouldBe(4); - result.Items.All(x => x.ShouldBeOfType() != null); - } - - [Fact] - public async Task ShouldGetAsync() - { - var result = await _service.GetAsync(_data.Content_1_Id); - - result.ShouldNotBeNull(); - result.ShouldBeOfType(); - result.ShouldNotBeNull(result.Value); - } - - [Fact] - public async Task ShouldCreateAsync() - { - var entityId = "1-2-3"; - var entityType = "My.Awesome.Blog"; - var value = "Some long content"; - - var created = await _service.CreateAsync(new ContentCreateDto - { - EntityId = entityId, - EntityType = entityType, - Value = value - }); - - created.Id.ShouldNotBe(Guid.Empty); - - var content = await _service.GetAsync(created.Id); - - content.ShouldNotBeNull(); - content.EntityType.ShouldBe(entityType); - } - - [Fact] - public async Task ShouldNotCreateWithSameParametersAsync() - { - var entityTtype = "My.Awesome.Book"; - var entityId = "1"; - - await _service.CreateAsync(new ContentCreateDto - { - EntityId = entityId, - EntityType = entityTtype, - Value = "Some long content" - }); - - await Should.ThrowAsync(async () => - await _service.CreateAsync(new ContentCreateDto - { - EntityId = entityId, - EntityType = entityTtype, - Value = "Yet another long content" - }) - ); - } - - [Fact] - public async Task ShouldUpdateAsync() - { - string newValue = "Newly created fresh value"; - var updateDto = new ContentUpdateDto - { - Value = newValue - }; - - await _service.UpdateAsync(_data.Content_1_Id, updateDto); - - var content = await _service.GetAsync(_data.Content_1_Id); - content.ShouldNotBeNull(); - content.Value.ShouldBe(newValue); - } - - [Fact] - public async Task ShouldDeleteAsync() - { - await _service.DeleteAsync(_data.Content_2_Id); - - await Should.ThrowAsync(async () => await _service.GetAsync(_data.Content_2_Id)); - } - - [Fact] - public async Task ShouldNotThrowEntityNotFoundExceptionWhileDeletingAlreadyDeletedAsync() - { - await _service.DeleteAsync(_data.Content_2_Id); - - await Should.NotThrowAsync(async () => - await _service.DeleteAsync(_data.Content_2_Id)); - } - - [Fact] - public async Task ShouldGetByEntityAsync() - { - var entity = await _service.GetAsync(_data.Content_1_EntityType, _data.Content_1_EntityId); - - entity.ShouldNotBeNull(); - entity.EntityId.ShouldBe(_data.Content_1_EntityId); - entity.EntityType.ShouldBe(_data.Content_1_EntityType); - } - } -} diff --git a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs index c3e82c58f1..766c482ddd 100644 --- a/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs +++ b/modules/cms-kit/test/Volo.CmsKit.Application.Tests/Pages/PageAdminAppService_Tests.cs @@ -64,7 +64,8 @@ namespace Volo.CmsKit.Pages var dto = new CreatePageInputDto { Title = "test", - Slug = "test-url" + Slug = "test-url", + Content = "test*content" }; await Should.NotThrowAsync(async () => await _pageAdminAppService.CreateAsync(dto)); @@ -94,7 +95,8 @@ namespace Volo.CmsKit.Pages var dto = new UpdatePageInputDto { Title = _data.Page_1_Title + "++", - Slug = _data.Page_1_Slug+ "test" + Slug = _data.Page_1_Slug+ "test", + Content = "changed" }; await Should.NotThrowAsync(async () => await _pageAdminAppService.UpdateAsync(_data.Page_1_Id, dto)); @@ -106,6 +108,9 @@ namespace Volo.CmsKit.Pages updatedPage.Slug.ShouldNotBe(_data.Page_1_Slug); updatedPage.Slug.ShouldBe(dto.Slug); + + updatedPage.Content.ShouldNotBe(_data.Content_1); + updatedPage.Content.ShouldBe(dto.Content); } [Fact] diff --git a/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/Contents/ContentRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/Contents/ContentRepository_Test.cs deleted file mode 100644 index 72f0b47485..0000000000 --- a/modules/cms-kit/test/Volo.CmsKit.EntityFrameworkCore.Tests/EntityFrameworkCore/Contents/ContentRepository_Test.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Volo.CmsKit.Contents; - -namespace Volo.CmsKit.EntityFrameworkCore.Contents -{ - public class ContentRepository_Test : ContentRepository_Tests - { - - } -} \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/Contents/ContentRepository_Test.cs b/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/Contents/ContentRepository_Test.cs deleted file mode 100644 index bb467a4844..0000000000 --- a/modules/cms-kit/test/Volo.CmsKit.MongoDB.Tests/MongoDB/Contents/ContentRepository_Test.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Volo.CmsKit.Contents; -using Xunit; - -namespace Volo.CmsKit.MongoDB.Contents -{ - [Collection(MongoTestCollection.Name)] - public class ContentRepository_Test : ContentRepository_Tests - { - - } -} \ No newline at end of file diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs index 8fd8b14f46..d218f7e93d 100644 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs +++ b/modules/cms-kit/test/Volo.CmsKit.TestBase/CmsKitDataSeedContributor.cs @@ -2,19 +2,16 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.BlobStoring; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; using Volo.Abp.Guids; using Volo.Abp.MultiTenancy; using Volo.Abp.Users; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; -using Volo.CmsKit.Contents; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.Pages; using Volo.CmsKit.Ratings; @@ -33,7 +30,6 @@ namespace Volo.CmsKit private readonly ReactionManager _reactionManager; private readonly IRatingRepository _ratingRepository; private readonly ICurrentTenant _currentTenant; - private readonly IContentRepository _contentRepository; private readonly EntityTagManager _entityTagManager; private readonly TagManager _tagManager; private readonly ITagRepository _tagRepository; @@ -58,7 +54,6 @@ namespace Volo.CmsKit ReactionManager reactionManager, IRatingRepository ratingRepository, ICurrentTenant currentTenant, - IContentRepository contentRepository, TagManager tagManager, ITagRepository tagRepository, IEntityTagRepository entityTagRepository, @@ -82,7 +77,6 @@ namespace Volo.CmsKit _reactionManager = reactionManager; _ratingRepository = ratingRepository; _currentTenant = currentTenant; - _contentRepository = contentRepository; _tagManager = tagManager; _tagRepository = tagRepository; _entityTagManager = entityTagManager; @@ -114,8 +108,6 @@ namespace Volo.CmsKit await SeedRatingsAsync(); - await SeedContentsAsync(); - await SeedTagsAsync(); await SeedPagesAsync(); @@ -273,37 +265,6 @@ namespace Volo.CmsKit )); } - private async Task SeedContentsAsync() - { - var content1 = new Content( - _cmsKitTestData.Content_1_Id, - _cmsKitTestData.Content_1_EntityType, - _cmsKitTestData.Content_1_EntityId, - _cmsKitTestData.Content_1 - ); - - var content2 = new Content( - _cmsKitTestData.Content_2_Id, - _cmsKitTestData.Content_2_EntityType, - _cmsKitTestData.Content_2_EntityId, - _cmsKitTestData.Content_2 - ); - - var content3 = new Content( - Guid.NewGuid(), - "deleted_entity_type", - "deleted_entity_id", - "Content" - ) - { - IsDeleted = true, - }; - - await _contentRepository.InsertAsync(content1); - await _contentRepository.InsertAsync(content2); - await _contentRepository.InsertAsync(content3); - } - private async Task SeedTagsAsync() { var created1 = await _tagRepository.InsertAsync( @@ -347,17 +308,11 @@ namespace Volo.CmsKit private async Task SeedPagesAsync() { - var page1 = new Page(_cmsKitTestData.Page_1_Id, _cmsKitTestData.Page_1_Title, _cmsKitTestData.Page_1_Slug); - var page1Content = new Content(_guidGenerator.Create(), nameof(Page), page1.Id.ToString(), _cmsKitTestData.Page_1_Content); - + var page1 = new Page(_cmsKitTestData.Page_1_Id, _cmsKitTestData.Page_1_Title, _cmsKitTestData.Page_1_Slug, _cmsKitTestData.Content_1); await _pageRepository.InsertAsync(page1); - await _contentRepository.InsertAsync(page1Content); - - var page2 = new Page(_cmsKitTestData.Page_2_Id, _cmsKitTestData.Page_2_Title, _cmsKitTestData.Page_2_Slug); - var page2Content = new Content(_guidGenerator.Create(), nameof(Page), page2.Id.ToString(), _cmsKitTestData.Page_2_Content); + var page2 = new Page(_cmsKitTestData.Page_2_Id, _cmsKitTestData.Page_2_Title, _cmsKitTestData.Page_2_Slug, _cmsKitTestData.Content_2); await _pageRepository.InsertAsync(page2); - await _contentRepository.InsertAsync(page2Content); } private async Task SeedBlogsAsync() @@ -376,7 +331,8 @@ namespace Volo.CmsKit blog, _cmsKitTestData.BlogPost_1_Title, _cmsKitTestData.BlogPost_1_Slug, - "Short desc 1"))).Id; + "Short desc 1", + "Blog Post 1 Content"))).Id; _cmsKitTestData.BlogPost_2_Id = (await _blogPostRepository.InsertAsync( @@ -385,7 +341,8 @@ namespace Volo.CmsKit blog, _cmsKitTestData.BlogPost_2_Title, _cmsKitTestData.BlogPost_2_Slug, - "Short desc 2"))).Id; + "Short desc 2", + "Blog Post 2 Content"))).Id; } private async Task SeedBlogFeaturesAsync() diff --git a/modules/cms-kit/test/Volo.CmsKit.TestBase/Contents/ContentRepository_Tests.cs b/modules/cms-kit/test/Volo.CmsKit.TestBase/Contents/ContentRepository_Tests.cs deleted file mode 100644 index c5b166551e..0000000000 --- a/modules/cms-kit/test/Volo.CmsKit.TestBase/Contents/ContentRepository_Tests.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Threading.Tasks; -using Shouldly; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Modularity; -using Xunit; - -namespace Volo.CmsKit.Contents -{ - public abstract class ContentRepository_Tests : CmsKitTestBase - where TStartupModule : IAbpModule - { - private readonly CmsKitTestData _cmsKitTestData; - private readonly IContentRepository _contentRepository; - - protected ContentRepository_Tests() - { - _cmsKitTestData = GetRequiredService(); - _contentRepository = GetRequiredService(); - } - - [Theory] - [InlineData("Lyrics", "1", "First things first")] - [InlineData("LyricsAlso", "2", "Second thing second")] - public async Task ShouldGetAsync(string entityType, string entityId, string contentStartsWith = null) - { - var content = await _contentRepository.GetAsync(entityType, entityId); - - content.ShouldNotBeNull(); - - if (contentStartsWith != null) - { - content.Value.ShouldStartWith(contentStartsWith); - } - } - - [Fact] - public async Task ShouldNotGetAsync() - { - Should.Throw( - async () - => - await _contentRepository.GetAsync("not_exist_entity", Guid.NewGuid().ToString())); - } - - [Fact] - public async Task ShouldFindAsync() - { - var content = - await _contentRepository.FindAsync(_cmsKitTestData.Content_1_EntityType, _cmsKitTestData.Content_1_EntityId); - - content.ShouldNotBeNull(); - } - - [Fact] - public async Task ShouldNotFindAsync() - { - var content = await _contentRepository.FindAsync("not_exist_entity", Guid.NewGuid().ToString()); - - content.ShouldBeNull(); - } - } -} \ No newline at end of file