From 1711e42e074019f9ef45a5e4221f08ebcd0035d6 Mon Sep 17 00:00:00 2001 From: sunpengfei <i@angelzzz.com> Date: 星期五, 08 八月 2025 17:39:26 +0800 Subject: [PATCH] fix:bug --- FlexJobApi.Core/Entities/Common/DictionaryData.cs | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/FlexJobApi.Core/Entities/Common/DictionaryData.cs b/FlexJobApi.Core/Entities/Common/DictionaryData.cs index 776160e..13f5c64 100644 --- a/FlexJobApi.Core/Entities/Common/DictionaryData.cs +++ b/FlexJobApi.Core/Entities/Common/DictionaryData.cs @@ -13,11 +13,11 @@ /// <summary> /// 瀛楀吀鏁版嵁 /// </summary> - public class DictionaryData : CommonEntity, IEntityTypeBuilder<DictionaryData> + public class DictionaryData : CommonEntity, IEntityTypeBuilder<DictionaryData>, ITreeData<DictionaryData>, IIsDisabled, IDbAuditLogIgnore { public DictionaryData() { - Childrens = []; + Children = []; } /// <summary> @@ -43,7 +43,7 @@ /// <summary> /// 涓嬬骇 /// </summary> - public List<DictionaryData> Childrens { get; set; } + public List<DictionaryData> Children { get; set; } /// <summary> /// 瀛楀吀璺緞 @@ -54,6 +54,7 @@ /// 缂栧彿 /// </summary> [MaxLength(128)] + [Required] public string Code { get; set; } /// <summary> @@ -87,10 +88,21 @@ /// </summary> public string Field5 { get; set; } + /// <summary> + /// 娣卞害 + /// </summary> + public int Deep { get; set; } + + /// <summary> + /// 鏄惁绂佺敤 + /// </summary> + public bool IsDisabled { get; set; } + public void Configure(EntityTypeBuilder<DictionaryData> entityBuilder, DbContext dbContext, Type dbContextLocator) { + entityBuilder.HasIndex(x => x.Code).IsUnique(); entityBuilder - .HasMany(x => x.Childrens) + .HasMany(x => x.Children) .WithOne(x => x.Parent) .HasForeignKey(x => x.ParentId) .OnDelete(DeleteBehavior.ClientSetNull); -- Gitblit v1.9.1