diff --git a/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/20231218151037_AddedFileUserEntity.Designer.cs b/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/20231218151037_AddedFileUserEntity.Designer.cs new file mode 100644 index 0000000..8870d4d --- /dev/null +++ b/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/20231218151037_AddedFileUserEntity.Designer.cs @@ -0,0 +1,1704 @@ +// +using System; +using EasyAbp.FileManagement.Blazor.Server.Host.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace EasyAbp.FileManagement.Blazor.Server.Host.Migrations +{ + [DbContext(typeof(UnifiedDbContext))] + [Migration("20231218151037_AddedFileUserEntity")] + partial class AddedFileUserEntity + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("EasyAbp.FileManagement.Files.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlobName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ByteSize") + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileContainerName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FileName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FileType") + .HasColumnType("int"); + + b.Property("Flag") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Hash") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + 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") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("SoftDeletionToken") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)") + .HasDefaultValue(""); + + b.Property("SubFilesQuantity") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("BlobName"); + + b.HasIndex("Hash"); + + b.HasIndex("ParentId", "OwnerUserId", "FileContainerName", "FileName"); + + b.HasIndex("FileName", "ParentId", "OwnerUserId", "FileContainerName", "TenantId", "SoftDeletionToken") + .IsUnique(); + + b.ToTable("EasyAbpFileManagementFiles", (string)null); + }); + + modelBuilder.Entity("EasyAbp.FileManagement.Users.FileUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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.ToTable("EasyAbpFileManagementUsers", (string)null); + }); + + 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() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .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("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("TenantName"); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("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") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + 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() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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() + .IsRequired() + .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("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + + 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("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + + 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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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() + .IsRequired() + .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("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("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("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("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") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("bit"); + + b.Property("IsInherited") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + 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/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/20231218151037_AddedFileUserEntity.cs b/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/20231218151037_AddedFileUserEntity.cs new file mode 100644 index 0000000..900f144 --- /dev/null +++ b/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/20231218151037_AddedFileUserEntity.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EasyAbp.FileManagement.Blazor.Server.Host.Migrations +{ + /// + public partial class AddedFileUserEntity : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "SoftDeletionToken", + table: "EasyAbpFileManagementFiles", + type: "nvarchar(450)", + nullable: true, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true); + + migrationBuilder.CreateTable( + name: "EasyAbpFileManagementUsers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + EmailConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpFileManagementUsers", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpFileManagementUsers"); + + migrationBuilder.AlterColumn( + name: "SoftDeletionToken", + table: "EasyAbpFileManagementFiles", + type: "nvarchar(450)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true, + oldDefaultValue: ""); + } + } +} diff --git a/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs b/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs index ab3f873..c1c46ac 100644 --- a/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/host/EasyAbp.FileManagement.Blazor.Server.Host/Migrations/UnifiedDbContextModelSnapshot.cs @@ -109,7 +109,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("uniqueidentifier"); b.Property("SoftDeletionToken") - .HasColumnType("nvarchar(450)"); + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)") + .HasDefaultValue(""); b.Property("SubFilesQuantity") .HasColumnType("int"); @@ -132,6 +134,76 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("EasyAbpFileManagementFiles", (string)null); }); + modelBuilder.Entity("EasyAbp.FileManagement.Users.FileUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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.ToTable("EasyAbpFileManagementUsers", (string)null); + }); + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property("Id") diff --git a/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/20231218150923_AddedFileUserEntity.Designer.cs b/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/20231218150923_AddedFileUserEntity.Designer.cs new file mode 100644 index 0000000..9407017 --- /dev/null +++ b/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/20231218150923_AddedFileUserEntity.Designer.cs @@ -0,0 +1,212 @@ +// +using System; +using EasyAbp.FileManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace EasyAbp.FileManagement.Migrations +{ + [DbContext(typeof(FileManagementHttpApiHostMigrationsDbContext))] + [Migration("20231218150923_AddedFileUserEntity")] + partial class AddedFileUserEntity + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("EasyAbp.FileManagement.Files.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlobName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ByteSize") + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileContainerName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FileName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FileType") + .HasColumnType("int"); + + b.Property("Flag") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Hash") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + 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") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("SoftDeletionToken") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)") + .HasDefaultValue(""); + + b.Property("SubFilesQuantity") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("BlobName"); + + b.HasIndex("Hash"); + + b.HasIndex("ParentId", "OwnerUserId", "FileContainerName", "FileName"); + + b.HasIndex("FileName", "ParentId", "OwnerUserId", "FileContainerName", "TenantId", "SoftDeletionToken") + .IsUnique(); + + b.ToTable("EasyAbpFileManagementFiles", (string)null); + }); + + modelBuilder.Entity("EasyAbp.FileManagement.Users.FileUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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.ToTable("EasyAbpFileManagementUsers", (string)null); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/20231218150923_AddedFileUserEntity.cs b/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/20231218150923_AddedFileUserEntity.cs new file mode 100644 index 0000000..5a05b18 --- /dev/null +++ b/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/20231218150923_AddedFileUserEntity.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EasyAbp.FileManagement.Migrations +{ + /// + public partial class AddedFileUserEntity : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "SoftDeletionToken", + table: "EasyAbpFileManagementFiles", + type: "nvarchar(450)", + nullable: true, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true); + + migrationBuilder.CreateTable( + name: "EasyAbpFileManagementUsers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + EmailConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpFileManagementUsers", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpFileManagementUsers"); + + migrationBuilder.AlterColumn( + name: "SoftDeletionToken", + table: "EasyAbpFileManagementFiles", + type: "nvarchar(450)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true, + oldDefaultValue: ""); + } + } +} diff --git a/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs b/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs index 3ece842..0261c8c 100644 --- a/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs +++ b/host/EasyAbp.FileManagement.HttpApi.Host/Migrations/FileManagementHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -109,7 +109,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("uniqueidentifier"); b.Property("SoftDeletionToken") - .HasColumnType("nvarchar(450)"); + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)") + .HasDefaultValue(""); b.Property("SubFilesQuantity") .HasColumnType("int"); @@ -131,6 +133,76 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("EasyAbpFileManagementFiles", (string)null); }); + + modelBuilder.Entity("EasyAbp.FileManagement.Users.FileUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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.ToTable("EasyAbpFileManagementUsers", (string)null); + }); #pragma warning restore 612, 618 } } diff --git a/host/EasyAbp.FileManagement.Web.Unified/Migrations/20231218150858_AddedFileUserEntity.Designer.cs b/host/EasyAbp.FileManagement.Web.Unified/Migrations/20231218150858_AddedFileUserEntity.Designer.cs new file mode 100644 index 0000000..02504b0 --- /dev/null +++ b/host/EasyAbp.FileManagement.Web.Unified/Migrations/20231218150858_AddedFileUserEntity.Designer.cs @@ -0,0 +1,1704 @@ +// +using System; +using EasyAbp.FileManagement.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +#nullable disable + +namespace EasyAbp.FileManagement.Migrations +{ + [DbContext(typeof(UnifiedDbContext))] + [Migration("20231218150858_AddedFileUserEntity")] + partial class AddedFileUserEntity + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "7.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("EasyAbp.FileManagement.Files.File", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BlobName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ByteSize") + .HasColumnType("bigint"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileContainerName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("FileName") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("FileType") + .HasColumnType("int"); + + b.Property("Flag") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Hash") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + 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") + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("SoftDeletionToken") + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)") + .HasDefaultValue(""); + + b.Property("SubFilesQuantity") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("BlobName"); + + b.HasIndex("Hash"); + + b.HasIndex("ParentId", "OwnerUserId", "FileContainerName", "FileName"); + + b.HasIndex("FileName", "ParentId", "OwnerUserId", "FileContainerName", "TenantId", "SoftDeletionToken") + .IsUnique(); + + b.ToTable("EasyAbpFileManagementFiles", (string)null); + }); + + modelBuilder.Entity("EasyAbp.FileManagement.Users.FileUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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.ToTable("EasyAbpFileManagementUsers", (string)null); + }); + + 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() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("CorrelationId"); + + b.Property("Exceptions") + .HasColumnType("nvarchar(max)"); + + b.Property("ExecutionDuration") + .HasColumnType("int") + .HasColumnName("ExecutionDuration"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .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("ImpersonatorTenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("ImpersonatorTenantName"); + + b.Property("ImpersonatorUserId") + .HasColumnType("uniqueidentifier") + .HasColumnName("ImpersonatorUserId"); + + b.Property("ImpersonatorUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)") + .HasColumnName("ImpersonatorUserName"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TenantName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)") + .HasColumnName("TenantName"); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AllowedProviders") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsAvailableToHost") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ValueType") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatures", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpFeatureGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("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") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpFeatureValues", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Description") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + 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() + .IsRequired() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CorrelationId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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() + .IsRequired() + .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("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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("LastPasswordChangeTime") + .HasColumnType("datetimeoffset"); + + 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("ShouldChangePasswordOnNextLogin") + .HasColumnType("bit"); + + 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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserDelegation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("SourceUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StartTime") + .HasColumnType("datetime2"); + + b.Property("TargetUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("AbpUserDelegations", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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", (string)null); + }); + + 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() + .IsRequired() + .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("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("IsEnabled") + .HasColumnType("bit"); + + b.Property("MultiTenancySide") + .HasColumnType("tinyint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("ParentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("StateCheckers") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("GroupName"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("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("TenantId", "Name", "ProviderName", "ProviderKey") + .IsUnique() + .HasFilter("[TenantId] IS NOT NULL"); + + b.ToTable("AbpPermissionGrants", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpPermissionGroups", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("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") + .IsUnique() + .HasFilter("[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL"); + + b.ToTable("AbpSettings", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.SettingDefinitionRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("DefaultValue") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Description") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsEncrypted") + .HasColumnType("bit"); + + b.Property("IsInherited") + .HasColumnType("bit"); + + b.Property("IsVisibleToClients") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Providers") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("AbpSettingDefinitions", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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("EntityVersion") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .IsRequired() + .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", (string)null); + }); + + 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", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + 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/host/EasyAbp.FileManagement.Web.Unified/Migrations/20231218150858_AddedFileUserEntity.cs b/host/EasyAbp.FileManagement.Web.Unified/Migrations/20231218150858_AddedFileUserEntity.cs new file mode 100644 index 0000000..5a05b18 --- /dev/null +++ b/host/EasyAbp.FileManagement.Web.Unified/Migrations/20231218150858_AddedFileUserEntity.cs @@ -0,0 +1,64 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EasyAbp.FileManagement.Migrations +{ + /// + public partial class AddedFileUserEntity : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "SoftDeletionToken", + table: "EasyAbpFileManagementFiles", + type: "nvarchar(450)", + nullable: true, + defaultValue: "", + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true); + + migrationBuilder.CreateTable( + name: "EasyAbpFileManagementUsers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Surname = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + EmailConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + PhoneNumber = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "bit", nullable: false, defaultValue: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: false), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpFileManagementUsers", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpFileManagementUsers"); + + migrationBuilder.AlterColumn( + name: "SoftDeletionToken", + table: "EasyAbpFileManagementFiles", + type: "nvarchar(450)", + nullable: true, + oldClrType: typeof(string), + oldType: "nvarchar(450)", + oldNullable: true, + oldDefaultValue: ""); + } + } +} diff --git a/host/EasyAbp.FileManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs b/host/EasyAbp.FileManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs index 9adc9a0..46c4d5d 100644 --- a/host/EasyAbp.FileManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs +++ b/host/EasyAbp.FileManagement.Web.Unified/Migrations/UnifiedDbContextModelSnapshot.cs @@ -109,7 +109,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("uniqueidentifier"); b.Property("SoftDeletionToken") - .HasColumnType("nvarchar(450)"); + .ValueGeneratedOnAdd() + .HasColumnType("nvarchar(450)") + .HasDefaultValue(""); b.Property("SubFilesQuantity") .HasColumnType("int"); @@ -132,6 +134,76 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("EasyAbpFileManagementFiles", (string)null); }); + modelBuilder.Entity("EasyAbp.FileManagement.Users.FileUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .IsRequired() + .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") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsActive") + .HasColumnType("bit") + .HasColumnName("IsActive"); + + 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.ToTable("EasyAbpFileManagementUsers", (string)null); + }); + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Property("Id") diff --git a/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileInfoDto.cs b/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileInfoDto.cs index 3cf6d3d..a3cfc04 100644 --- a/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileInfoDto.cs +++ b/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileInfoDto.cs @@ -1,4 +1,6 @@ using System; +using EasyAbp.FileManagement.Users; +using JetBrains.Annotations; using Volo.Abp.Application.Dtos; namespace EasyAbp.FileManagement.Files.Dtos @@ -23,5 +25,14 @@ public class FileInfoDto : ExtensibleFullAuditedEntityDto public string Hash { get; set; } public Guid? OwnerUserId { get; set; } + + [CanBeNull] + public BriefFileUserInfoModel Owner { get; set; } + + [CanBeNull] + public BriefFileUserInfoModel Creator { get; set; } + + [CanBeNull] + public BriefFileUserInfoModel LastModifier { get; set; } } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileLocationDto.cs b/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileLocationDto.cs new file mode 100644 index 0000000..dab5d84 --- /dev/null +++ b/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/Dtos/FileLocationDto.cs @@ -0,0 +1,13 @@ +using System; + +namespace EasyAbp.FileManagement.Files.Dtos; + +[Serializable] +public class FileLocationDto +{ + public Guid Id { get; set; } + + public string FileName { get; set; } + + public string Location { get; set; } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/IFileAppService.cs b/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/IFileAppService.cs index df95300..5875277 100644 --- a/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/IFileAppService.cs +++ b/src/EasyAbp.FileManagement.Application.Contracts/EasyAbp/FileManagement/Files/IFileAppService.cs @@ -9,9 +9,9 @@ namespace EasyAbp.FileManagement.Files { public interface IFileAppService : - IReadOnlyAppService< - FileInfoDto, - Guid, + IReadOnlyAppService< + FileInfoDto, + Guid, GetFileListInput> { Task CreateAsync(CreateFileInput input); @@ -27,7 +27,7 @@ public interface IFileAppService : Task DeleteAsync(Guid id); Task GetDownloadInfoAsync(Guid id); - + Task UpdateInfoAsync(Guid id, UpdateFileInfoInput input); Task DownloadAsync(Guid id, string token); @@ -35,5 +35,7 @@ public interface IFileAppService : Task DownloadWithStreamAsync(Guid id, string token); Task GetConfigurationAsync(string fileContainerName, Guid? ownerUserId); + + Task GetLocationAsync(Guid id); } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/FileManagementApplicationAutoMapperProfile.cs b/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/FileManagementApplicationAutoMapperProfile.cs index 85ee15c..6d87b22 100644 --- a/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/FileManagementApplicationAutoMapperProfile.cs +++ b/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/FileManagementApplicationAutoMapperProfile.cs @@ -1,6 +1,7 @@ using EasyAbp.FileManagement.Files; using EasyAbp.FileManagement.Files.Dtos; using AutoMapper; +using Volo.Abp.AutoMapper; namespace EasyAbp.FileManagement { @@ -12,7 +13,11 @@ public FileManagementApplicationAutoMapperProfile() * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap().MapExtraProperties(); + CreateMap() + .Ignore(x => x.Owner) + .Ignore(x => x.Creator) + .Ignore(x => x.LastModifier) + .MapExtraProperties(); } } } diff --git a/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/Files/FileAppService.cs b/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/Files/FileAppService.cs index 343b813..8fde137 100644 --- a/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/Files/FileAppService.cs +++ b/src/EasyAbp.FileManagement.Application/EasyAbp/FileManagement/Files/FileAppService.cs @@ -8,6 +8,7 @@ using EasyAbp.FileManagement.Files.Dtos; using EasyAbp.FileManagement.Options.Containers; using EasyAbp.FileManagement.Permissions; +using EasyAbp.FileManagement.Users; using JetBrains.Annotations; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization.Infrastructure; @@ -25,15 +26,18 @@ public class FileAppService : ReadOnlyAppService(); - var entities = await AsyncExecuter.ToListAsync(query); + if (totalCount > 0) + { + query = ApplySorting(query, input); + query = ApplyPaging(query, input); + + var entities = await AsyncExecuter.ToListAsync(query); + entityDtos = await MapToGetListOutputDtosAsync(entities); + } return new PagedResultDto( totalCount, - entities.Select(MapToGetListOutputDto).ToList() + entityDtos ); } + protected override async Task> MapToGetListOutputDtosAsync(List entities) + { + var dtos = await base.MapToGetListOutputDtosAsync(entities); + + await LoadRelatedUserInfoModelsAsync(dtos); + + return dtos; + } + + protected override async Task MapToGetOutputDtoAsync(File entity) + { + var dto = await base.MapToGetOutputDtoAsync(entity); + + await LoadRelatedUserInfoModelsAsync(new List { dto }); + + return dto; + } + + protected virtual async Task LoadRelatedUserInfoModelsAsync(IList dtos) + { + var userIds = dtos + .Where(x => x.CreatorId.HasValue) + .Select(x => x.CreatorId.Value) + .Distinct() + .Union(dtos + .Where(x => x.LastModifierId.HasValue) + .Select(x => x.LastModifierId.Value) + .Distinct()) + .Union(dtos + .Where(x => x.OwnerUserId.HasValue) + .Select(x => x.OwnerUserId.Value) + .Distinct()) + .ToList(); + + var users = new Dictionary(); + + foreach (var userId in userIds) + { + users[userId] = (await _fileUserLookupService.FindByIdAsync(userId)).ToBriefUserInfoModel(); + } + + foreach (var dto in dtos) + { + if (dto.CreatorId.HasValue) + { + dto.Creator = users[dto.CreatorId.Value]; + } + + if (dto.LastModifierId.HasValue) + { + dto.LastModifier = users[dto.LastModifierId.Value]; + } + + if (dto.OwnerUserId.HasValue) + { + dto.Owner = users[dto.OwnerUserId.Value]; + } + } + } + protected override IQueryable ApplySorting(IQueryable query, GetFileListInput input) { return input.Sorting.IsNullOrWhiteSpace() @@ -373,6 +443,20 @@ public virtual Task GetConfigurationAsync(stri return Task.FromResult(_configurationProvider.Get(fileContainerName).ToPublicConfiguration()); } + public virtual async Task GetLocationAsync(Guid id) + { + var file = await GetEntityByIdAsync(id); + + var location = await _fileManager.GetFileLocationAsync(file); + + return new FileLocationDto + { + Id = file.Id, + FileName = file.FileName, + Location = location + }; + } + protected virtual string GenerateUniqueFileName([CanBeNull] string fileName) { return Guid.NewGuid().ToString("N") + Path.GetExtension(fileName); diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp.FileManagement.Domain.Core.csproj b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp.FileManagement.Domain.Core.csproj index c716a6a..3948724 100644 --- a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp.FileManagement.Domain.Core.csproj +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp.FileManagement.Domain.Core.csproj @@ -16,6 +16,7 @@ + diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/FileManagementDomainCoreModule.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/FileManagementDomainCoreModule.cs index bcbbae2..d49f08a 100644 --- a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/FileManagementDomainCoreModule.cs +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/FileManagementDomainCoreModule.cs @@ -5,6 +5,7 @@ using Volo.Abp.Domain; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Modularity; +using Volo.Abp.Users; namespace EasyAbp.FileManagement { @@ -12,7 +13,8 @@ namespace EasyAbp.FileManagement typeof(FileManagementDomainSharedModule), typeof(AbpAutoMapperModule), typeof(AbpBackgroundJobsAbstractionsModule), - typeof(AbpDddDomainModule) + typeof(AbpDddDomainModule), + typeof(AbpUsersDomainModule) )] public class FileManagementDomainCoreModule : AbpModule { diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/FileManagerBase.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/FileManagerBase.cs index 699ff91..d1ec7e0 100644 --- a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/FileManagerBase.cs +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/FileManagerBase.cs @@ -37,6 +37,8 @@ public abstract Task> CreateManyAsync(List models, public abstract Task> CreateManyAsync(List models, CancellationToken cancellationToken = default); + public abstract Task GetFileLocationAsync(File file, CancellationToken cancellationToken = default); + protected abstract IFileDownloadProvider GetFileDownloadProvider(File file); public virtual async Task GetDownloadInfoAsync(File file) diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/IFileManager.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/IFileManager.cs index 732d1d5..480cc8c 100644 --- a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/IFileManager.cs +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Files/IFileManager.cs @@ -24,5 +24,7 @@ Task> CreateManyAsync(List models, Task DeleteAsync(File file, CancellationToken cancellationToken = default); Task GetDownloadInfoAsync(File file); + + Task GetFileLocationAsync(File file, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileManagementUserSynchronizer.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileManagementUserSynchronizer.cs new file mode 100644 index 0000000..bcfb32b --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileManagementUserSynchronizer.cs @@ -0,0 +1,43 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events.Distributed; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Uow; +using Volo.Abp.Users; + +namespace EasyAbp.FileManagement.Users; + +public class FileManagementUserSynchronizer : + IDistributedEventHandler>, + ITransientDependency +{ + protected IFileUserRepository UserRepository { get; } + protected IFileUserLookupService UserLookupService { get; } + + public FileManagementUserSynchronizer( + IFileUserRepository userRepository, + IFileUserLookupService userLookupService) + { + UserRepository = userRepository; + UserLookupService = userLookupService; + } + + [UnitOfWork] + public async Task HandleEventAsync(EntityUpdatedEto eventData) + { + var user = await UserRepository.FindAsync(eventData.Entity.Id); + if (user == null) + { + user = await UserLookupService.FindByIdAsync(eventData.Entity.Id); + if (user == null) + { + return; + } + } + + if (user.Update(eventData.Entity)) + { + await UserRepository.UpdateAsync(user); + } + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileUser.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileUser.cs new file mode 100644 index 0000000..4899c86 --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileUser.cs @@ -0,0 +1,92 @@ +using System; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Users; + +namespace EasyAbp.FileManagement.Users; + +public class FileUser : AggregateRoot, IUser, IUpdateUserData +{ + #region IUser + + public virtual Guid? TenantId { get; protected set; } + + public virtual string UserName { get; protected set; } + + public virtual string Email { get; protected set; } + + public virtual string Name { get; protected set; } + + public virtual string Surname { get; protected set; } + + public virtual bool IsActive { get; protected set; } + + public virtual bool EmailConfirmed { get; protected set; } + + public virtual string PhoneNumber { get; protected set; } + + public virtual bool PhoneNumberConfirmed { get; protected set; } + + #endregion + + protected FileUser() + { + } + + public FileUser(IUserData user) : base(user.Id) + { + TenantId = user.TenantId; + + UpdateInternal(user); + } + + public virtual bool Update(IUserData user) + { + if (Id != user.Id) + { + throw new ArgumentException($"Given User's Id '{user.Id}' does not match to this User's Id '{Id}'"); + } + + if (TenantId != user.TenantId) + { + throw new ArgumentException( + $"Given User's TenantId '{user.TenantId}' does not match to this User's TenantId '{TenantId}'"); + } + + if (Equals(user)) + { + return false; + } + + UpdateInternal(user); + return true; + } + + protected virtual bool Equals(IUserData user) + { + return Id == user.Id && + TenantId == user.TenantId && + UserName == user.UserName && + Name == user.Name && + Surname == user.Surname && + Email == user.Email && + EmailConfirmed == user.EmailConfirmed && + PhoneNumber == user.PhoneNumber && + PhoneNumberConfirmed == user.PhoneNumberConfirmed; + } + + protected virtual void UpdateInternal(IUserData user) + { + Email = user.Email; + Name = user.Name; + Surname = user.Surname; + EmailConfirmed = user.EmailConfirmed; + PhoneNumber = user.PhoneNumber; + PhoneNumberConfirmed = user.PhoneNumberConfirmed; + UserName = user.UserName; + } + + public virtual BriefFileUserInfoModel ToBriefUserInfoModel() + { + return new BriefFileUserInfoModel(Id, UserName); + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileUserLookupService.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileUserLookupService.cs new file mode 100644 index 0000000..993ccab --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/FileUserLookupService.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Uow; +using Volo.Abp.Users; + +namespace EasyAbp.FileManagement.Users; + +public class FileUserLookupService : UserLookupService, IFileUserLookupService +{ + public FileUserLookupService( + IFileUserRepository userRepository, + IUnitOfWorkManager unitOfWorkManager) + : base( + userRepository, + unitOfWorkManager) + { + + } + + protected override FileUser CreateUser(IUserData externalUser) + { + return new FileUser(externalUser); + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/IFileUserLookupService.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/IFileUserLookupService.cs new file mode 100644 index 0000000..ce28fa7 --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/IFileUserLookupService.cs @@ -0,0 +1,7 @@ +using Volo.Abp.Users; + +namespace EasyAbp.FileManagement.Users; + +public interface IFileUserLookupService : IUserLookupService +{ +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/IFileUserRepository.cs b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/IFileUserRepository.cs new file mode 100644 index 0000000..ab86b4a --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/Users/IFileUserRepository.cs @@ -0,0 +1,7 @@ +using Volo.Abp.Users; + +namespace EasyAbp.FileManagement.Users; + +public interface IFileUserRepository : IUserRepository +{ +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/FileManagementConsts.cs b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/FileManagementConsts.cs similarity index 100% rename from src/EasyAbp.FileManagement.Domain.Core/EasyAbp/FileManagement/FileManagementConsts.cs rename to src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/FileManagementConsts.cs diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/cs.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/cs.json deleted file mode 100644 index 9c244b1..0000000 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/cs.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "culture": "cs", - "texts": { - "Permission:File": "File", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:FileManagement": "File management", - "Menu:File": "File", - "File": "File", - "FileFileName": "File name", - "FileFileContainerName": "File container name", - "FileMimeType": "Mime type", - "FileFileType": "File type", - "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", - "FileHash": "Hash", - "FileParentId": "Parent ID", - "FileChildren": "Children", - "FileDisplayName": "Display name", - "FileOwnerUserId": "Owner user ID", - "CreateDirectory": "Create directory", - "UploadFile": "Upload", - "RenameFile": "Rename", - "MoveFile": "Move", - "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/en.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/en.json index f3e556f..098e4a7 100644 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/en.json +++ b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/en.json @@ -13,7 +13,7 @@ "FileMimeType": "Mime type", "FileFileType": "File type", "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", + "FileByteSize": "Size", "FileHash": "Hash", "FileParentId": "Parent ID", "FileChildren": "Children", @@ -24,6 +24,17 @@ "RenameFile": "Rename", "MoveFile": "Move", "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "LastModifier": "Modifier", + "LastModificationTime": "Modified", + "Creator": "Creator", + "CreationTime": "Created", + "Location": "Location", + "Enum:FileType.1": "Directory", + "Enum:FileType.2": "File", + "Details": "Details", + "Download": "Download", + "Rename": "Rename", + "Move": "Move" } } diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/pl-PL.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/pl-PL.json deleted file mode 100644 index d6c860d..0000000 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/pl-PL.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "culture": "pl-PL", - "texts": { - "Permission:File": "File", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:FileManagement": "File management", - "Menu:File": "File", - "File": "File", - "FileFileName": "File name", - "FileFileContainerName": "File container name", - "FileMimeType": "Mime type", - "FileFileType": "File type", - "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", - "FileHash": "Hash", - "FileParentId": "Parent ID", - "FileChildren": "Children", - "FileDisplayName": "Display name", - "FileOwnerUserId": "Owner user ID", - "CreateDirectory": "Create directory", - "UploadFile": "Upload", - "RenameFile": "Rename", - "MoveFile": "Move", - "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/pt-BR.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/pt-BR.json deleted file mode 100644 index 6b2ac88..0000000 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/pt-BR.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "culture": "pt-BR", - "texts": { - "Permission:File": "File", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:FileManagement": "File management", - "Menu:File": "File", - "File": "File", - "FileFileName": "File name", - "FileFileContainerName": "File container name", - "FileMimeType": "Mime type", - "FileFileType": "File type", - "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", - "FileHash": "Hash", - "FileParentId": "Parent ID", - "FileChildren": "Children", - "FileDisplayName": "Display name", - "FileOwnerUserId": "Owner user ID", - "CreateDirectory": "Create directory", - "UploadFile": "Upload", - "RenameFile": "Rename", - "MoveFile": "Move", - "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/sl.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/sl.json deleted file mode 100644 index b404ec3..0000000 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/sl.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "culture": "sl", - "texts": { - "Permission:File": "File", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:FileManagement": "File management", - "Menu:File": "File", - "File": "File", - "FileFileName": "File name", - "FileFileContainerName": "File container name", - "FileMimeType": "Mime type", - "FileFileType": "File type", - "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", - "FileHash": "Hash", - "FileParentId": "Parent ID", - "FileChildren": "Children", - "FileDisplayName": "Display name", - "FileOwnerUserId": "Owner user ID", - "CreateDirectory": "Create directory", - "UploadFile": "Upload", - "RenameFile": "Rename", - "MoveFile": "Move", - "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/tr.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/tr.json deleted file mode 100644 index a4a3e0e..0000000 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/tr.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "culture": "tr", - "texts": { - "Permission:File": "File", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:FileManagement": "File management", - "Menu:File": "File", - "File": "File", - "FileFileName": "File name", - "FileFileContainerName": "File container name", - "FileMimeType": "Mime type", - "FileFileType": "File type", - "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", - "FileHash": "Hash", - "FileParentId": "Parent ID", - "FileChildren": "Children", - "FileDisplayName": "Display name", - "FileOwnerUserId": "Owner user ID", - "CreateDirectory": "Create directory", - "UploadFile": "Upload", - "RenameFile": "Rename", - "MoveFile": "Move", - "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/vi.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/vi.json deleted file mode 100644 index aaf2779..0000000 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/vi.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "culture": "vi", - "texts": { - "Permission:File": "File", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Menu:FileManagement": "File management", - "Menu:File": "File", - "File": "File", - "FileFileName": "File name", - "FileFileContainerName": "File container name", - "FileMimeType": "Mime type", - "FileFileType": "File type", - "FileSubFilesQuantity": "Sub files quantity", - "FileByteSize": "Byte size", - "FileHash": "Hash", - "FileParentId": "Parent ID", - "FileChildren": "Children", - "FileDisplayName": "Display name", - "FileOwnerUserId": "Owner user ID", - "CreateDirectory": "Create directory", - "UploadFile": "Upload", - "RenameFile": "Rename", - "MoveFile": "Move", - "FileDeletionConfirmationMessage": "Are you sure to delete the file {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hans.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hans.json index e9d213b..5aaa5a8 100644 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hans.json +++ b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hans.json @@ -17,7 +17,7 @@ "FileMimeType": "Mime 类型", "FileFileType": "文件类型", "FileSubFilesQuantity": "子文件数量", - "FileByteSize": "文件大小", + "FileByteSize": "大小", "FileHash": "哈希值", "FileParentId": "父目录 ID", "FileChildren": "子目录", @@ -28,6 +28,17 @@ "RenameFile": "重命名", "MoveFile": "移动", "FileDeletionConfirmationMessage": "确认删除文件 {0}?", - "SuccessfullyDeleted": "删除成功" + "SuccessfullyDeleted": "删除成功", + "LastModifier": "修改人", + "LastModificationTime": "修改时间", + "Creator": "创建人", + "CreationTime": "创建时间", + "Location": "位置", + "Enum:FileType.1": "文件夹", + "Enum:FileType.2": "文件", + "Details": "详情", + "Download": "下载", + "Rename": "重命名", + "Move": "移动" } } diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hant.json b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hant.json index 43c585a..a5c517c 100644 --- a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hant.json +++ b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Localization/zh-Hant.json @@ -13,7 +13,7 @@ "FileMimeType": "Mime 類型", "FileFileType": "文件類型", "FileSubFilesQuantity": "子文件數量", - "FileByteSize": "文件大小", + "FileByteSize": "大小", "FileHash": "哈希值", "FileParentId": "父目錄 ID", "FileChildren": "子目錄", @@ -24,6 +24,17 @@ "RenameFile": "重命名", "MoveFile": "移動", "FileDeletionConfirmationMessage": "確認刪除文件 {0}?", - "SuccessfullyDeleted": "刪除成功" + "SuccessfullyDeleted": "刪除成功", + "LastModifier": "修改人", + "LastModificationTime": "修改時間", + "Creator": "創建人", + "CreationTime": "創建時間", + "Location": "位置", + "Enum:FileType.1": "文件夾", + "Enum:FileType.2": "文件", + "Details": "詳情", + "Download": "下載", + "Rename": "重新命名", + "Move": "移動" } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Users/BriefFileUserInfoModel.cs b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Users/BriefFileUserInfoModel.cs new file mode 100644 index 0000000..64e74f4 --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain.Shared/EasyAbp/FileManagement/Users/BriefFileUserInfoModel.cs @@ -0,0 +1,17 @@ +using System; + +namespace EasyAbp.FileManagement.Users; + +[Serializable] +public class BriefFileUserInfoModel +{ + public Guid Id { get; set; } + + public string UserName { get; set; } + + public BriefFileUserInfoModel(Guid id, string userName) + { + Id = id; + UserName = userName; + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileCreatedEventHandler.cs b/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileCreatedEventHandler.cs new file mode 100644 index 0000000..e451b30 --- /dev/null +++ b/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileCreatedEventHandler.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; + +namespace EasyAbp.FileManagement.Files; + +public class FileCreatedEventHandler : ILocalEventHandler>, ITransientDependency +{ + private readonly IFileRepository _repository; + + public FileCreatedEventHandler(IFileRepository repository) + { + _repository = repository; + } + + public virtual async Task HandleEventAsync(EntityCreatedEventData eventData) + { + // Update the entity to set the LastModificationTime property. + await _repository.UpdateAsync(eventData.Entity, true); + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileManager.cs b/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileManager.cs index e0c5e45..11e7f67 100644 --- a/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileManager.cs +++ b/src/EasyAbp.FileManagement.Domain/EasyAbp/FileManagement/Files/FileManager.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; using EasyAbp.FileManagement.Options; using EasyAbp.FileManagement.Options.Containers; -using JetBrains.Annotations; using Microsoft.Extensions.Options; using Volo.Abp; using Volo.Abp.ObjectExtending; @@ -166,6 +165,23 @@ public override async Task> CreateManyAsync(List GetFileLocationAsync(File file, + CancellationToken cancellationToken = default) + { + if (!file.ParentId.HasValue) + { + return file.FileName; + } + + var parent = await FileRepository.GetAsync(file.ParentId.Value, true, cancellationToken); + + var parentLocation = await GetFileLocationAsync(parent, cancellationToken); + + return parentLocation.IsNullOrEmpty() + ? file.FileName + : $"{parentLocation}{FileManagementConsts.DirectorySeparator}{file.FileName}"; + } + protected override IFileDownloadProvider GetFileDownloadProvider(File file) { var options = LazyServiceProvider.LazyGetRequiredService>().Value; diff --git a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp.FileManagement.EntityFrameworkCore.csproj b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp.FileManagement.EntityFrameworkCore.csproj index b9d15c4..15bc01d 100644 --- a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp.FileManagement.EntityFrameworkCore.csproj +++ b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp.FileManagement.EntityFrameworkCore.csproj @@ -9,11 +9,8 @@ + - - - - diff --git a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContext.cs b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContext.cs index 044e8cb..4ce660a 100644 --- a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContext.cs +++ b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContext.cs @@ -2,6 +2,7 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.FileManagement.Files; +using EasyAbp.FileManagement.Users; namespace EasyAbp.FileManagement.EntityFrameworkCore { @@ -12,6 +13,7 @@ public class FileManagementDbContext : AbpDbContext, IF * public DbSet Questions { get; set; } */ public DbSet Files { get; set; } + public DbSet FileUsers { get; set; } public FileManagementDbContext(DbContextOptions options) : base(options) diff --git a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs index 8ff9800..82c59ba 100644 --- a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs +++ b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementDbContextModelCreatingExtensions.cs @@ -1,8 +1,10 @@ using EasyAbp.FileManagement.Files; using System; +using EasyAbp.FileManagement.Users; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; +using Volo.Abp.Users.EntityFrameworkCore; namespace EasyAbp.FileManagement.EntityFrameworkCore { @@ -41,7 +43,6 @@ public static void ConfigureFileManagement( }); */ - builder.Entity(b => { b.ToTable(options.TablePrefix + "Files", options.Schema); @@ -54,6 +55,7 @@ public static void ConfigureFileManagement( b.Property(x => x.MimeType).HasMaxLength(FileManagementConsts.File.MimeTypeMaxLength); b.Property(x => x.Hash).HasMaxLength(FileManagementConsts.File.HashMaxLength); b.Property(x => x.Flag).HasMaxLength(FileManagementConsts.File.FlagMaxLength); + b.Property(x => x.SoftDeletionToken).HasDefaultValue(string.Empty); b.HasIndex(x => x.BlobName); b.HasIndex(x => x.Hash); b.HasIndex(x => new { x.ParentId, x.OwnerUserId, x.FileContainerName, x.FileName }); @@ -61,6 +63,14 @@ public static void ConfigureFileManagement( { x.FileName, x.ParentId, x.OwnerUserId, x.FileContainerName, x.TenantId, x.SoftDeletionToken }) .IsUnique().HasFilter(null); }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Users", options.Schema); + + b.ConfigureByConvention(); + b.ConfigureAbpUser(); + }); } } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs index 692a045..c604c21 100644 --- a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs +++ b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/FileManagementEntityFrameworkCoreModule.cs @@ -1,13 +1,16 @@ using EasyAbp.FileManagement.Files; +using EasyAbp.FileManagement.Users; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Modularity; +using Volo.Abp.Users.EntityFrameworkCore; namespace EasyAbp.FileManagement.EntityFrameworkCore { [DependsOn( typeof(FileManagementDomainCoreModule), - typeof(AbpEntityFrameworkCoreModule) + typeof(AbpEntityFrameworkCoreModule), + typeof(AbpUsersEntityFrameworkCoreModule) )] public class FileManagementEntityFrameworkCoreModule : AbpModule { @@ -19,6 +22,7 @@ public override void ConfigureServices(ServiceConfigurationContext context) * options.AddRepository(); */ options.AddRepository(); + options.AddRepository(); }); } } diff --git a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/IFileManagementDbContext.cs b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/IFileManagementDbContext.cs index cd014a1..9768fcc 100644 --- a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/IFileManagementDbContext.cs +++ b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/EntityFrameworkCore/IFileManagementDbContext.cs @@ -2,6 +2,7 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.FileManagement.Files; +using EasyAbp.FileManagement.Users; namespace EasyAbp.FileManagement.EntityFrameworkCore { @@ -12,5 +13,6 @@ public interface IFileManagementDbContext : IEfCoreDbContext * DbSet Questions { get; } */ DbSet Files { get; set; } + DbSet FileUsers { get; set; } } } diff --git a/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/Users/FileUserRepository.cs b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/Users/FileUserRepository.cs new file mode 100644 index 0000000..1787d72 --- /dev/null +++ b/src/EasyAbp.FileManagement.EntityFrameworkCore/EasyAbp/FileManagement/Users/FileUserRepository.cs @@ -0,0 +1,13 @@ +using EasyAbp.FileManagement.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Users.EntityFrameworkCore; + +namespace EasyAbp.FileManagement.Users; + +public class FileUserRepository : EfCoreUserRepositoryBase, IFileUserRepository +{ + public FileUserRepository(IDbContextProvider dbContextProvider) + : base(dbContextProvider) + { + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.HttpApi/EasyAbp/FileManagement/Files/FileController.cs b/src/EasyAbp.FileManagement.HttpApi/EasyAbp/FileManagement/Files/FileController.cs index 507240e..01d1661 100644 --- a/src/EasyAbp.FileManagement.HttpApi/EasyAbp/FileManagement/Files/FileController.cs +++ b/src/EasyAbp.FileManagement.HttpApi/EasyAbp/FileManagement/Files/FileController.cs @@ -62,11 +62,11 @@ public virtual async Task ActionCreateAsync([FromForm] CreateF } var fileName = input.GenerateUniqueFileName ? GenerateUniqueFileName(input.File) : input.File.FileName; - + await using var memoryStream = new MemoryStream(); - + await input.File.CopyToAsync(memoryStream); - + var createFileInput = new CreateFileInput { FileContainerName = input.FileContainerName, @@ -77,12 +77,12 @@ public virtual async Task ActionCreateAsync([FromForm] CreateF OwnerUserId = input.OwnerUserId, Content = memoryStream.ToArray() }; - + input.MapExtraPropertiesTo(createFileInput, MappingPropertyDefinitionChecks.None); return await _service.CreateAsync(createFileInput); } - + [HttpPost] [Route("many/with-bytes")] public virtual Task CreateManyAsync(CreateManyFileInput input) @@ -100,7 +100,8 @@ public virtual Task CreateManyWithStreamAsync(CreateManyFi [HttpPost] [Route("many")] [Consumes("multipart/form-data")] - public virtual async Task ActionCreateManyAsync([FromForm] CreateManyFileActionInput input) + public virtual async Task ActionCreateManyAsync( + [FromForm] CreateManyFileActionInput input) { if (input.Files.IsNullOrEmpty()) { @@ -108,13 +109,13 @@ public virtual async Task ActionCreateManyAsync([FromForm] } var createFileDtos = new List(); - + foreach (var file in input.Files) { var fileName = input.GenerateUniqueFileName ? GenerateUniqueFileName(file) : file.FileName; await using var memoryStream = new MemoryStream(); - + await file.CopyToAsync(memoryStream); createFileDtos.Add(new CreateFileInput @@ -128,12 +129,12 @@ public virtual async Task ActionCreateManyAsync([FromForm] Content = memoryStream.ToArray() }); } - + var createManyFileInput = new CreateManyFileInput { FileInfos = createFileDtos }; - + input.MapExtraPropertiesTo(createManyFileInput, MappingPropertyDefinitionChecks.None); return await _service.CreateManyAsync(createManyFileInput); @@ -193,7 +194,7 @@ public virtual async Task ActionDownloadAsync(Guid id, string tok var dto = await _service.DownloadAsync(id, token); var memoryStream = new MemoryStream(dto.Content); - + return new FileStreamResult(memoryStream, dto.MimeType) { FileDownloadName = dto.FileName @@ -207,5 +208,12 @@ public virtual async Task GetConfigurationAsyn { return await _service.GetConfigurationAsync(fileContainerName, ownerUserId); } + + [HttpGet] + [Route("location")] + public async Task GetLocationAsync(Guid id) + { + return await _service.GetLocationAsync(id); + } } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/Default.cshtml b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/Default.cshtml index 21a7e14..48771cb 100644 --- a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/Default.cshtml +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/Default.cshtml @@ -28,7 +28,7 @@ - @L["File"]: @Model.ParentFileName + @L["Location"]: @Model.FullPath @if (canCreateDirectory) @@ -55,6 +55,7 @@ @L["Actions"] @L["FileFileName"] @L["FileByteSize"] + @L["Modified"] diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/DetailModal.cshtml b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/DetailModal.cshtml new file mode 100644 index 0000000..3ffae54 --- /dev/null +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/DetailModal.cshtml @@ -0,0 +1,17 @@ +@page +@using EasyAbp.FileManagement.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.FileManagement.Web.Pages.FileManagement.Components.FileManagerWidget.DetailModalModel +@{ + Layout = null; +} + + + + + + + + diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/DetailModal.cshtml.cs b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/DetailModal.cshtml.cs new file mode 100644 index 0000000..aebbfaf --- /dev/null +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/DetailModal.cshtml.cs @@ -0,0 +1,73 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.FileManagement.Files; +using EasyAbp.FileManagement.Web.Pages.FileManagement.Components.FileManagerWidget.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.FileManagement.Web.Pages.FileManagement.Components.FileManagerWidget; + +public class DetailModalModel : FileManagementPageModel +{ + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public FileDetailViewModel ViewModel { get; set; } + + private readonly IFileAppService _service; + + public DetailModalModel(IFileAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = new FileDetailViewModel + { + FileName = dto.FileName, + FileType = dto.FileType, + MimeType = dto.MimeType, + ByteSize = HumanFileSize(dto.ByteSize), + Hash = dto.Hash, + Location = (await _service.GetLocationAsync(dto.Id)).Location, + Creator = dto.Creator?.UserName, + Created = dto.CreationTime, + LastModifier = dto.LastModifier?.UserName, + Modified = dto.LastModificationTime ?? dto.CreationTime + }; + } + + protected static string HumanFileSize(long bytes, bool si = false, int dp = 1) + { + var thresh = si ? 1000 : 1024; + + if (bytes == 0) + { + return "0 B"; + } + + if (Math.Abs(bytes) < thresh) + { + return bytes + " B"; + } + + var units = si + ? new string[] { "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" } + : new string[] { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB" }; + + var u = -1; + var b = bytes; + const double r = 10.0d; + + do + { + b /= thresh; + u++; + } while (Math.Round(Math.Abs(b) * r) / r >= thresh && u < units.Length - 1); + + return b.ToString("F" + dp) + " " + units[u]; + } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerViewModel.cs b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerViewModel.cs index 0acd13e..6b84d7f 100644 --- a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerViewModel.cs +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerViewModel.cs @@ -15,18 +15,18 @@ public class FileManagerViewModel public Guid? GrandparentId { get; set; } [CanBeNull] - public string ParentFileName { get; set; } // Todo: should be full path + public string FullPath { get; set; } public FileManagerPolicyModel Policy { get; set; } public FileManagerViewModel([NotNull] string fileContainerName, Guid? ownerUserId, Guid? parentId, - Guid? grandparentId, [CanBeNull] string parentFileName, [CanBeNull] FileManagerPolicyModel policy = null) + Guid? grandparentId, [CanBeNull] string fullPath, [CanBeNull] FileManagerPolicyModel policy = null) { FileContainerName = fileContainerName; OwnerUserId = ownerUserId; ParentId = parentId; GrandparentId = grandparentId; - ParentFileName = parentFileName; + FullPath = fullPath; Policy = policy ?? new FileManagerPolicyModel(); } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerWidgetViewComponent.cs b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerWidgetViewComponent.cs index 7ed39e9..0793d17 100644 --- a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerWidgetViewComponent.cs +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/FileManagerWidgetViewComponent.cs @@ -34,10 +34,10 @@ public virtual async Task InvokeAsync(string fileContainer } var dir = await _fileAppService.GetAsync(parentId.Value); + var location = (await _fileAppService.GetLocationAsync(dir.Id)).Location; return View( "~/Pages/FileManagement/Components/FileManagerWidget/Default.cshtml", - new FileManagerViewModel(dir.FileContainerName, dir.OwnerUserId, parentId, dir.ParentId, dir.FileName, - policy)); + new FileManagerViewModel(dir.FileContainerName, dir.OwnerUserId, parentId, dir.ParentId, location, policy)); } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/FileDetailViewModel.cs b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/FileDetailViewModel.cs new file mode 100644 index 0000000..61a430b --- /dev/null +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/FileDetailViewModel.cs @@ -0,0 +1,50 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.FileManagement.Files; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; + +namespace EasyAbp.FileManagement.Web.Pages.FileManagement.Components.FileManagerWidget.ViewModels; + +public class FileDetailViewModel +{ + [HiddenInput] + [Display(Name = "FileFileName")] + public string FileName { get; set; } + + [DisabledInput] + [Display(Name = "FileFileType")] + public FileType FileType { get; set; } + + [DisabledInput] + [Display(Name = "FileMimeType")] + public string MimeType { get; set; } + + [DisabledInput] + [Display(Name = "FileByteSize")] + public string ByteSize { get; set; } + + [DisabledInput] + [Display(Name = "FileHash")] + public string Hash { get; set; } + + [DisabledInput] + [Display(Name = "Location")] + public string Location { get; set; } + + [DisabledInput] + [Display(Name = "Creator")] + public string Creator { get; set; } + + [DisabledInput] + [Display(Name = "CreationTime")] + public DateTime Created { get; set; } + + [DisabledInput] + [Display(Name = "LastModifier")] + public string LastModifier { get; set; } + + [DisabledInput] + [Display(Name = "LastModificationTime")] + public DateTime Modified { get; set; } +} \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/MoveFileViewModel.cs b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/MoveFileViewModel.cs index e5d2ccf..dde41b3 100644 --- a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/MoveFileViewModel.cs +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/ViewModels/MoveFileViewModel.cs @@ -9,6 +9,6 @@ public class MoveFileViewModel public Guid? NewParentId { get; set; } [Required] - [Display(Name = "FileNewFileName")] + [Display(Name = "FileFileName")] public string NewFileName { get; set; } } \ No newline at end of file diff --git a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/default.js b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/default.js index 7e875be..4af42de 100644 --- a/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/default.js +++ b/src/EasyAbp.FileManagement.Web/Pages/FileManagement/Components/FileManagerWidget/default.js @@ -44,6 +44,7 @@ var uploadModal = new abp.ModalManager(abp.appPath + 'FileManagement/Components/FileManagerWidget/UploadModal'); var renameModal = new abp.ModalManager(abp.appPath + 'FileManagement/Components/FileManagerWidget/RenameModal'); var moveModal = new abp.ModalManager(abp.appPath + 'FileManagement/Components/FileManagerWidget/MoveModal'); + var detailModal = new abp.ModalManager(abp.appPath + 'FileManagement/Components/FileManagerWidget/DetailModal'); var dataTable = $widget.find('.file-table').DataTable(abp.libs.datatables.normalizeConfiguration({ processing: true, @@ -56,7 +57,7 @@ return {fileContainerName: fileContainerName, ownerUserId: ownerUserId, parentId: parentId}; }, function (result) { if (parentId) { - result.items.unshift({ id: grandparentId, fileName: "...", byteSize: null, fileType: 1 }) + result.items.unshift({ id: grandparentId, fileName: "[...]", byteSize: null, fileType: 1, lastModificationTime: null, creationTime: null }) } return { recordsTotal: result.totalCount, @@ -72,7 +73,7 @@ { text: l('Download'), visible: function (data) { - return data.fileType === 2 && canDownloadFile + return data.fileType === 2 && canDownloadFile && data.id !== grandparentId }, action: function (data) { easyAbp.fileManagement.files.file.getDownloadInfo(data.record.id, { @@ -89,7 +90,7 @@ { text: l('Rename'), visible: function (data) { - return data.fileType === 1 ? canRenameDirectory : canRenameFile + return (data.fileType === 1 ? canRenameDirectory : canRenameFile) && data.id !== grandparentId }, action: function (data) { renameModal.open({id: data.record.id}); @@ -98,7 +99,7 @@ { text: l('Move'), visible: function (data) { - return data.fileType === 1 ? canMoveDirectory : canMoveFile + return (data.fileType === 1 ? canMoveDirectory : canMoveFile) && data.id !== grandparentId }, action: function (data) { moveModal.open({id: data.record.id}); @@ -107,7 +108,7 @@ { text: l('Delete'), visible: function (data) { - return data.fileType === 1 ? canDeleteDirectory : canDeleteFile + return (data.fileType === 1 ? canDeleteDirectory : canDeleteFile) && data.id !== grandparentId }, confirmMessage: function (data) { return l('FileDeletionConfirmationMessage', data.record.id); @@ -119,7 +120,16 @@ dataTable.ajax.reload(); }); } - } + }, + { + text: l('Details'), + visible: function (data) { + return data.id !== grandparentId + }, + action: function (data) { + detailModal.open({id: data.record.id}); + } + }, ] } }, @@ -140,6 +150,12 @@ return humanFileSize(data, true); } }, + { + data: "lastModificationTime", + render: function (data, type, row) { + return row.lastModificationTime || row.creationTime + } + }, ] })); diff --git a/test/EasyAbp.FileManagement.Domain.Tests/Files/FileDomainTests.cs b/test/EasyAbp.FileManagement.Domain.Tests/Files/FileDomainTests.cs index a04c92e..0ea2aee 100644 --- a/test/EasyAbp.FileManagement.Domain.Tests/Files/FileDomainTests.cs +++ b/test/EasyAbp.FileManagement.Domain.Tests/Files/FileDomainTests.cs @@ -143,4 +143,13 @@ await Should.NotThrowAsync(() => files.ShouldContain(x => x.FileName == "dir" && x.SoftDeletionToken != string.Empty); } } + + [Fact] + public async Task Should_New_File_Have_LastModificationTime_Value() + { + var dir = await FileRepository.InsertAsync(new File(Guid.NewGuid(), null, null, + "test", "dir", null, FileType.Directory, 0, 0, null, null, null), true); + + dir.LastModificationTime.ShouldNotBeNull(); + } } \ No newline at end of file