From b9b4c926a7898d8b7d657e75ec83064390a5f9fb Mon Sep 17 00:00:00 2001
From: sunpengfei <i@angelzzz.com>
Date: 星期一, 04 八月 2025 17:35:54 +0800
Subject: [PATCH] pref:childrens命名修改

---
 FlexJobApi.User.Application/Menus/Commands/SaveMenuCommandHandler.cs       |   14 +++---
 FlexJobApi.Core/Entities/Common/DictionaryData.cs                          |    6 +-
 FlexJobApi.Core/FlexJobApi.Core.xml                                        |    6 +-
 FlexJobApi.Core/Entities/Users/Department.cs                               |    6 +-
 FlexJobApi.User.Application/Menus/Commands/DeleteMenuCommandHandler.cs     |    4 +-
 FlexJobApi.Core/Entities/Users/Menu.cs                                     |    6 +-
 FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs |   46 +++++++++++-----------
 7 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/FlexJobApi.Core/Entities/Common/DictionaryData.cs b/FlexJobApi.Core/Entities/Common/DictionaryData.cs
index 776160e..a7583f9 100644
--- a/FlexJobApi.Core/Entities/Common/DictionaryData.cs
+++ b/FlexJobApi.Core/Entities/Common/DictionaryData.cs
@@ -17,7 +17,7 @@
     {
         public DictionaryData()
         {
-            Childrens = [];
+            Children = [];
         }
 
         /// <summary>
@@ -43,7 +43,7 @@
         /// <summary>
         /// 涓嬬骇
         /// </summary>
-        public List<DictionaryData> Childrens { get; set; }
+        public List<DictionaryData> Children { get; set; }
 
         /// <summary>
         /// 瀛楀吀璺緞
@@ -90,7 +90,7 @@
         public void Configure(EntityTypeBuilder<DictionaryData> entityBuilder, DbContext dbContext, Type dbContextLocator)
         {
             entityBuilder
-                .HasMany(x => x.Childrens)
+                .HasMany(x => x.Children)
                 .WithOne(x => x.Parent)
                 .HasForeignKey(x => x.ParentId)
                 .OnDelete(DeleteBehavior.ClientSetNull);
diff --git a/FlexJobApi.Core/Entities/Users/Department.cs b/FlexJobApi.Core/Entities/Users/Department.cs
index 3dcfe6a..31178f4 100644
--- a/FlexJobApi.Core/Entities/Users/Department.cs
+++ b/FlexJobApi.Core/Entities/Users/Department.cs
@@ -17,7 +17,7 @@
     {
         public Department()
         {
-            Childrens = [];
+            Children = [];
         }
 
         /// <summary>
@@ -33,7 +33,7 @@
         /// <summary>
         /// 涓嬬骇
         /// </summary>
-        public List<Department> Childrens { get; set; }
+        public List<Department> Children { get; set; }
 
         /// <summary>
         /// 閮ㄩ棬璺緞
@@ -69,7 +69,7 @@
         public void Configure(EntityTypeBuilder<Department> entityBuilder, DbContext dbContext, Type dbContextLocator)
         {
             entityBuilder
-                .HasMany(x => x.Childrens)
+                .HasMany(x => x.Children)
                 .WithOne(x => x.Parent)
                 .HasForeignKey(x => x.ParentId)
                 .OnDelete(DeleteBehavior.ClientSetNull);
diff --git a/FlexJobApi.Core/Entities/Users/Menu.cs b/FlexJobApi.Core/Entities/Users/Menu.cs
index 83ed779..6012d3f 100644
--- a/FlexJobApi.Core/Entities/Users/Menu.cs
+++ b/FlexJobApi.Core/Entities/Users/Menu.cs
@@ -17,7 +17,7 @@
     {
         public Menu()
         {
-            Childrens = [];
+            Children = [];
         }
 
         /// <summary>
@@ -43,7 +43,7 @@
         /// <summary>
         /// 涓嬬骇
         /// </summary>
-        public List<Menu> Childrens { get; set; }
+        public List<Menu> Children { get; set; }
 
         /// <summary>
         /// 鑿滃崟璺緞
@@ -116,7 +116,7 @@
         public void Configure(EntityTypeBuilder<Menu> entityBuilder, DbContext dbContext, Type dbContextLocator)
         {
             entityBuilder
-                .HasMany(x => x.Childrens)
+                .HasMany(x => x.Children)
                 .WithOne(x => x.Parent)
                 .HasForeignKey(x => x.ParentId)
                 .OnDelete(DeleteBehavior.ClientSetNull);
diff --git a/FlexJobApi.Core/FlexJobApi.Core.xml b/FlexJobApi.Core/FlexJobApi.Core.xml
index 1e1b07a..99f0bef 100644
--- a/FlexJobApi.Core/FlexJobApi.Core.xml
+++ b/FlexJobApi.Core/FlexJobApi.Core.xml
@@ -104,7 +104,7 @@
             涓婄骇
             </summary>
         </member>
-        <member name="P:FlexJobApi.Core.DictionaryData.Childrens">
+        <member name="P:FlexJobApi.Core.DictionaryData.Children">
             <summary>
             涓嬬骇
             </summary>
@@ -669,7 +669,7 @@
             涓婄骇
             </summary>
         </member>
-        <member name="P:FlexJobApi.Core.Department.Childrens">
+        <member name="P:FlexJobApi.Core.Department.Children">
             <summary>
             涓嬬骇
             </summary>
@@ -844,7 +844,7 @@
             涓婄骇
             </summary>
         </member>
-        <member name="P:FlexJobApi.Core.Menu.Childrens">
+        <member name="P:FlexJobApi.Core.Menu.Children">
             <summary>
             涓嬬骇
             </summary>
diff --git a/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs b/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs
index 8ec9cca..f9ecf14 100644
--- a/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs
+++ b/FlexJobApi.Database.Migrations/Migrations/DefaultDbContextModelSnapshot.cs
@@ -85,7 +85,7 @@
 
                     b.HasIndex("ParentId");
 
-                    b.ToTable("Department", t =>
+                    b.ToTable("Department", null, t =>
                         {
                             t.HasComment("閮ㄩ棬");
                         });
@@ -141,7 +141,7 @@
 
                     b.HasKey("Id");
 
-                    b.ToTable("DictionaryCategory", t =>
+                    b.ToTable("DictionaryCategory", null, t =>
                         {
                             t.HasComment("瀛楀吀绫诲埆");
                         });
@@ -227,7 +227,7 @@
 
                     b.HasIndex("ParentId");
 
-                    b.ToTable("DictionaryData", t =>
+                    b.ToTable("DictionaryData", null, t =>
                         {
                             t.HasComment("瀛楀吀鏁版嵁");
                         });
@@ -350,7 +350,7 @@
 
                     b.HasIndex("LicenseImageId");
 
-                    b.ToTable("Enterprise", t =>
+                    b.ToTable("Enterprise", null, t =>
                         {
                             t.HasComment("浼佷笟");
                         });
@@ -441,7 +441,7 @@
 
                     b.HasKey("Id");
 
-                    b.ToTable("FileStore", t =>
+                    b.ToTable("FileStore", null, t =>
                         {
                             t.HasComment("鏂囦欢瀛樺偍");
                         });
@@ -497,7 +497,7 @@
 
                     b.HasIndex("StoreId");
 
-                    b.ToTable("FileVirtualPath", t =>
+                    b.ToTable("FileVirtualPath", null, t =>
                         {
                             t.HasComment("鏂囦欢铏氭嫙璺緞");
                         });
@@ -606,7 +606,7 @@
 
                     b.HasIndex("ParentId");
 
-                    b.ToTable("Menu", t =>
+                    b.ToTable("Menu", null, t =>
                         {
                             t.HasComment("鑿滃崟");
                         });
@@ -684,7 +684,7 @@
 
                     b.HasKey("Id");
 
-                    b.ToTable("Resource", t =>
+                    b.ToTable("Resource", null, t =>
                         {
                             t.HasComment("璧勬簮");
                         });
@@ -742,7 +742,7 @@
 
                     b.HasKey("Id");
 
-                    b.ToTable("Role", t =>
+                    b.ToTable("Role", null, t =>
                         {
                             t.HasComment("瑙掕壊");
                         });
@@ -794,7 +794,7 @@
 
                     b.HasIndex("RoleId");
 
-                    b.ToTable("RoleMenu", t =>
+                    b.ToTable("RoleMenu", null, t =>
                         {
                             t.HasComment("瑙掕壊鑿滃崟");
                         });
@@ -850,7 +850,7 @@
 
                     b.HasIndex("RoleId");
 
-                    b.ToTable("RoleResource", t =>
+                    b.ToTable("RoleResource", null, t =>
                         {
                             t.HasComment("瑙掕壊璧勬簮");
                         });
@@ -943,7 +943,7 @@
 
                     b.HasIndex("EnterpriseId");
 
-                    b.ToTable("TaskInfo", t =>
+                    b.ToTable("TaskInfo", null, t =>
                         {
                             t.HasComment("浠诲姟淇℃伅");
                         });
@@ -998,7 +998,7 @@
 
                     b.HasIndex("BenefitId1");
 
-                    b.ToTable("TaskInfoBenefit", t =>
+                    b.ToTable("TaskInfoBenefit", null, t =>
                         {
                             t.HasComment("浠诲姟绂忓埄");
                         });
@@ -1050,7 +1050,7 @@
 
                     b.HasIndex("TypeId");
 
-                    b.ToTable("TaskInfoCredentialLimit");
+                    b.ToTable("TaskInfoCredentialLimit", (string)null);
                 });
 
             modelBuilder.Entity("FlexJobApi.Core.TaskInfoUser", b =>
@@ -1115,7 +1115,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("TaskInfoUser", t =>
+                    b.ToTable("TaskInfoUser", null, t =>
                         {
                             t.HasComment("浠诲姟鐢ㄦ埛淇℃伅");
                         });
@@ -1221,7 +1221,7 @@
 
                     b.HasIndex("IdentityImgId");
 
-                    b.ToTable("UserAuth", t =>
+                    b.ToTable("UserAuth", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛");
                         });
@@ -1342,7 +1342,7 @@
 
                     b.HasIndex("UserAuthId");
 
-                    b.ToTable("UserInfo", t =>
+                    b.ToTable("UserInfo", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛淇℃伅");
                         });
@@ -1418,7 +1418,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("UserInfoBankCard", t =>
+                    b.ToTable("UserInfoBankCard", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛閾惰鍗′俊鎭�");
                         });
@@ -1504,7 +1504,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("UserInfoCredential", t =>
+                    b.ToTable("UserInfoCredential", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛淇℃伅璧勬牸璇佷功");
                         });
@@ -1556,7 +1556,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("UserInfoDepartment", t =>
+                    b.ToTable("UserInfoDepartment", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛淇℃伅閮ㄩ棬");
                         });
@@ -1608,7 +1608,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("UserInfoExpectJob", t =>
+                    b.ToTable("UserInfoExpectJob", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛淇℃伅鏈熸湜宀椾綅");
                         });
@@ -1660,7 +1660,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("UserInfoPhoto", t =>
+                    b.ToTable("UserInfoPhoto", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛淇℃伅鐢熸椿鐓�");
                         });
@@ -1712,7 +1712,7 @@
 
                     b.HasIndex("UserInfoId");
 
-                    b.ToTable("UserInfoRole", t =>
+                    b.ToTable("UserInfoRole", null, t =>
                         {
                             t.HasComment("鐢ㄦ埛淇℃伅瑙掕壊");
                         });
diff --git a/FlexJobApi.User.Application/Menus/Commands/DeleteMenuCommandHandler.cs b/FlexJobApi.User.Application/Menus/Commands/DeleteMenuCommandHandler.cs
index 057ec86..91b5cb4 100644
--- a/FlexJobApi.User.Application/Menus/Commands/DeleteMenuCommandHandler.cs
+++ b/FlexJobApi.User.Application/Menus/Commands/DeleteMenuCommandHandler.cs
@@ -25,11 +25,11 @@
         public async Task<int> Handle(DeleteMenuCommand request, CancellationToken cancellationToken)
         {
             var entities = await rep.AsQueryable()
-                .Include(it => it.Childrens)
+                .Include(it => it.Children)
                 .Where(it => request.Ids.Contains(it.Id))
                 .ToListAsync(cancellationToken);
             return entities.Any()
-                ? await rep.DeleteNowAsync(entities.Union(entities.SelectMany(it => it.Childrens)), cancellationToken)
+                ? await rep.DeleteNowAsync(entities.Union(entities.SelectMany(it => it.Children)), cancellationToken)
                 : 0;
         }
     }
diff --git a/FlexJobApi.User.Application/Menus/Commands/SaveMenuCommandHandler.cs b/FlexJobApi.User.Application/Menus/Commands/SaveMenuCommandHandler.cs
index 6a2f5cc..a7f7c2a 100644
--- a/FlexJobApi.User.Application/Menus/Commands/SaveMenuCommandHandler.cs
+++ b/FlexJobApi.User.Application/Menus/Commands/SaveMenuCommandHandler.cs
@@ -32,7 +32,7 @@
             if (request.Id.HasValue)
             {
                 var entity = await rep.AsQueryable()
-                    .Include(it => it.Childrens)
+                    .Include(it => it.Children)
                     .FirstOrDefaultAsync(it => it.Id == request.Id, cancellationToken);
                 if (entity == null) throw Oops.Oh(EnumErrorCodeType.s404, "鑿滃崟");
                 if (entity.UserType != request.UserType) throw Oops.Oh(EnumErrorCodeType.s410, "鐢ㄦ埛绫诲瀷");
@@ -71,7 +71,7 @@
             // 鑾峰彇瀛愰泦Id
             var childrenIds = GetRequestChildrenIds(request);
             // 鍒犻櫎瀛愮骇
-            entity.Childrens = entity.Childrens
+            entity.Children = entity.Children
                 .Where(it => 
                     it.Type == EnumMenuType.Menu 
                     || it.Type == EnumMenuType.Page 
@@ -89,7 +89,7 @@
                     // 閬嶅巻鎸夐挳 娣诲姞鎴栨洿鏂�
                     foreach (var button in buttonLocation.Buttons)
                     {
-                        var buttonEntity = entity.Childrens.FirstOrDefault(it => it.Id == button.Id);
+                        var buttonEntity = entity.Children.FirstOrDefault(it => it.Id == button.Id);
                         if (buttonEntity == null)
                         {
                             if (button.Id.HasValue) throw Oops.Oh(EnumErrorCodeType.s404, $"褰撳墠鍒嗙粍{group.Group}-浣嶇疆{buttonLocation.Location}-鎸夐挳{button.Code}");
@@ -99,7 +99,7 @@
                                 ClientType = entity.ClientType,
                                 Type = EnumMenuType.Button,
                             };
-                            entity.Childrens.Add(buttonEntity);
+                            entity.Children.Add(buttonEntity);
                         }
                         else if (buttonEntity.Type != EnumMenuType.Button) throw Oops.Oh(EnumErrorCodeType.s400, $"褰撳墠鍒嗙粍{group.Group}-瀛楁{button.Code}骞堕潪涓�涓寜閽�");
                         buttonEntity.Path = $"{entity.Path}{entity.Code}/";
@@ -112,7 +112,7 @@
                 // 閬嶅巻瀛楁 娣诲姞鎴栨洿鏂�
                 foreach (var field in group.Fields)
                 {
-                    var fieldEntity = entity.Childrens.FirstOrDefault(it => it.Id == field.Id);
+                    var fieldEntity = entity.Children.FirstOrDefault(it => it.Id == field.Id);
                     if (fieldEntity == null)
                     {
                         if (field.Id.HasValue) throw Oops.Oh(EnumErrorCodeType.s404, $"褰撳墠鍒嗙粍{group.Group}-瀛楁{field.Code}");
@@ -122,7 +122,7 @@
                             ClientType = entity.ClientType,
                             Type = EnumMenuType.Field,
                         };
-                        entity.Childrens.Add(fieldEntity);
+                        entity.Children.Add(fieldEntity);
                     }
                     else if (fieldEntity.Type != EnumMenuType.Field) throw Oops.Oh(EnumErrorCodeType.s400, $"褰撳墠鍒嗙粍{group.Group}-浣嶇疆{fieldEntity.Location}-鎸夐挳{fieldEntity.Code}骞堕潪涓�涓瓧娈�");
                     fieldEntity.Path = $"{entity.Path}{entity.Code}/";
@@ -139,7 +139,7 @@
         /// <param name="entity"></param>
         private void CheckRepeatChildrens(Menu entity)
         {
-            var repeats = entity.Childrens
+            var repeats = entity.Children
                 .GroupBy(it =>
                 {
                     return it.Type == EnumMenuType.Button

--
Gitblit v1.9.1