From 313c5cbe5c63fa07f78fa24d8cc33b75435a266f Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期四, 07 八月 2025 17:00:40 +0800 Subject: [PATCH] feat:字典优化 --- FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs | 159 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 107 insertions(+), 52 deletions(-) diff --git a/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs b/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs index b919251..a69c87f 100644 --- a/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs +++ b/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs @@ -135,6 +135,7 @@ .HasColumnType("uniqueidentifier"); b.Property<string>("Code") + .IsRequired() .HasMaxLength(128) .HasColumnType("nvarchar(128)"); @@ -147,6 +148,9 @@ b.Property<Guid?>("CreatedUserInfoId") .HasColumnType("uniqueidentifier"); + + b.Property<int>("Deep") + .HasColumnType("int"); b.Property<string>("Field1") .HasColumnType("nvarchar(max)"); @@ -191,6 +195,9 @@ b.HasIndex("CategoryId"); + b.HasIndex("Code") + .IsUnique(); + b.HasIndex("ParentId"); b.ToTable("DictionaryData"); @@ -212,8 +219,8 @@ b.Property<string>("BankName") .HasColumnType("nvarchar(max)"); - b.Property<Guid?>("CityId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("CityCode") + .HasColumnType("nvarchar(128)"); b.Property<string>("ContactEmail") .HasColumnType("nvarchar(max)"); @@ -235,8 +242,8 @@ b.Property<Guid>("EnterpriseAuthId") .HasColumnType("uniqueidentifier"); - b.Property<Guid?>("IndustryTypeId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("IndustryTypeCode") + .HasColumnType("nvarchar(128)"); b.Property<bool>("IsCheckedBankCard") .HasColumnType("bit"); @@ -253,8 +260,8 @@ b.Property<int?>("PayAccess") .HasColumnType("int"); - b.Property<Guid?>("ProvinceId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("ProvinceCode") + .HasColumnType("nvarchar(128)"); b.Property<int?>("RealAccess") .HasColumnType("int"); @@ -285,13 +292,13 @@ b.HasKey("Id"); - b.HasIndex("CityId"); + b.HasIndex("CityCode"); b.HasIndex("EnterpriseAuthId"); - b.HasIndex("IndustryTypeId"); + b.HasIndex("IndustryTypeCode"); - b.HasIndex("ProvinceId"); + b.HasIndex("ProvinceCode"); b.ToTable("Enterprise"); }); @@ -733,8 +740,11 @@ b.Property<int>("BillingMethod") .HasColumnType("int"); - b.Property<Guid>("CityId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("CityCode") + .HasColumnType("nvarchar(128)"); + + b.Property<string>("Code") + .HasColumnType("nvarchar(max)"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); @@ -758,6 +768,12 @@ .IsRequired() .HasColumnType("nvarchar(max)"); + b.Property<string>("ProvinceCode") + .HasColumnType("nvarchar(128)"); + + b.Property<int>("ReleaseStatus") + .HasColumnType("int"); + b.Property<decimal>("ServiceFee") .HasColumnType("decimal(18,2)"); @@ -765,6 +781,9 @@ .HasColumnType("int"); b.Property<int>("Sort") + .HasColumnType("int"); + + b.Property<int>("Status") .HasColumnType("int"); b.Property<string>("TraceId") @@ -778,9 +797,11 @@ b.HasKey("Id"); - b.HasIndex("CityId"); + b.HasIndex("CityCode"); b.HasIndex("EnterpriseId"); + + b.HasIndex("ProvinceCode"); b.ToTable("TaskInfo"); }); @@ -791,8 +812,9 @@ .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); - b.Property<Guid>("BenefitId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("BenefitCode") + .IsRequired() + .HasColumnType("nvarchar(128)"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); @@ -820,7 +842,7 @@ b.HasKey("Id"); - b.HasIndex("BenefitId"); + b.HasIndex("BenefitCode"); b.HasIndex("TaskInfoId"); @@ -851,8 +873,9 @@ b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); - b.Property<Guid?>("TypeId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("TypeCode") + .IsRequired() + .HasColumnType("nvarchar(128)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); @@ -864,7 +887,7 @@ b.HasIndex("TaskInfoId"); - b.HasIndex("TypeId"); + b.HasIndex("TypeCode"); b.ToTable("TaskInfoCredentialLimit"); }); @@ -1020,8 +1043,8 @@ b.Property<string>("Avatar") .HasColumnType("nvarchar(max)"); - b.Property<Guid?>("CityId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("CityCode") + .HasColumnType("nvarchar(128)"); b.Property<DateTimeOffset>("CreatedTime") .HasColumnType("datetimeoffset"); @@ -1029,8 +1052,8 @@ b.Property<Guid?>("CreatedUserInfoId") .HasColumnType("uniqueidentifier"); - b.Property<Guid?>("EducationalBackgroundId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("EducationalBackgroundCode") + .HasColumnType("nvarchar(128)"); b.Property<Guid?>("EnterpriseId") .HasColumnType("uniqueidentifier"); @@ -1050,11 +1073,11 @@ b.Property<int>("Level") .HasColumnType("int"); - b.Property<Guid?>("PersonalIdentityId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("PersonalIdentityCode") + .HasColumnType("nvarchar(128)"); - b.Property<Guid?>("ProvinceId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("ProvinceCode") + .HasColumnType("nvarchar(128)"); b.Property<string>("Remark") .HasColumnType("nvarchar(max)"); @@ -1095,15 +1118,15 @@ b.HasKey("Id"); - b.HasIndex("CityId"); + b.HasIndex("CityCode"); - b.HasIndex("EducationalBackgroundId"); + b.HasIndex("EducationalBackgroundCode"); b.HasIndex("EnterpriseId"); - b.HasIndex("PersonalIdentityId"); + b.HasIndex("PersonalIdentityCode"); - b.HasIndex("ProvinceId"); + b.HasIndex("ProvinceCode"); b.HasIndex("UserAuthId"); @@ -1219,8 +1242,9 @@ b.Property<string>("TraceId") .HasColumnType("nvarchar(max)"); - b.Property<Guid?>("TypeId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("TypeCode") + .IsRequired() + .HasColumnType("nvarchar(128)"); b.Property<DateTimeOffset?>("UpdatedTime") .HasColumnType("datetimeoffset"); @@ -1233,7 +1257,7 @@ b.HasKey("Id"); - b.HasIndex("TypeId"); + b.HasIndex("TypeCode"); b.HasIndex("UserInfoId"); @@ -1297,8 +1321,9 @@ b.Property<bool>("IsDeleted") .HasColumnType("bit"); - b.Property<Guid>("PersonalIdentityId") - .HasColumnType("uniqueidentifier"); + b.Property<string>("PersonalIdentityCode") + .IsRequired() + .HasColumnType("nvarchar(128)"); b.Property<int>("Sort") .HasColumnType("int"); @@ -1317,7 +1342,7 @@ b.HasKey("Id"); - b.HasIndex("PersonalIdentityId"); + b.HasIndex("PersonalIdentityCode"); b.HasIndex("UserInfoId"); @@ -1444,7 +1469,9 @@ { b.HasOne("FlexJobApi.Core.DictionaryData", "City") .WithMany() - .HasForeignKey("CityId"); + .HasForeignKey("CityCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.EnterpriseAuth", "EnterpriseAuth") .WithMany() @@ -1454,11 +1481,15 @@ b.HasOne("FlexJobApi.Core.DictionaryData", "IndustryType") .WithMany() - .HasForeignKey("IndustryTypeId"); + .HasForeignKey("IndustryTypeCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.DictionaryData", "Province") .WithMany() - .HasForeignKey("ProvinceId"); + .HasForeignKey("ProvinceCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.Navigation("City"); @@ -1520,9 +1551,9 @@ { b.HasOne("FlexJobApi.Core.DictionaryData", "City") .WithMany() - .HasForeignKey("CityId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + .HasForeignKey("CityCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.Enterprise", "Enterprise") .WithMany() @@ -1530,17 +1561,26 @@ .OnDelete(DeleteBehavior.Cascade) .IsRequired(); + b.HasOne("FlexJobApi.Core.DictionaryData", "Province") + .WithMany() + .HasForeignKey("ProvinceCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); + b.Navigation("City"); b.Navigation("Enterprise"); + + b.Navigation("Province"); }); modelBuilder.Entity("FlexJobApi.Core.TaskInfoBenefit", b => { b.HasOne("FlexJobApi.Core.DictionaryData", "Benefit") .WithMany() - .HasForeignKey("BenefitId") - .OnDelete(DeleteBehavior.Cascade) + .HasForeignKey("BenefitCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("FlexJobApi.Core.TaskInfo", "TaskInfo") @@ -1564,7 +1604,10 @@ b.HasOne("FlexJobApi.Core.DictionaryData", "Type") .WithMany() - .HasForeignKey("TypeId"); + .HasForeignKey("TypeCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.Navigation("TaskInfo"); @@ -1594,11 +1637,15 @@ { b.HasOne("FlexJobApi.Core.DictionaryData", "City") .WithMany() - .HasForeignKey("CityId"); + .HasForeignKey("CityCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.DictionaryData", "EducationalBackground") .WithMany() - .HasForeignKey("EducationalBackgroundId"); + .HasForeignKey("EducationalBackgroundCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.Enterprise", "Enterprise") .WithMany("UserInfos") @@ -1606,11 +1653,15 @@ b.HasOne("FlexJobApi.Core.DictionaryData", "PersonalIdentity") .WithMany() - .HasForeignKey("PersonalIdentityId"); + .HasForeignKey("PersonalIdentityCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.DictionaryData", "Province") .WithMany() - .HasForeignKey("ProvinceId"); + .HasForeignKey("ProvinceCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict); b.HasOne("FlexJobApi.Core.UserAuth", "UserAuth") .WithMany("UserInfos") @@ -1646,7 +1697,10 @@ { b.HasOne("FlexJobApi.Core.DictionaryData", "Type") .WithMany() - .HasForeignKey("TypeId"); + .HasForeignKey("TypeCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.HasOne("FlexJobApi.Core.UserInfo", "UserInfo") .WithMany("UserInfoCredentials") @@ -1682,8 +1736,9 @@ { b.HasOne("FlexJobApi.Core.DictionaryData", "PersonalIdentity") .WithMany() - .HasForeignKey("PersonalIdentityId") - .OnDelete(DeleteBehavior.Cascade) + .HasForeignKey("PersonalIdentityCode") + .HasPrincipalKey("Code") + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("FlexJobApi.Core.UserInfo", "UserInfo") -- Gitblit v1.9.1