0
0
zhontai 2 gadi atpakaļ
vecāks
revīzija
fea1f6af58
100 mainītis faili ar 3296 papildinājumiem un 5984 dzēšanām
  1. 0 70
      src/hosts/ZhonTai.Host/InitData/Admin/ad_api.json
  2. 1 3
      src/hosts/ZhonTai.Host/InitData/Admin/ad_employee.json
  3. 1 3
      src/hosts/ZhonTai.Host/InitData/Admin/ad_employee.tenant.json
  4. 57 202
      src/hosts/ZhonTai.Host/InitData/Admin/ad_permission.json
  5. 4 4
      src/hosts/ZhonTai.Host/InitData/Admin/ad_role.json
  6. 11 11
      src/hosts/ZhonTai.Host/InitData/Admin/ad_role.tenant.json
  7. 1 1365
      src/hosts/ZhonTai.Host/InitData/Admin/ad_role_permission.json
  8. 1 1020
      src/hosts/ZhonTai.Host/InitData/Admin/ad_tenant_permission.json
  9. 2 2
      src/hosts/ZhonTai.Host/InitData/Admin/ad_user.json
  10. 2 2
      src/hosts/ZhonTai.Host/InitData/Admin/ad_user.tenant.json
  11. 10 41
      src/hosts/ZhonTai.Host/InitData/Admin/ad_view.json
  12. 30 2
      src/hosts/ZhonTai.Host/Program.cs
  13. 23 24
      src/platform/ZhonTai.Admin/Core/Aop/AopHelper.cs
  14. 7 8
      src/platform/ZhonTai.Admin/Core/Attributes/LoginAttribute.cs
  15. 7 8
      src/platform/ZhonTai.Admin/Core/Attributes/NoOprationLogAttribute.cs
  16. 4 5
      src/platform/ZhonTai.Admin/Core/Attributes/ScanCacheKeysAttribute.cs
  17. 4 5
      src/platform/ZhonTai.Admin/Core/Attributes/ScanTaskNamesAttribute.cs
  18. 4 5
      src/platform/ZhonTai.Admin/Core/Attributes/ServerTimeAttribute.cs
  19. 7 8
      src/platform/ZhonTai.Admin/Core/Attributes/SingleInstanceAttribute.cs
  20. 5 6
      src/platform/ZhonTai.Admin/Core/Attributes/SnowflakeAttribute.cs
  21. 13 14
      src/platform/ZhonTai.Admin/Core/Attributes/TransactionAttribute.cs
  22. 27 28
      src/platform/ZhonTai.Admin/Core/Attributes/ValidateInputAttribute.cs
  23. 37 38
      src/platform/ZhonTai.Admin/Core/Attributes/ValidatePermissionAttribute.cs
  24. 12 13
      src/platform/ZhonTai.Admin/Core/Attributes/VersionRouteAttribute.cs
  25. 32 33
      src/platform/ZhonTai.Admin/Core/Auth/ClaimAttributes.cs
  26. 11 12
      src/platform/ZhonTai.Admin/Core/Auth/IPermissionHandler.cs
  27. 28 29
      src/platform/ZhonTai.Admin/Core/Auth/IUser.cs
  28. 5 6
      src/platform/ZhonTai.Admin/Core/Auth/IUserToken.cs
  29. 1 1
      src/platform/ZhonTai.Admin/Core/Auth/PermissionHandler.cs
  30. 52 53
      src/platform/ZhonTai.Admin/Core/Auth/ResponseAuthenticationHandler.cs
  31. 79 80
      src/platform/ZhonTai.Admin/Core/Auth/User.cs
  32. 30 31
      src/platform/ZhonTai.Admin/Core/Auth/UserToken.cs
  33. 10 11
      src/platform/ZhonTai.Admin/Core/BaseController.cs
  34. 197 198
      src/platform/ZhonTai.Admin/Core/Configs/AppConfig.cs
  35. 81 82
      src/platform/ZhonTai.Admin/Core/Configs/DbConfig.cs
  36. 24 25
      src/platform/ZhonTai.Admin/Core/Configs/JwtConfig.cs
  37. 57 58
      src/platform/ZhonTai.Admin/Core/Configs/UploadConfig.cs
  38. 19 20
      src/platform/ZhonTai.Admin/Core/Consts/AdminConsts.cs
  39. 30 31
      src/platform/ZhonTai.Admin/Core/Consts/CacheKeys.cs
  40. 117 118
      src/platform/ZhonTai.Admin/Core/Db/DBServiceCollectionExtensions.cs
  41. 273 274
      src/platform/ZhonTai.Admin/Core/Db/DbHelper.cs
  42. 4 5
      src/platform/ZhonTai.Admin/Core/Db/DbUnitOfWorkManager.cs
  43. 12 13
      src/platform/ZhonTai.Admin/Core/Db/GenerateData.cs
  44. 7 8
      src/platform/ZhonTai.Admin/Core/Db/IGenerateData.cs
  45. 7 8
      src/platform/ZhonTai.Admin/Core/Db/ISyncData.cs
  46. 113 114
      src/platform/ZhonTai.Admin/Core/Db/IdleBusExtesions.cs
  47. 15 16
      src/platform/ZhonTai.Admin/Core/Db/PropsContractResolver.cs
  48. 87 88
      src/platform/ZhonTai.Admin/Core/Db/SyncData.cs
  49. 105 106
      src/platform/ZhonTai.Admin/Core/Db/TransactionAsyncInterceptor.cs
  50. 11 12
      src/platform/ZhonTai.Admin/Core/Db/TransactionInterceptor.cs
  51. 6 7
      src/platform/ZhonTai.Admin/Core/Dbs/MySqlDb.cs
  52. 16 17
      src/platform/ZhonTai.Admin/Core/Dto/CreateFreeSqlTenantDto.cs
  53. 25 26
      src/platform/ZhonTai.Admin/Core/Dto/IResultOutput.cs
  54. 25 26
      src/platform/ZhonTai.Admin/Core/Dto/PageInput.cs
  55. 12 13
      src/platform/ZhonTai.Admin/Core/Dto/PageOutput.cs
  56. 101 102
      src/platform/ZhonTai.Admin/Core/Dto/ResultOutput.cs
  57. 24 25
      src/platform/ZhonTai.Admin/Core/Entities/DataIsolationType.cs
  58. 23 24
      src/platform/ZhonTai.Admin/Core/Entities/Entity.cs
  59. 25 26
      src/platform/ZhonTai.Admin/Core/Entities/EntityAdd.cs
  60. 57 58
      src/platform/ZhonTai.Admin/Core/Entities/EntityFull.cs
  61. 13 14
      src/platform/ZhonTai.Admin/Core/Entities/EntitySoftDelete.cs
  62. 25 26
      src/platform/ZhonTai.Admin/Core/Entities/EntityUpdate.cs
  63. 13 14
      src/platform/ZhonTai.Admin/Core/Entities/EntityVersion.cs
  64. 6 7
      src/platform/ZhonTai.Admin/Core/Entities/IEntityAdd.cs
  65. 7 8
      src/platform/ZhonTai.Admin/Core/Entities/IEntitySoftDelete.cs
  66. 6 7
      src/platform/ZhonTai.Admin/Core/Entities/IEntityUpdate.cs
  67. 7 8
      src/platform/ZhonTai.Admin/Core/Entities/IEntityVersion.cs
  68. 7 8
      src/platform/ZhonTai.Admin/Core/Entities/ITenant.cs
  69. 12 13
      src/platform/ZhonTai.Admin/Core/Entities/TenantType.cs
  70. 12 13
      src/platform/ZhonTai.Admin/Core/Enums/ApiVersion.cs
  71. 5 6
      src/platform/ZhonTai.Admin/Core/Enums/ContentTypeEnum.cs
  72. 34 35
      src/platform/ZhonTai.Admin/Core/Enums/StatusCodes.cs
  73. 28 29
      src/platform/ZhonTai.Admin/Core/Extensions/RateLimitServiceCollectionExtensions.cs
  74. 18 19
      src/platform/ZhonTai.Admin/Core/Extensions/UploadConfigApplicationBuilderExtensions.cs
  75. 38 39
      src/platform/ZhonTai.Admin/Core/Filters/ControllerExceptionFilter.cs
  76. 16 17
      src/platform/ZhonTai.Admin/Core/Filters/ControllerLogFilter.cs
  77. 17 18
      src/platform/ZhonTai.Admin/Core/Filters/EnumSchemaFilter.cs
  78. 31 32
      src/platform/ZhonTai.Admin/Core/Filters/ValidateInputFilter.cs
  79. 56 57
      src/platform/ZhonTai.Admin/Core/Helpers/UploadHelper.cs
  80. 427 428
      src/platform/ZhonTai.Admin/Core/HostApp.cs
  81. 41 42
      src/platform/ZhonTai.Admin/Core/Logs/ApiHelper.cs
  82. 11 12
      src/platform/ZhonTai.Admin/Core/Logs/ILogHandler.cs
  83. 47 48
      src/platform/ZhonTai.Admin/Core/Logs/LogHandler.cs
  84. 15 16
      src/platform/ZhonTai.Admin/Core/RegisterModules/ControllerModule.cs
  85. 2 2
      src/platform/ZhonTai.Admin/Core/RegisterModules/RepositoryModule.cs
  86. 39 40
      src/platform/ZhonTai.Admin/Core/RegisterModules/ServiceModule.cs
  87. 29 30
      src/platform/ZhonTai.Admin/Core/RegisterModules/SingleInstanceModule.cs
  88. 7 8
      src/platform/ZhonTai.Admin/Core/Repositories/DefaultRepositoryBase.cs
  89. 61 59
      src/platform/ZhonTai.Admin/Core/Repositories/IRepositoryBase.cs
  90. 17 18
      src/platform/ZhonTai.Admin/Core/Startup/HostAppContext.cs
  91. 17 18
      src/platform/ZhonTai.Admin/Core/Startup/HostAppMiddlewareContext.cs
  92. 47 48
      src/platform/ZhonTai.Admin/Domain/Api/ApiEntity.cs
  93. 54 55
      src/platform/ZhonTai.Admin/Domain/Api/Dto/ApiDataOutput.cs
  94. 7 8
      src/platform/ZhonTai.Admin/Domain/Api/Dto/ApiGetPageDto.cs
  95. 3 4
      src/platform/ZhonTai.Admin/Domain/Api/IApiRepository.cs
  96. 23 24
      src/platform/ZhonTai.Admin/Domain/AppLog/AppLogEntity.cs
  97. 47 48
      src/platform/ZhonTai.Admin/Domain/Dictionary/DictionaryEntity.cs
  98. 46 47
      src/platform/ZhonTai.Admin/Domain/Dictionary/Dto/DictionaryDataOutput.cs
  99. 11 12
      src/platform/ZhonTai.Admin/Domain/Dictionary/Dto/DictionaryGetPageDto.cs
  100. 3 4
      src/platform/ZhonTai.Admin/Domain/Dictionary/IDictionaryRepository.cs

+ 0 - 70
src/hosts/ZhonTai.Host/InitData/Admin/ad_api.json

@@ -1296,76 +1296,6 @@
       }
     ]
   },
-  {
-    "id": 174219034718278,
-    "parentId": 0,
-    "label": "职位管理",
-    "path": "position",
-    "description": "",
-    "enabled": true,
-    "childs": [
-      {
-        "id": 174219034738759,
-        "parentId": 174219034718278,
-        "label": "查询职位",
-        "path": "/api/admin/position/get",
-        "httpMethods": "get",
-        "description": "",
-        "enabled": true,
-        "childs": []
-      },
-      {
-        "id": 174219034738760,
-        "parentId": 174219034718278,
-        "label": "查询职位列表",
-        "path": "/api/admin/position/getpage",
-        "httpMethods": "post",
-        "description": "",
-        "enabled": true,
-        "childs": []
-      },
-      {
-        "id": 174219034738761,
-        "parentId": 174219034718278,
-        "label": "新增职位",
-        "path": "/api/admin/position/add",
-        "httpMethods": "post",
-        "description": "",
-        "enabled": true,
-        "childs": []
-      },
-      {
-        "id": 174219034738762,
-        "parentId": 174219034718278,
-        "label": "修改职位",
-        "path": "/api/admin/position/update",
-        "httpMethods": "put",
-        "description": "",
-        "enabled": true,
-        "childs": []
-      },
-      {
-        "id": 174219034738763,
-        "parentId": 174219034718278,
-        "label": "删除职位",
-        "path": "/api/admin/position/softdelete",
-        "httpMethods": "delete",
-        "description": "",
-        "enabled": true,
-        "childs": []
-      },
-      {
-        "id": 174219034738764,
-        "parentId": 174219034718278,
-        "label": "批量删除职位",
-        "path": "/api/admin/position/batchsoftdelete",
-        "httpMethods": "put",
-        "description": "",
-        "enabled": true,
-        "childs": []
-      }
-    ]
-  },
   {
     "id": 174219034718279,
     "parentId": 0,

+ 1 - 3
src/hosts/ZhonTai.Host/InitData/Admin/ad_employee.json

@@ -1,9 +1,7 @@
 [
   {
     "id": 189492821434437,
-    "name": "小雪转中雪",
-    "nickName": "小雪转中雪",
-    "code": "10001",
+    "jobNumber": "10001",
     "organizationId": 189097750675525,
     "position": "DotNet程序员"
   }

+ 1 - 3
src/hosts/ZhonTai.Host/InitData/Admin/ad_employee.tenant.json

@@ -2,9 +2,7 @@
   {
     "tenantId": 161223412138053,
     "id": 189492821434437,
-    "name": "小雪转中雪",
-    "nickName": "小雪转中雪",
-    "code": "10001",
+    "jobNumber": "10001",
     "organizationId": 189097750675525,
     "position": "DotNet程序员"
   }

+ 57 - 202
src/hosts/ZhonTai.Host/InitData/Admin/ad_permission.json

@@ -194,6 +194,63 @@
               }
             ]
           },
+          {
+            "id": 188053882503237,
+            "parentId": 161227168636997,
+            "label": "部门管理",
+            "type": 2,
+            "viewId": 174312361087045,
+            "path": "/admin/organization",
+            "icon": "",
+            "closable": true,
+            "newWindow": false,
+            "external": false,
+            "sort": 0,
+            "enabled": true,
+            "description": "",
+            "childs": [
+              {
+                "id": 188054258278469,
+                "parentId": 188053882503237,
+                "label": "查询",
+                "code": "api:admin:organization:getlist",
+                "type": 3,
+                "sort": 0,
+                "enabled": true,
+                "description": ""
+              },
+              {
+                "id": 188054341582917,
+                "parentId": 188053882503237,
+                "label": "新增",
+                "code": "api:admin:organization:add",
+                "type": 3,
+                "sort": 0,
+                "enabled": true,
+                "description": ""
+              },
+              {
+                "id": 188054416891973,
+                "parentId": 188053882503237,
+                "label": "修改",
+                "code": "api:admin:organization:update",
+                "type": 3,
+                "sort": 0,
+                "enabled": true,
+                "description": ""
+              },
+              {
+                "id": 188054509027397,
+                "parentId": 188053882503237,
+                "label": "删除",
+                "code": "api:admin:organization:softdelete",
+                "type": 3,
+                "sort": 0,
+                "enabled": true,
+                "description": ""
+              }
+            ]
+          },
           {
             "id": 161227168653381,
             "parentId": 161227168636997,
@@ -1092,207 +1149,5 @@
         ]
       }
     ]
-  },
-  {
-    "id": 188049591447621,
-    "label": "人事管理",
-    "type": 1,
-    "icon": "el-icon-user-solid",
-    "opened": true,
-    "sort": 1,
-    "enabled": true,
-    "childs": [
-      {
-        "id": 188050115035205,
-        "parentId": 188049591447621,
-        "label": "岗位管理",
-        "type": 2,
-        "viewId": 174312361132101,
-        "path": "/admin/position",
-        "icon": "",
-        "closable": true,
-        "newWindow": false,
-        "external": false,
-        "sort": 0,
-        "enabled": true,
-        "description": "",
-        "childs": [
-          {
-            "id": 188054656589893,
-            "parentId": 188050115035205,
-            "label": "查询",
-            "code": "api:admin:position:getpage",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188054719266885,
-            "parentId": 188050115035205,
-            "label": "新增",
-            "code": "api:admin:position:add",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188054776545349,
-            "parentId": 188050115035205,
-            "label": "修改",
-            "code": "api:admin:position:update",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188054834004037,
-            "parentId": 188050115035205,
-            "label": "删除",
-            "code": "api:admin:position:softdelete",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 189345990168645,
-            "parentId": 188050115035205,
-            "label": "批量删除",
-            "code": "api:admin:position:batchsoftdelete",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          }
-        ]
-      },
-      {
-        "id": 188053882503237,
-        "parentId": 188049591447621,
-        "label": "部门管理",
-        "type": 2,
-        "viewId": 174312361087045,
-        "path": "/admin/organization",
-        "icon": "",
-        "closable": true,
-        "newWindow": false,
-        "external": false,
-        "sort": 0,
-        "enabled": true,
-        "description": "",
-        "childs": [
-          {
-            "id": 188054258278469,
-            "parentId": 188053882503237,
-            "label": "查询",
-            "code": "api:admin:organization:getlist",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188054341582917,
-            "parentId": 188053882503237,
-            "label": "新增",
-            "code": "api:admin:organization:add",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188054416891973,
-            "parentId": 188053882503237,
-            "label": "修改",
-            "code": "api:admin:organization:update",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188054509027397,
-            "parentId": 188053882503237,
-            "label": "删除",
-            "code": "api:admin:organization:softdelete",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          }
-        ]
-      },
-      {
-        "id": 188799375847493,
-        "parentId": 188049591447621,
-        "label": "员工管理",
-        "type": 2,
-        "viewId": 188792508244037,
-        "path": "/admin/employee",
-        "icon": "",
-        "closable": true,
-        "newWindow": false,
-        "external": false,
-        "sort": 0,
-        "enabled": true,
-        "description": "",
-        "childs": [
-          {
-            "id": 188799732494405,
-            "parentId": 188799375847493,
-            "label": "查询",
-            "code": "api:admin:employee:getpage",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188799795101765,
-            "parentId": 188799375847493,
-            "label": "新增",
-            "code": "api:admin:employee:add",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188799878676549,
-            "parentId": 188799375847493,
-            "label": "修改",
-            "code": "api:admin:employee:update",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188799949844549,
-            "parentId": 188799375847493,
-            "label": "删除",
-            "code": "api:admin:employee:softdelete",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          },
-          {
-            "id": 188799997452357,
-            "parentId": 188799375847493,
-            "label": "批量删除",
-            "code": "api:admin:employee:batchsoftdelete",
-            "type": 3,
-            "sort": 0,
-            "enabled": true,
-            "description": ""
-          }
-        ]
-      }
-    ]
   }
 ]

+ 4 - 4
src/hosts/ZhonTai.Host/InitData/Admin/ad_role.json

@@ -1,15 +1,15 @@
 [
   {
     "id": 161223412080709,
-    "name": "平台管理员",
-    "code": "plat_admin",
+    "name": "管理员",
+    "code": "admin",
     "description": "",
     "enabled": true
   },
   {
     "id": 162605510979653,
-    "name": "平台用户",
-    "code": "plat_user",
+    "name": "普通员工",
+    "code": "emp",
     "description": "",
     "enabled": true
   }

+ 11 - 11
src/hosts/ZhonTai.Host/InitData/Admin/ad_role.tenant.json

@@ -2,24 +2,24 @@
   {
     "tenantId": 161223412138053,
     "id": 161223412080709,
-    "name": "平台管理员",
-    "code": "plat_admin",
+    "name": "管理员",
+    "code": "admin",
     "description": "",
     "enabled": true
   },
-  {
-    "tenantId": 162083448455237,
-    "id": 162083448594501,
-    "name": "平台管理员",
-    "code": "plat_admin",
-    "enabled": true
-  },
   {
     "tenantId": 161223412138053,
     "id": 162605510979653,
-    "name": "平台用户",
-    "code": "plat_user",
+    "name": "普通员工",
+    "code": "emp",
     "description": "",
     "enabled": true
+  },
+  {
+    "tenantId": 162083448455237,
+    "id": 162083448594501,
+    "name": "管理员",
+    "code": "admin",
+    "enabled": true
   }
 ]

+ 1 - 1365
src/hosts/ZhonTai.Host/InitData/Admin/ad_role_permission.json

@@ -1,1367 +1,3 @@
 [
-  {
-    "id": 161565593014341,
-    "roleId": 161223412080709,
-    "permissionId": 161227168464965
-  },
-  {
-    "id": 161565592956997,
-    "roleId": 161223412080709,
-    "permissionId": 161227168497733
-  },
-  {
-    "id": 161565593014342,
-    "roleId": 161223412080709,
-    "permissionId": 161227168497734
-  },
-  {
-    "id": 161565593018442,
-    "roleId": 161223412080709,
-    "permissionId": 161227168624709
-  },
-  {
-    "id": 161565593030730,
-    "roleId": 161223412080709,
-    "permissionId": 161227168628805
-  },
-  {
-    "id": 161565593030731,
-    "roleId": 161223412080709,
-    "permissionId": 161227168628806
-  },
-  {
-    "id": 161565593030732,
-    "roleId": 161223412080709,
-    "permissionId": 161227168632901
-  },
-  {
-    "id": 161565593014343,
-    "roleId": 161223412080709,
-    "permissionId": 161227168632902
-  },
-  {
-    "id": 161565593014344,
-    "roleId": 161223412080709,
-    "permissionId": 161227168636997
-  },
-  {
-    "id": 161565593014345,
-    "roleId": 161223412080709,
-    "permissionId": 161227168636998
-  },
-  {
-    "id": 161565593018446,
-    "roleId": 161223412080709,
-    "permissionId": 161227168641093
-  },
-  {
-    "id": 161565593018447,
-    "roleId": 161223412080709,
-    "permissionId": 161227168641094
-  },
-  {
-    "id": 161565593018448,
-    "roleId": 161223412080709,
-    "permissionId": 161227168645189
-  },
-  {
-    "id": 161565593018449,
-    "roleId": 161223412080709,
-    "permissionId": 161227168645190
-  },
-  {
-    "id": 161565593018450,
-    "roleId": 161223412080709,
-    "permissionId": 161227168649285
-  },
-  {
-    "id": 161565593018451,
-    "roleId": 161223412080709,
-    "permissionId": 161227168649286
-  },
-  {
-    "id": 161565593014346,
-    "roleId": 161223412080709,
-    "permissionId": 161227168653381
-  },
-  {
-    "id": 161565593018452,
-    "roleId": 161223412080709,
-    "permissionId": 161227168653382
-  },
-  {
-    "id": 161565593018453,
-    "roleId": 161223412080709,
-    "permissionId": 161227168657477
-  },
-  {
-    "id": 161565593018454,
-    "roleId": 161223412080709,
-    "permissionId": 161227168657478
-  },
-  {
-    "id": 161565593018455,
-    "roleId": 161223412080709,
-    "permissionId": 161227168661573
-  },
-  {
-    "id": 161565593018456,
-    "roleId": 161223412080709,
-    "permissionId": 161227168665669
-  },
-  {
-    "id": 161565593022533,
-    "roleId": 161223412080709,
-    "permissionId": 161227168665670
-  },
-  {
-    "id": 161565593014347,
-    "roleId": 161223412080709,
-    "permissionId": 161227168669765
-  },
-  {
-    "id": 161565593022534,
-    "roleId": 161223412080709,
-    "permissionId": 161227168669766
-  },
-  {
-    "id": 161565593022535,
-    "roleId": 161223412080709,
-    "permissionId": 161227168673861
-  },
-  {
-    "id": 161565593022536,
-    "roleId": 161223412080709,
-    "permissionId": 161227168673862
-  },
-  {
-    "id": 161565593022537,
-    "roleId": 161223412080709,
-    "permissionId": 161227168677957
-  },
-  {
-    "id": 161565593022538,
-    "roleId": 161223412080709,
-    "permissionId": 161227168677958
-  },
-  {
-    "id": 161565593022539,
-    "roleId": 161223412080709,
-    "permissionId": 161227168682053
-  },
-  {
-    "id": 161565593022540,
-    "roleId": 161223412080709,
-    "permissionId": 161227168682054
-  },
-  {
-    "id": 161565593014348,
-    "roleId": 161223412080709,
-    "permissionId": 161227168686149
-  },
-  {
-    "id": 161565593022541,
-    "roleId": 161223412080709,
-    "permissionId": 161227168686150
-  },
-  {
-    "id": 161565593022542,
-    "roleId": 161223412080709,
-    "permissionId": 161227168690245
-  },
-  {
-    "id": 161565593022543,
-    "roleId": 161223412080709,
-    "permissionId": 161227168690246
-  },
-  {
-    "id": 161565593022544,
-    "roleId": 161223412080709,
-    "permissionId": 161227168694341
-  },
-  {
-    "id": 161565593022545,
-    "roleId": 161223412080709,
-    "permissionId": 161227168694342
-  },
-  {
-    "id": 161565593022546,
-    "roleId": 161223412080709,
-    "permissionId": 161227168698437
-  },
-  {
-    "id": 161565593022547,
-    "roleId": 161223412080709,
-    "permissionId": 161227168698438
-  },
-  {
-    "id": 161565593014349,
-    "roleId": 161223412080709,
-    "permissionId": 161227168702533
-  },
-  {
-    "id": 161565593022551,
-    "roleId": 161223412080709,
-    "permissionId": 161227168702534
-  },
-  {
-    "id": 161565593026629,
-    "roleId": 161223412080709,
-    "permissionId": 161227168706629
-  },
-  {
-    "id": 161565593026630,
-    "roleId": 161223412080709,
-    "permissionId": 161227168706630
-  },
-  {
-    "id": 161565593026631,
-    "roleId": 161223412080709,
-    "permissionId": 161227168710725
-  },
-  {
-    "id": 161565593026632,
-    "roleId": 161223412080709,
-    "permissionId": 161227168710726
-  },
-  {
-    "id": 161565593026633,
-    "roleId": 161223412080709,
-    "permissionId": 161227168714821
-  },
-  {
-    "id": 161565593026634,
-    "roleId": 161223412080709,
-    "permissionId": 161227168714822
-  },
-  {
-    "id": 161565593026635,
-    "roleId": 161223412080709,
-    "permissionId": 161227168718917
-  },
-  {
-    "id": 161565593026636,
-    "roleId": 161223412080709,
-    "permissionId": 161227168718918
-  },
-  {
-    "id": 161565593026637,
-    "roleId": 161223412080709,
-    "permissionId": 161227168723013
-  },
-  {
-    "id": 161565593026638,
-    "roleId": 161223412080709,
-    "permissionId": 161227168723014
-  },
-  {
-    "id": 161565593022550,
-    "roleId": 161223412080709,
-    "permissionId": 161227168727109
-  },
-  {
-    "id": 161565593022549,
-    "roleId": 161223412080709,
-    "permissionId": 161227168727110
-  },
-  {
-    "id": 161565593022548,
-    "roleId": 161223412080709,
-    "permissionId": 161227168731205
-  },
-  {
-    "id": 161565593014350,
-    "roleId": 161223412080709,
-    "permissionId": 161227168731206
-  },
-  {
-    "id": 161565593026639,
-    "roleId": 161223412080709,
-    "permissionId": 161227168735301
-  },
-  {
-    "id": 161565593026640,
-    "roleId": 161223412080709,
-    "permissionId": 161227168735302
-  },
-  {
-    "id": 161565593026641,
-    "roleId": 161223412080709,
-    "permissionId": 161227168739397
-  },
-  {
-    "id": 161565593026642,
-    "roleId": 161223412080709,
-    "permissionId": 161227168739398
-  },
-  {
-    "id": 161565593014351,
-    "roleId": 161223412080709,
-    "permissionId": 161227168743493
-  },
-  {
-    "id": 161565593026643,
-    "roleId": 161223412080709,
-    "permissionId": 161227168747589
-  },
-  {
-    "id": 161565593026644,
-    "roleId": 161223412080709,
-    "permissionId": 161227168747590
-  },
-  {
-    "id": 161565593014352,
-    "roleId": 161223412080709,
-    "permissionId": 161227168751685
-  },
-  {
-    "id": 161565593026645,
-    "roleId": 161223412080709,
-    "permissionId": 161227168751686
-  },
-  {
-    "id": 161565593026646,
-    "roleId": 161223412080709,
-    "permissionId": 161227168755781
-  },
-  {
-    "id": 161565593026647,
-    "roleId": 161223412080709,
-    "permissionId": 161227168755782
-  },
-  {
-    "id": 161565593026648,
-    "roleId": 161223412080709,
-    "permissionId": 161227168759877
-  },
-  {
-    "id": 161565593026649,
-    "roleId": 161223412080709,
-    "permissionId": 161227168759878
-  },
-  {
-    "id": 161565593026650,
-    "roleId": 161223412080709,
-    "permissionId": 161227168763973
-  },
-  {
-    "id": 161565593014353,
-    "roleId": 161223412080709,
-    "permissionId": 161227168763974
-  },
-  {
-    "id": 161565593018437,
-    "roleId": 161223412080709,
-    "permissionId": 161227168768069
-  },
-  {
-    "id": 161565593018438,
-    "roleId": 161223412080709,
-    "permissionId": 161227168768070
-  },
-  {
-    "id": 161565593026651,
-    "roleId": 161223412080709,
-    "permissionId": 161227168772165
-  },
-  {
-    "id": 161565593026652,
-    "roleId": 161223412080709,
-    "permissionId": 161227168772166
-  },
-  {
-    "id": 161565593030725,
-    "roleId": 161223412080709,
-    "permissionId": 161227168776261
-  },
-  {
-    "id": 161565593030726,
-    "roleId": 161223412080709,
-    "permissionId": 161227168776262
-  },
-  {
-    "id": 161565593030727,
-    "roleId": 161223412080709,
-    "permissionId": 161227168780357
-  },
-  {
-    "id": 161565593018439,
-    "roleId": 161223412080709,
-    "permissionId": 161227168780358
-  },
-  {
-    "id": 161565593018440,
-    "roleId": 161223412080709,
-    "permissionId": 161227168784453
-  },
-  {
-    "id": 161565593030728,
-    "roleId": 161223412080709,
-    "permissionId": 161227168784454
-  },
-  {
-    "id": 161565593018441,
-    "roleId": 161223412080709,
-    "permissionId": 161227168788549
-  },
-  {
-    "id": 161565593030729,
-    "roleId": 161223412080709,
-    "permissionId": 161227168788550
-  },
-  {
-    "id": 161565593018444,
-    "roleId": 161223412080709,
-    "permissionId": 161227168792645
-  },
-  {
-    "id": 161565593018445,
-    "roleId": 161223412080709,
-    "permissionId": 161227168792646
-  },
-  {
-    "id": 161565593018443,
-    "roleId": 161223412080709,
-    "permissionId": 161227168796741
-  },
-  {
-    "id": 161565593030737,
-    "roleId": 161223412080709,
-    "permissionId": 161227168800837
-  },
-  {
-    "id": 161565593030740,
-    "roleId": 161223412080709,
-    "permissionId": 161227168800838
-  },
-  {
-    "id": 161565593030741,
-    "roleId": 161223412080709,
-    "permissionId": 161227168804933
-  },
-  {
-    "id": 161565593030742,
-    "roleId": 161223412080709,
-    "permissionId": 161227168809029
-  },
-  {
-    "id": 161565593030743,
-    "roleId": 161223412080709,
-    "permissionId": 161227168813125
-  },
-  {
-    "id": 161565593030744,
-    "roleId": 161223412080709,
-    "permissionId": 161227168813126
-  },
-  {
-    "id": 161565593030738,
-    "roleId": 161223412080709,
-    "permissionId": 161227168817221
-  },
-  {
-    "id": 161565593030739,
-    "roleId": 161223412080709,
-    "permissionId": 161227168821317
-  },
-  {
-    "id": 161565593030736,
-    "roleId": 161223412080709,
-    "permissionId": 161227168821318
-  },
-  {
-    "id": 161565593030745,
-    "roleId": 161223412080709,
-    "permissionId": 161227168825413
-  },
-  {
-    "id": 161565593030746,
-    "roleId": 161223412080709,
-    "permissionId": 161227168825414
-  },
-  {
-    "id": 183778335580233,
-    "roleId": 161223412080709,
-    "permissionId": 161227168829509
-  },
-  {
-    "id": 161565593030735,
-    "roleId": 161223412080709,
-    "permissionId": 161227168833605
-  },
-  {
-    "id": 161565593030734,
-    "roleId": 161223412080709,
-    "permissionId": 161227168833606
-  },
-  {
-    "id": 161807399874629,
-    "roleId": 161223412080709,
-    "permissionId": 161807358345285
-  },
-  {
-    "id": 163580436009029,
-    "roleId": 161223412080709,
-    "permissionId": 163579955331141
-  },
-  {
-    "id": 170679499796549,
-    "roleId": 161223412080709,
-    "permissionId": 170679206428741
-  },
-  {
-    "id": 183778335563845,
-    "roleId": 161223412080709,
-    "permissionId": 183718997708869
-  },
-  {
-    "id": 183778335580232,
-    "roleId": 161223412080709,
-    "permissionId": 183777916887109
-  },
-  {
-    "id": 183778335580231,
-    "roleId": 161223412080709,
-    "permissionId": 183777994424389
-  },
-  {
-    "id": 183778335580229,
-    "roleId": 161223412080709,
-    "permissionId": 183778056978501
-  },
-  {
-    "id": 183778335580230,
-    "roleId": 161223412080709,
-    "permissionId": 183778150793285
-  },
-  {
-    "id": 184101102391365,
-    "roleId": 161223412080709,
-    "permissionId": 184100977127493
-  },
-  {
-    "id": 184101102407749,
-    "roleId": 161223412080709,
-    "permissionId": 184101057175621
-  },
-  {
-    "id": 187055989936197,
-    "roleId": 161223412080709,
-    "permissionId": 187055743545413
-  },
-  {
-    "id": 187385627279429,
-    "roleId": 161223412080709,
-    "permissionId": 187375358951493
-  },
-  {
-    "id": 187385627217989,
-    "roleId": 161223412080709,
-    "permissionId": 187385577599045
-  },
-  {
-    "id": 187391597285445,
-    "roleId": 161223412080709,
-    "permissionId": 187389970825285
-  },
-  {
-    "id": 187391597310021,
-    "roleId": 161223412080709,
-    "permissionId": 187390547820613
-  },
-  {
-    "id": 187391597310022,
-    "roleId": 161223412080709,
-    "permissionId": 187391371018309
-  },
-  {
-    "id": 187392010170437,
-    "roleId": 161223412080709,
-    "permissionId": 187391980761157
-  },
-  {
-    "id": 188054886735941,
-    "roleId": 161223412080709,
-    "permissionId": 188049591447621
-  },
-  {
-    "id": 188054886748230,
-    "roleId": 161223412080709,
-    "permissionId": 188050115035205
-  },
-  {
-    "id": 188054886748229,
-    "roleId": 161223412080709,
-    "permissionId": 188053882503237
-  },
-  {
-    "id": 188054886748234,
-    "roleId": 161223412080709,
-    "permissionId": 188054258278469
-  },
-  {
-    "id": 188054886748233,
-    "roleId": 161223412080709,
-    "permissionId": 188054341582917
-  },
-  {
-    "id": 188054886748231,
-    "roleId": 161223412080709,
-    "permissionId": 188054416891973
-  },
-  {
-    "id": 188054886748232,
-    "roleId": 161223412080709,
-    "permissionId": 188054509027397
-  },
-  {
-    "id": 188054886748238,
-    "roleId": 161223412080709,
-    "permissionId": 188054656589893
-  },
-  {
-    "id": 188054886748237,
-    "roleId": 161223412080709,
-    "permissionId": 188054719266885
-  },
-  {
-    "id": 188054886748235,
-    "roleId": 161223412080709,
-    "permissionId": 188054776545349
-  },
-  {
-    "id": 188054886748236,
-    "roleId": 161223412080709,
-    "permissionId": 188054834004037
-  },
-  {
-    "id": 188800411451461,
-    "roleId": 161223412080709,
-    "permissionId": 188799375847493
-  },
-  {
-    "id": 188800411451466,
-    "roleId": 161223412080709,
-    "permissionId": 188799732494405
-  },
-  {
-    "id": 188800411451465,
-    "roleId": 161223412080709,
-    "permissionId": 188799795101765
-  },
-  {
-    "id": 188800411451462,
-    "roleId": 161223412080709,
-    "permissionId": 188799878676549
-  },
-  {
-    "id": 188800411451463,
-    "roleId": 161223412080709,
-    "permissionId": 188799949844549
-  },
-  {
-    "id": 188800411451464,
-    "roleId": 161223412080709,
-    "permissionId": 188799997452357
-  },
-  {
-    "id": 189346039275589,
-    "roleId": 161223412080709,
-    "permissionId": 189345990168645
-  },
-  {
-    "id": 162105754484810,
-    "roleId": 162083448594501,
-    "permissionId": 161227168464965
-  },
-  {
-    "id": 162105754480709,
-    "roleId": 162083448594501,
-    "permissionId": 161227168497733
-  },
-  {
-    "id": 162105754484812,
-    "roleId": 162083448594501,
-    "permissionId": 161227168497734
-  },
-  {
-    "id": 162105754484809,
-    "roleId": 162083448594501,
-    "permissionId": 161227168624709
-  },
-  {
-    "id": 162105754484834,
-    "roleId": 162083448594501,
-    "permissionId": 161227168628805
-  },
-  {
-    "id": 162105754484835,
-    "roleId": 162083448594501,
-    "permissionId": 161227168628806
-  },
-  {
-    "id": 162105754484836,
-    "roleId": 162083448594501,
-    "permissionId": 161227168632901
-  },
-  {
-    "id": 162105754480710,
-    "roleId": 162083448594501,
-    "permissionId": 161227168636997
-  },
-  {
-    "id": 162105754382405,
-    "roleId": 162083448594501,
-    "permissionId": 161227168636998
-  },
-  {
-    "id": 162105754484813,
-    "roleId": 162083448594501,
-    "permissionId": 161227168641093
-  },
-  {
-    "id": 162105754484814,
-    "roleId": 162083448594501,
-    "permissionId": 161227168641094
-  },
-  {
-    "id": 162105754484815,
-    "roleId": 162083448594501,
-    "permissionId": 161227168645189
-  },
-  {
-    "id": 162105754484816,
-    "roleId": 162083448594501,
-    "permissionId": 161227168645190
-  },
-  {
-    "id": 162105754484817,
-    "roleId": 162083448594501,
-    "permissionId": 161227168649285
-  },
-  {
-    "id": 162105754484818,
-    "roleId": 162083448594501,
-    "permissionId": 161227168649286
-  },
-  {
-    "id": 162105754484805,
-    "roleId": 162083448594501,
-    "permissionId": 161227168653381
-  },
-  {
-    "id": 162105754484819,
-    "roleId": 162083448594501,
-    "permissionId": 161227168653382
-  },
-  {
-    "id": 162105754484820,
-    "roleId": 162083448594501,
-    "permissionId": 161227168657477
-  },
-  {
-    "id": 162105754484821,
-    "roleId": 162083448594501,
-    "permissionId": 161227168657478
-  },
-  {
-    "id": 162105754484822,
-    "roleId": 162083448594501,
-    "permissionId": 161227168661573
-  },
-  {
-    "id": 162105754484823,
-    "roleId": 162083448594501,
-    "permissionId": 161227168665669
-  },
-  {
-    "id": 162105754484824,
-    "roleId": 162083448594501,
-    "permissionId": 161227168665670
-  },
-  {
-    "id": 162105754484806,
-    "roleId": 162083448594501,
-    "permissionId": 161227168731206
-  },
-  {
-    "id": 162105754484825,
-    "roleId": 162083448594501,
-    "permissionId": 161227168735301
-  },
-  {
-    "id": 162105754484826,
-    "roleId": 162083448594501,
-    "permissionId": 161227168735302
-  },
-  {
-    "id": 162105754484827,
-    "roleId": 162083448594501,
-    "permissionId": 161227168739397
-  },
-  {
-    "id": 162105754484828,
-    "roleId": 162083448594501,
-    "permissionId": 161227168739398
-  },
-  {
-    "id": 162105754484808,
-    "roleId": 162083448594501,
-    "permissionId": 161227168763974
-  },
-  {
-    "id": 162105754484807,
-    "roleId": 162083448594501,
-    "permissionId": 161227168768070
-  },
-  {
-    "id": 162105754484829,
-    "roleId": 162083448594501,
-    "permissionId": 161227168772165
-  },
-  {
-    "id": 162105754484830,
-    "roleId": 162083448594501,
-    "permissionId": 161227168772166
-  },
-  {
-    "id": 162105754484831,
-    "roleId": 162083448594501,
-    "permissionId": 161227168776261
-  },
-  {
-    "id": 162105754484832,
-    "roleId": 162083448594501,
-    "permissionId": 161227168776262
-  },
-  {
-    "id": 162105754484833,
-    "roleId": 162083448594501,
-    "permissionId": 161227168780357
-  },
-  {
-    "id": 162131333746757,
-    "roleId": 162083448594501,
-    "permissionId": 161227168780358
-  },
-  {
-    "id": 162131333775429,
-    "roleId": 162083448594501,
-    "permissionId": 161227168784453
-  },
-  {
-    "id": 162131333775431,
-    "roleId": 162083448594501,
-    "permissionId": 161227168784454
-  },
-  {
-    "id": 162131333775430,
-    "roleId": 162083448594501,
-    "permissionId": 161227168788549
-  },
-  {
-    "id": 162131333775432,
-    "roleId": 162083448594501,
-    "permissionId": 161227168788550
-  },
-  {
-    "id": 162105754484811,
-    "roleId": 162083448594501,
-    "permissionId": 161227168796741
-  },
-  {
-    "id": 162105754484838,
-    "roleId": 162083448594501,
-    "permissionId": 161227168800837
-  },
-  {
-    "id": 162105754484841,
-    "roleId": 162083448594501,
-    "permissionId": 161227168800838
-  },
-  {
-    "id": 162105754484842,
-    "roleId": 162083448594501,
-    "permissionId": 161227168804933
-  },
-  {
-    "id": 162105754484843,
-    "roleId": 162083448594501,
-    "permissionId": 161227168809029
-  },
-  {
-    "id": 162105754484844,
-    "roleId": 162083448594501,
-    "permissionId": 161227168813125
-  },
-  {
-    "id": 162105754488901,
-    "roleId": 162083448594501,
-    "permissionId": 161227168813126
-  },
-  {
-    "id": 162105754484839,
-    "roleId": 162083448594501,
-    "permissionId": 161227168817221
-  },
-  {
-    "id": 162105754484840,
-    "roleId": 162083448594501,
-    "permissionId": 161227168821317
-  },
-  {
-    "id": 162105754484837,
-    "roleId": 162083448594501,
-    "permissionId": 161227168821318
-  },
-  {
-    "id": 162105754488902,
-    "roleId": 162083448594501,
-    "permissionId": 161227168825413
-  },
-  {
-    "id": 162105754488903,
-    "roleId": 162083448594501,
-    "permissionId": 161227168825414
-  },
-  {
-    "id": 162105754488904,
-    "roleId": 162083448594501,
-    "permissionId": 161227168833605
-  },
-  {
-    "id": 162105754488905,
-    "roleId": 162083448594501,
-    "permissionId": 161227168833606
-  },
-  {
-    "id": 189493447802949,
-    "roleId": 162083448594501,
-    "permissionId": 187055743545413
-  },
-  {
-    "id": 189493447843912,
-    "roleId": 162083448594501,
-    "permissionId": 187375358951493
-  },
-  {
-    "id": 189493447843914,
-    "roleId": 162083448594501,
-    "permissionId": 187389970825285
-  },
-  {
-    "id": 189493447843915,
-    "roleId": 162083448594501,
-    "permissionId": 187390547820613
-  },
-  {
-    "id": 189493447843916,
-    "roleId": 162083448594501,
-    "permissionId": 187391371018309
-  },
-  {
-    "id": 189493447843913,
-    "roleId": 162083448594501,
-    "permissionId": 187391980761157
-  },
-  {
-    "id": 189493447839813,
-    "roleId": 162083448594501,
-    "permissionId": 188049591447621
-  },
-  {
-    "id": 189493447843910,
-    "roleId": 162083448594501,
-    "permissionId": 188050115035205
-  },
-  {
-    "id": 189493447843911,
-    "roleId": 162083448594501,
-    "permissionId": 188053882503237
-  },
-  {
-    "id": 189493447848014,
-    "roleId": 162083448594501,
-    "permissionId": 188054258278469
-  },
-  {
-    "id": 189493447848013,
-    "roleId": 162083448594501,
-    "permissionId": 188054341582917
-  },
-  {
-    "id": 189493447848011,
-    "roleId": 162083448594501,
-    "permissionId": 188054416891973
-  },
-  {
-    "id": 189493447848012,
-    "roleId": 162083448594501,
-    "permissionId": 188054509027397
-  },
-  {
-    "id": 189493447848010,
-    "roleId": 162083448594501,
-    "permissionId": 188054656589893
-  },
-  {
-    "id": 189493447848009,
-    "roleId": 162083448594501,
-    "permissionId": 188054719266885
-  },
-  {
-    "id": 189493447848006,
-    "roleId": 162083448594501,
-    "permissionId": 188054776545349
-  },
-  {
-    "id": 189493447848007,
-    "roleId": 162083448594501,
-    "permissionId": 188054834004037
-  },
-  {
-    "id": 189493447843909,
-    "roleId": 162083448594501,
-    "permissionId": 188799375847493
-  },
-  {
-    "id": 189493447848005,
-    "roleId": 162083448594501,
-    "permissionId": 188799732494405
-  },
-  {
-    "id": 189493447843920,
-    "roleId": 162083448594501,
-    "permissionId": 188799795101765
-  },
-  {
-    "id": 189493447843917,
-    "roleId": 162083448594501,
-    "permissionId": 188799878676549
-  },
-  {
-    "id": 189493447843918,
-    "roleId": 162083448594501,
-    "permissionId": 188799949844549
-  },
-  {
-    "id": 189493447843919,
-    "roleId": 162083448594501,
-    "permissionId": 188799997452357
-  },
-  {
-    "id": 189493447848008,
-    "roleId": 162083448594501,
-    "permissionId": 189345990168645
-  },
-  {
-    "id": 162606254506053,
-    "roleId": 162605510979653,
-    "permissionId": 161227168464965
-  },
-  {
-    "id": 162606254497861,
-    "roleId": 162605510979653,
-    "permissionId": 161227168497733
-  },
-  {
-    "id": 162606254506054,
-    "roleId": 162605510979653,
-    "permissionId": 161227168497734
-  },
-  {
-    "id": 162606254510149,
-    "roleId": 162605510979653,
-    "permissionId": 161227168624709
-  },
-  {
-    "id": 162606254510176,
-    "roleId": 162605510979653,
-    "permissionId": 161227168628805
-  },
-  {
-    "id": 162606254506055,
-    "roleId": 162605510979653,
-    "permissionId": 161227168632902
-  },
-  {
-    "id": 162606254506056,
-    "roleId": 162605510979653,
-    "permissionId": 161227168636997
-  },
-  {
-    "id": 162606254506057,
-    "roleId": 162605510979653,
-    "permissionId": 161227168636998
-  },
-  {
-    "id": 162606254510153,
-    "roleId": 162605510979653,
-    "permissionId": 161227168641093
-  },
-  {
-    "id": 162606254510154,
-    "roleId": 162605510979653,
-    "permissionId": 161227168649286
-  },
-  {
-    "id": 162606254506058,
-    "roleId": 162605510979653,
-    "permissionId": 161227168653381
-  },
-  {
-    "id": 162606254510155,
-    "roleId": 162605510979653,
-    "permissionId": 161227168653382
-  },
-  {
-    "id": 162606254510156,
-    "roleId": 162605510979653,
-    "permissionId": 161227168665670
-  },
-  {
-    "id": 162606254506059,
-    "roleId": 162605510979653,
-    "permissionId": 161227168669765
-  },
-  {
-    "id": 162606254510157,
-    "roleId": 162605510979653,
-    "permissionId": 161227168669766
-  },
-  {
-    "id": 162606254510158,
-    "roleId": 162605510979653,
-    "permissionId": 161227168682054
-  },
-  {
-    "id": 162606254506060,
-    "roleId": 162605510979653,
-    "permissionId": 161227168686149
-  },
-  {
-    "id": 162606254510159,
-    "roleId": 162605510979653,
-    "permissionId": 161227168686150
-  },
-  {
-    "id": 162606254510160,
-    "roleId": 162605510979653,
-    "permissionId": 161227168698438
-  },
-  {
-    "id": 162606254506061,
-    "roleId": 162605510979653,
-    "permissionId": 161227168702533
-  },
-  {
-    "id": 162606254510162,
-    "roleId": 162605510979653,
-    "permissionId": 161227168702534
-  },
-  {
-    "id": 162606254510163,
-    "roleId": 162605510979653,
-    "permissionId": 161227168718918
-  },
-  {
-    "id": 162606254510164,
-    "roleId": 162605510979653,
-    "permissionId": 161227168723013
-  },
-  {
-    "id": 162606254510165,
-    "roleId": 162605510979653,
-    "permissionId": 161227168723014
-  },
-  {
-    "id": 162606254510161,
-    "roleId": 162605510979653,
-    "permissionId": 161227168727109
-  },
-  {
-    "id": 162606254506062,
-    "roleId": 162605510979653,
-    "permissionId": 161227168731206
-  },
-  {
-    "id": 162606254510166,
-    "roleId": 162605510979653,
-    "permissionId": 161227168735301
-  },
-  {
-    "id": 162606254510167,
-    "roleId": 162605510979653,
-    "permissionId": 161227168735302
-  },
-  {
-    "id": 162606254510168,
-    "roleId": 162605510979653,
-    "permissionId": 161227168739397
-  },
-  {
-    "id": 162606254506063,
-    "roleId": 162605510979653,
-    "permissionId": 161227168743493
-  },
-  {
-    "id": 162606254510169,
-    "roleId": 162605510979653,
-    "permissionId": 161227168747589
-  },
-  {
-    "id": 162606254506064,
-    "roleId": 162605510979653,
-    "permissionId": 161227168751685
-  },
-  {
-    "id": 162606254510170,
-    "roleId": 162605510979653,
-    "permissionId": 161227168751686
-  },
-  {
-    "id": 162606254510171,
-    "roleId": 162605510979653,
-    "permissionId": 161227168763973
-  },
-  {
-    "id": 162606254506065,
-    "roleId": 162605510979653,
-    "permissionId": 161227168763974
-  },
-  {
-    "id": 162606254506066,
-    "roleId": 162605510979653,
-    "permissionId": 161227168768069
-  },
-  {
-    "id": 162606254506067,
-    "roleId": 162605510979653,
-    "permissionId": 161227168768070
-  },
-  {
-    "id": 162606254510172,
-    "roleId": 162605510979653,
-    "permissionId": 161227168772165
-  },
-  {
-    "id": 162606254510173,
-    "roleId": 162605510979653,
-    "permissionId": 161227168780357
-  },
-  {
-    "id": 162606254506068,
-    "roleId": 162605510979653,
-    "permissionId": 161227168780358
-  },
-  {
-    "id": 162606254506069,
-    "roleId": 162605510979653,
-    "permissionId": 161227168784453
-  },
-  {
-    "id": 162606254510174,
-    "roleId": 162605510979653,
-    "permissionId": 161227168784454
-  },
-  {
-    "id": 162606254506070,
-    "roleId": 162605510979653,
-    "permissionId": 161227168788549
-  },
-  {
-    "id": 162606254510175,
-    "roleId": 162605510979653,
-    "permissionId": 161227168788550
-  },
-  {
-    "id": 162606254510151,
-    "roleId": 162605510979653,
-    "permissionId": 161227168792645
-  },
-  {
-    "id": 162606254510152,
-    "roleId": 162605510979653,
-    "permissionId": 161227168792646
-  },
-  {
-    "id": 162606254510150,
-    "roleId": 162605510979653,
-    "permissionId": 161227168796741
-  },
-  {
-    "id": 162606254510178,
-    "roleId": 162605510979653,
-    "permissionId": 161227168800837
-  },
-  {
-    "id": 162606254510179,
-    "roleId": 162605510979653,
-    "permissionId": 161227168817221
-  },
-  {
-    "id": 162606254510180,
-    "roleId": 162605510979653,
-    "permissionId": 161227168821317
-  },
-  {
-    "id": 162606254510177,
-    "roleId": 162605510979653,
-    "permissionId": 161227168821318
-  },
-  {
-    "id": 162606254510181,
-    "roleId": 162605510979653,
-    "permissionId": 161227168825413
-  },
-  {
-    "id": 162606254510182,
-    "roleId": 162605510979653,
-    "permissionId": 161227168833605
-  },
-  {
-    "id": 188054970540101,
-    "roleId": 162605510979653,
-    "permissionId": 187055743545413
-  },
-  {
-    "id": 188054970540105,
-    "roleId": 162605510979653,
-    "permissionId": 187375358951493
-  },
-  {
-    "id": 188054970540102,
-    "roleId": 162605510979653,
-    "permissionId": 188049591447621
-  },
-  {
-    "id": 188054970540104,
-    "roleId": 162605510979653,
-    "permissionId": 188050115035205
-  },
-  {
-    "id": 188054970540103,
-    "roleId": 162605510979653,
-    "permissionId": 188053882503237
-  },
-  {
-    "id": 188054970540106,
-    "roleId": 162605510979653,
-    "permissionId": 188054258278469
-  },
-  {
-    "id": 188054970540107,
-    "roleId": 162605510979653,
-    "permissionId": 188054656589893
-  },
-  {
-    "id": 188800106156101,
-    "roleId": 162605510979653,
-    "permissionId": 188799375847493
-  },
-  {
-    "id": 188800106184773,
-    "roleId": 162605510979653,
-    "permissionId": 188799732494405
-  }
+  
 ]

+ 1 - 1020
src/hosts/ZhonTai.Host/InitData/Admin/ad_tenant_permission.json

@@ -1,1022 +1,3 @@
 [
-  {
-    "id": 170679574487109,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168464965
-  },
-  {
-    "id": 170679574474821,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168497733
-  },
-  {
-    "id": 170679574487110,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168497734
-  },
-  {
-    "id": 170679574487127,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168624709
-  },
-  {
-    "id": 170679574495306,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168628805
-  },
-  {
-    "id": 170679574495307,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168628806
-  },
-  {
-    "id": 170679574495308,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168632901
-  },
-  {
-    "id": 170679574487111,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168632902
-  },
-  {
-    "id": 170679574487112,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168636997
-  },
-  {
-    "id": 170679574487113,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168636998
-  },
-  {
-    "id": 170679574491207,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168641093
-  },
-  {
-    "id": 170679574491208,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168641094
-  },
-  {
-    "id": 170679574491209,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168645189
-  },
-  {
-    "id": 170679574491210,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168645190
-  },
-  {
-    "id": 170679574491211,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168649285
-  },
-  {
-    "id": 170679574491212,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168649286
-  },
-  {
-    "id": 170679574487114,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168653381
-  },
-  {
-    "id": 170679574491213,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168653382
-  },
-  {
-    "id": 170679574491214,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168657477
-  },
-  {
-    "id": 170679574491215,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168657478
-  },
-  {
-    "id": 170679574491216,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168661573
-  },
-  {
-    "id": 170679574491217,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168665669
-  },
-  {
-    "id": 170679574491218,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168665670
-  },
-  {
-    "id": 170679574487115,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168669765
-  },
-  {
-    "id": 170679574491219,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168669766
-  },
-  {
-    "id": 170679574491220,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168673861
-  },
-  {
-    "id": 170679574491221,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168673862
-  },
-  {
-    "id": 170679574491222,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168677957
-  },
-  {
-    "id": 170679574491223,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168677958
-  },
-  {
-    "id": 170679574491224,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168682053
-  },
-  {
-    "id": 170679574491225,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168682054
-  },
-  {
-    "id": 170679574487116,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168686149
-  },
-  {
-    "id": 170679574491226,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168686150
-  },
-  {
-    "id": 170679574491227,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168690245
-  },
-  {
-    "id": 170679574491228,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168690246
-  },
-  {
-    "id": 170679574491229,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168694341
-  },
-  {
-    "id": 170679574491230,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168694342
-  },
-  {
-    "id": 170679574491231,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168698437
-  },
-  {
-    "id": 170679574491232,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168698438
-  },
-  {
-    "id": 170679574487117,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168702533
-  },
-  {
-    "id": 170679574491236,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168702534
-  },
-  {
-    "id": 170679574491237,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168706629
-  },
-  {
-    "id": 170679574491238,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168706630
-  },
-  {
-    "id": 170679574491239,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168710725
-  },
-  {
-    "id": 170679574491240,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168710726
-  },
-  {
-    "id": 170679574491241,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168714821
-  },
-  {
-    "id": 170679574491242,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168714822
-  },
-  {
-    "id": 170679574491243,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168718917
-  },
-  {
-    "id": 170679574491244,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168718918
-  },
-  {
-    "id": 170679574491245,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168723013
-  },
-  {
-    "id": 170679574491246,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168723014
-  },
-  {
-    "id": 170679574491235,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168727109
-  },
-  {
-    "id": 170679574491234,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168727110
-  },
-  {
-    "id": 170679574491233,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168731205
-  },
-  {
-    "id": 170679574487118,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168731206
-  },
-  {
-    "id": 170679574491247,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168735301
-  },
-  {
-    "id": 170679574491248,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168735302
-  },
-  {
-    "id": 170679574491249,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168739397
-  },
-  {
-    "id": 170679574491250,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168739398
-  },
-  {
-    "id": 170679574487119,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168743493
-  },
-  {
-    "id": 170679574491251,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168747589
-  },
-  {
-    "id": 170679574491252,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168747590
-  },
-  {
-    "id": 170679574487120,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168751685
-  },
-  {
-    "id": 170679574491254,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168751686
-  },
-  {
-    "id": 170679574491255,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168755781
-  },
-  {
-    "id": 170679574491256,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168755782
-  },
-  {
-    "id": 170679574491257,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168759877
-  },
-  {
-    "id": 170679574491258,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168759878
-  },
-  {
-    "id": 170679574491259,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168763973
-  },
-  {
-    "id": 170679574487121,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168763974
-  },
-  {
-    "id": 170679574487122,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168768069
-  },
-  {
-    "id": 170679574487123,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168768070
-  },
-  {
-    "id": 170679574491262,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168772165
-  },
-  {
-    "id": 170679574491263,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168772166
-  },
-  {
-    "id": 170679574495301,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168776261
-  },
-  {
-    "id": 170679574495302,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168776262
-  },
-  {
-    "id": 170679574495303,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168780357
-  },
-  {
-    "id": 170679574487124,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168780358
-  },
-  {
-    "id": 170679574487125,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168784453
-  },
-  {
-    "id": 170679574495304,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168784454
-  },
-  {
-    "id": 170679574487126,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168788549
-  },
-  {
-    "id": 170679574495305,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168788550
-  },
-  {
-    "id": 170679574491205,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168792645
-  },
-  {
-    "id": 170679574491206,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168792646
-  },
-  {
-    "id": 170679574487128,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168796741
-  },
-  {
-    "id": 170679574495310,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168800837
-  },
-  {
-    "id": 170679574495313,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168800838
-  },
-  {
-    "id": 170679574495314,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168804933
-  },
-  {
-    "id": 170679574495315,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168809029
-  },
-  {
-    "id": 170679574495316,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168813125
-  },
-  {
-    "id": 170679574495317,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168813126
-  },
-  {
-    "id": 170679574495311,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168817221
-  },
-  {
-    "id": 170679574495312,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168821317
-  },
-  {
-    "id": 170679574495309,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168821318
-  },
-  {
-    "id": 170679574495318,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168825413
-  },
-  {
-    "id": 170679574495319,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168825414
-  },
-  {
-    "id": 170679574495322,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168829509
-  },
-  {
-    "id": 170679574495320,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168833605
-  },
-  {
-    "id": 170679574495321,
-    "tenantId": 161223412138053,
-    "permissionId": 161227168833606
-  },
-  {
-    "id": 170679574491260,
-    "tenantId": 161223412138053,
-    "permissionId": 161807358345285
-  },
-  {
-    "id": 170679574491261,
-    "tenantId": 161223412138053,
-    "permissionId": 163579955331141
-  },
-  {
-    "id": 170679574491253,
-    "tenantId": 161223412138053,
-    "permissionId": 170679206428741
-  },
-  {
-    "id": 189493173526597,
-    "tenantId": 161223412138053,
-    "permissionId": 187055743545413
-  },
-  {
-    "id": 189493173563465,
-    "tenantId": 161223412138053,
-    "permissionId": 187375358951493
-  },
-  {
-    "id": 189493173563464,
-    "tenantId": 161223412138053,
-    "permissionId": 187385577599045
-  },
-  {
-    "id": 189493173563467,
-    "tenantId": 161223412138053,
-    "permissionId": 187389970825285
-  },
-  {
-    "id": 189493173563468,
-    "tenantId": 161223412138053,
-    "permissionId": 187390547820613
-  },
-  {
-    "id": 189493173563469,
-    "tenantId": 161223412138053,
-    "permissionId": 187391371018309
-  },
-  {
-    "id": 189493173563466,
-    "tenantId": 161223412138053,
-    "permissionId": 187391980761157
-  },
-  {
-    "id": 189493173559365,
-    "tenantId": 161223412138053,
-    "permissionId": 188049591447621
-  },
-  {
-    "id": 189493173563462,
-    "tenantId": 161223412138053,
-    "permissionId": 188050115035205
-  },
-  {
-    "id": 189493173563463,
-    "tenantId": 161223412138053,
-    "permissionId": 188053882503237
-  },
-  {
-    "id": 189493173567561,
-    "tenantId": 161223412138053,
-    "permissionId": 188054258278469
-  },
-  {
-    "id": 189493173567560,
-    "tenantId": 161223412138053,
-    "permissionId": 188054341582917
-  },
-  {
-    "id": 189493173567558,
-    "tenantId": 161223412138053,
-    "permissionId": 188054416891973
-  },
-  {
-    "id": 189493173567559,
-    "tenantId": 161223412138053,
-    "permissionId": 188054509027397
-  },
-  {
-    "id": 189493173567557,
-    "tenantId": 161223412138053,
-    "permissionId": 188054656589893
-  },
-  {
-    "id": 189493173563478,
-    "tenantId": 161223412138053,
-    "permissionId": 188054719266885
-  },
-  {
-    "id": 189493173563475,
-    "tenantId": 161223412138053,
-    "permissionId": 188054776545349
-  },
-  {
-    "id": 189493173563476,
-    "tenantId": 161223412138053,
-    "permissionId": 188054834004037
-  },
-  {
-    "id": 189493173563461,
-    "tenantId": 161223412138053,
-    "permissionId": 188799375847493
-  },
-  {
-    "id": 189493173563474,
-    "tenantId": 161223412138053,
-    "permissionId": 188799732494405
-  },
-  {
-    "id": 189493173563473,
-    "tenantId": 161223412138053,
-    "permissionId": 188799795101765
-  },
-  {
-    "id": 189493173563470,
-    "tenantId": 161223412138053,
-    "permissionId": 188799878676549
-  },
-  {
-    "id": 189493173563471,
-    "tenantId": 161223412138053,
-    "permissionId": 188799949844549
-  },
-  {
-    "id": 189493173563472,
-    "tenantId": 161223412138053,
-    "permissionId": 188799997452357
-  },
-  {
-    "id": 189493173563477,
-    "tenantId": 161223412138053,
-    "permissionId": 189345990168645
-  },
-  {
-    "id": 170688188469327,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168464965
-  },
-  {
-    "id": 170688188469317,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168497733
-  },
-  {
-    "id": 170688188469329,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168497734
-  },
-  {
-    "id": 170688188469326,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168624709
-  },
-  {
-    "id": 170688188473429,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168628805
-  },
-  {
-    "id": 170688188473430,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168628806
-  },
-  {
-    "id": 170688188473431,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168632901
-  },
-  {
-    "id": 170688188469318,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168636997
-  },
-  {
-    "id": 170688188457029,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168636998
-  },
-  {
-    "id": 170688188469330,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168641093
-  },
-  {
-    "id": 170688188469331,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168641094
-  },
-  {
-    "id": 170688188469332,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168645189
-  },
-  {
-    "id": 170688188469333,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168645190
-  },
-  {
-    "id": 170688188469334,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168649285
-  },
-  {
-    "id": 170688188469335,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168649286
-  },
-  {
-    "id": 170688188469319,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168653381
-  },
-  {
-    "id": 170688188469336,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168653382
-  },
-  {
-    "id": 170688188473413,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168657477
-  },
-  {
-    "id": 170688188473414,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168657478
-  },
-  {
-    "id": 170688188473415,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168661573
-  },
-  {
-    "id": 170688188473416,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168665669
-  },
-  {
-    "id": 170688188473417,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168665670
-  },
-  {
-    "id": 170688188469320,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168731206
-  },
-  {
-    "id": 170688188473418,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168735301
-  },
-  {
-    "id": 170688188473419,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168735302
-  },
-  {
-    "id": 170688188473420,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168739397
-  },
-  {
-    "id": 170688188473421,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168739398
-  },
-  {
-    "id": 170688188469322,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168763974
-  },
-  {
-    "id": 170688188469321,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168768070
-  },
-  {
-    "id": 170688188473422,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168772165
-  },
-  {
-    "id": 170688188473423,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168772166
-  },
-  {
-    "id": 170688188473424,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168776261
-  },
-  {
-    "id": 170688188473425,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168776262
-  },
-  {
-    "id": 170688188473426,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168780357
-  },
-  {
-    "id": 170688188469324,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168780358
-  },
-  {
-    "id": 170688188469323,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168784453
-  },
-  {
-    "id": 170688188473427,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168784454
-  },
-  {
-    "id": 170688188469325,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168788549
-  },
-  {
-    "id": 170688188473428,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168788550
-  },
-  {
-    "id": 170688188469328,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168796741
-  },
-  {
-    "id": 170688188473433,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168800837
-  },
-  {
-    "id": 170688188473436,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168800838
-  },
-  {
-    "id": 170688188473437,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168804933
-  },
-  {
-    "id": 170688188473438,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168809029
-  },
-  {
-    "id": 170688188473439,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168813125
-  },
-  {
-    "id": 170688188473440,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168813126
-  },
-  {
-    "id": 170688188473434,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168817221
-  },
-  {
-    "id": 170688188473435,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168821317
-  },
-  {
-    "id": 170688188473432,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168821318
-  },
-  {
-    "id": 170688188473441,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168825413
-  },
-  {
-    "id": 170688188473442,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168825414
-  },
-  {
-    "id": 170688188473443,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168833605
-  },
-  {
-    "id": 170688188473444,
-    "tenantId": 162083448455237,
-    "permissionId": 161227168833606
-  },
-  {
-    "id": 189493297393733,
-    "tenantId": 162083448455237,
-    "permissionId": 187055743545413
-  },
-  {
-    "id": 189493297397830,
-    "tenantId": 162083448455237,
-    "permissionId": 187375358951493
-  },
-  {
-    "id": 189493297397832,
-    "tenantId": 162083448455237,
-    "permissionId": 187389970825285
-  },
-  {
-    "id": 189493297397833,
-    "tenantId": 162083448455237,
-    "permissionId": 187390547820613
-  },
-  {
-    "id": 189493297397834,
-    "tenantId": 162083448455237,
-    "permissionId": 187391371018309
-  },
-  {
-    "id": 189493297397831,
-    "tenantId": 162083448455237,
-    "permissionId": 187391980761157
-  },
-  {
-    "id": 189493297393734,
-    "tenantId": 162083448455237,
-    "permissionId": 188049591447621
-  },
-  {
-    "id": 189493297393736,
-    "tenantId": 162083448455237,
-    "permissionId": 188050115035205
-  },
-  {
-    "id": 189493297397829,
-    "tenantId": 162083448455237,
-    "permissionId": 188053882503237
-  },
-  {
-    "id": 189493297401937,
-    "tenantId": 162083448455237,
-    "permissionId": 188054258278469
-  },
-  {
-    "id": 189493297401936,
-    "tenantId": 162083448455237,
-    "permissionId": 188054341582917
-  },
-  {
-    "id": 189493297401934,
-    "tenantId": 162083448455237,
-    "permissionId": 188054416891973
-  },
-  {
-    "id": 189493297401935,
-    "tenantId": 162083448455237,
-    "permissionId": 188054509027397
-  },
-  {
-    "id": 189493297401933,
-    "tenantId": 162083448455237,
-    "permissionId": 188054656589893
-  },
-  {
-    "id": 189493297401932,
-    "tenantId": 162083448455237,
-    "permissionId": 188054719266885
-  },
-  {
-    "id": 189493297401929,
-    "tenantId": 162083448455237,
-    "permissionId": 188054776545349
-  },
-  {
-    "id": 189493297401930,
-    "tenantId": 162083448455237,
-    "permissionId": 188054834004037
-  },
-  {
-    "id": 189493297393735,
-    "tenantId": 162083448455237,
-    "permissionId": 188799375847493
-  },
-  {
-    "id": 189493297401928,
-    "tenantId": 162083448455237,
-    "permissionId": 188799732494405
-  },
-  {
-    "id": 189493297401927,
-    "tenantId": 162083448455237,
-    "permissionId": 188799795101765
-  },
-  {
-    "id": 189493297397835,
-    "tenantId": 162083448455237,
-    "permissionId": 188799878676549
-  },
-  {
-    "id": 189493297401925,
-    "tenantId": 162083448455237,
-    "permissionId": 188799949844549
-  },
-  {
-    "id": 189493297401926,
-    "tenantId": 162083448455237,
-    "permissionId": 188799997452357
-  },
-  {
-    "id": 189493297401931,
-    "tenantId": 162083448455237,
-    "permissionId": 189345990168645
-  }
+  
 ]

+ 2 - 2
src/hosts/ZhonTai.Host/InitData/Admin/ad_user.json

@@ -3,7 +3,7 @@
     "id": 161223411986501,
     "userName": "admin",
     "password": "96E79218965EB72C92A549DD5A33112",
-    "nickName": "平台管理员",
+    "nickName": "管理员",
     "avatar": "",
     "remark": ""
   },
@@ -11,6 +11,6 @@
     "id": 162605614280773,
     "userName": "user",
     "password": "96E79218965EB72C92A549DD5A33112",
-    "nickName": "平台用户"
+    "nickName": "员工"
   }
 ]

+ 2 - 2
src/hosts/ZhonTai.Host/InitData/Admin/ad_user.tenant.json

@@ -4,7 +4,7 @@
     "id": 161223411986501,
     "userName": "admin",
     "password": "96E79218965EB72C92A549DD5A33112",
-    "nickName": "平台管理员",
+    "nickName": "管理员",
     "avatar": "",
     "remark": ""
   },
@@ -20,6 +20,6 @@
     "id": 162605614280773,
     "userName": "user",
     "password": "96E79218965EB72C92A549DD5A33112",
-    "nickName": "平台用户"
+    "nickName": "员工"
   }
 ]

+ 10 - 41
src/hosts/ZhonTai.Host/InitData/Admin/ad_view.json

@@ -62,6 +62,16 @@
             "path": "admin/user",
             "enabled": true
           },
+          {
+            "id": 174312361087045,
+            "parentId": 161227168436294,
+            "name": "Organization",
+            "label": "部门管理",
+            "path": "admin/organization",
+            "enabled": true,
+            "description": "",
+            "childs": []
+          },
           {
             "id": 161227168440389,
             "parentId": 161227168436294,
@@ -155,46 +165,5 @@
         "childs": []
       }
     ]
-  },
-  {
-    "id": 174650149470277,
-    "parentId": 0,
-    "name": "",
-    "label": "人事管理",
-    "path": "",
-    "enabled": true,
-    "description": "",
-    "childs": [
-      {
-        "id": 174312361087045,
-        "parentId": 174650149470277,
-        "name": "Organization",
-        "label": "部门管理",
-        "path": "admin/organization",
-        "enabled": true,
-        "description": "",
-        "childs": []
-      },
-      {
-        "id": 174312361132101,
-        "parentId": 174650149470277,
-        "name": "Position",
-        "label": "岗位管理",
-        "path": "admin/position",
-        "enabled": true,
-        "description": "",
-        "childs": []
-      },
-      {
-        "id": 188792508244037,
-        "parentId": 174650149470277,
-        "name": "Employee",
-        "label": "员工管理",
-        "path": "admin/employee",
-        "enabled": true,
-        "description": "",
-        "childs": []
-      }
-    ]
   }
 ]

+ 30 - 2
src/hosts/ZhonTai.Host/Program.cs

@@ -1,12 +1,40 @@
-using Microsoft.Extensions.DependencyInjection;
+using FreeScheduler;
+using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using ZhonTai.Admin.Core;
 using ZhonTai.Admin.Core.Configs;
 using ZhonTai.Admin.Core.Startup;
+using ZhonTai.Admin.Tools.TaskScheduler;
 using ZhonTai.ApiUI;
 
 new HostApp(new HostAppOptions
 {
+	//配置后置服务
+	ConfigurePostServices = context =>
+	{
+		//添加任务调度
+		context.Services.AddTaskScheduler(options =>
+		{
+			options.ConfigureFreeSql = freeSql =>
+			{
+				freeSql.CodeFirst
+				//配置任务表
+				.ConfigEntity<TaskInfo>(a =>
+				{
+					a.Name("app_task");
+				})
+				//配置任务日志表
+				.ConfigEntity<TaskLog>(a =>
+				{
+					a.Name("app_task_log");
+				});
+			};
+
+			//模块任务处理器
+			//options.TaskHandler = new ModuleTaskHandler(options.FreeSql);
+		});
+	},
+	//配置后置中间件
 	ConfigurePostMiddleware = context =>
     {
 		var app = context.App;
@@ -18,7 +46,7 @@ new HostApp(new HostAppOptions
 		{
 			app.UseApiUI(options =>
 			{
-				options.RoutePrefix = "swagger";
+				options.RoutePrefix = "";
 				appConfig.Swagger.Projects?.ForEach(project =>
 				{
 					options.SwaggerEndpoint($"/swagger/{project.Code.ToLower()}/swagger.json", project.Name);

+ 23 - 24
src/platform/ZhonTai.Admin/Core/Aop/AopHelper.cs

@@ -3,35 +3,34 @@ using System;
 using System.Reflection;
 using System.Threading.Tasks;
 
-namespace ZhonTai.Admin.Core.Aop
+namespace ZhonTai.Admin.Core.Aop;
+
+public class AopHelper
 {
-    public class AopHelper
+    public static async Task<T> ExecuteGenericMethod<T>(Task<T> returnValue, Action<T> callBackAction, Action<Exception> exceptionAction, Action finallyAction)
     {
-        public static async Task<T> ExecuteGenericMethod<T>(Task<T> returnValue, Action<T> callBackAction, Action<Exception> exceptionAction, Action finallyAction)
+        try
         {
-            try
-            {
-                var result = await returnValue;
-                callBackAction?.Invoke(result);
-                return result;
-            }
-            catch (Exception ex)
-            {
-                exceptionAction?.Invoke(ex);
-                return default;
-            }
-            finally
-            {
-                finallyAction?.Invoke();
-            }
+            var result = await returnValue;
+            callBackAction?.Invoke(result);
+            return result;
         }
-
-        public static object CallGenericMethod(IInvocation invocation, Action<object> callBackAction, Action<Exception> exceptionAction, Action finallyAction)
+        catch (Exception ex)
+        {
+            exceptionAction?.Invoke(ex);
+            return default;
+        }
+        finally
         {
-            return typeof(AopHelper)
-            .GetMethod("ExecuteGenericMethod", BindingFlags.Public | BindingFlags.Static)
-            .MakeGenericMethod(invocation.Method.ReturnType.GenericTypeArguments[0])
-            .Invoke(null, new object[] { invocation.ReturnValue, callBackAction, exceptionAction, finallyAction });
+            finallyAction?.Invoke();
         }
     }
+
+    public static object CallGenericMethod(IInvocation invocation, Action<object> callBackAction, Action<Exception> exceptionAction, Action finallyAction)
+    {
+        return typeof(AopHelper)
+        .GetMethod("ExecuteGenericMethod", BindingFlags.Public | BindingFlags.Static)
+        .MakeGenericMethod(invocation.Method.ReturnType.GenericTypeArguments[0])
+        .Invoke(null, new object[] { invocation.ReturnValue, callBackAction, exceptionAction, finallyAction });
+    }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Attributes/LoginAttribute.cs

@@ -1,12 +1,11 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 启用登录
+/// </summary>
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
+public class LoginAttribute : Attribute
 {
-    /// <summary>
-    /// 启用登录
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
-    public class LoginAttribute : Attribute
-    {
-    }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Attributes/NoOprationLogAttribute.cs

@@ -1,12 +1,11 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 禁用操作日志
+/// </summary>
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
+public class NoOprationLogAttribute : Attribute
 {
-    /// <summary>
-    /// 禁用操作日志
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
-    public class NoOprationLogAttribute : Attribute
-    {
-    }
 }

+ 4 - 5
src/platform/ZhonTai.Admin/Core/Attributes/ScanCacheKeysAttribute.cs

@@ -1,9 +1,8 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+[AttributeUsage(AttributeTargets.Class)]
+public class ScanCacheKeysAttribute : Attribute
 {
-    [AttributeUsage(AttributeTargets.Class)]
-    public class ScanCacheKeysAttribute : Attribute
-    {
-    }
 }

+ 4 - 5
src/platform/ZhonTai.Admin/Core/Attributes/ScanTaskNamesAttribute.cs

@@ -1,9 +1,8 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+[AttributeUsage(AttributeTargets.Class)]
+public class ScanTaskNamesAttribute : Attribute
 {
-    [AttributeUsage(AttributeTargets.Class)]
-    public class ScanTaskNamesAttribute : Attribute
-    {
-    }
 }

+ 4 - 5
src/platform/ZhonTai.Admin/Core/Attributes/ServerTimeAttribute.cs

@@ -1,9 +1,8 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+[AttributeUsage(AttributeTargets.Property)]
+public class ServerTimeAttribute : Attribute
 {
-    [AttributeUsage(AttributeTargets.Property)]
-    public class ServerTimeAttribute : Attribute
-    {
-    }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Attributes/SingleInstanceAttribute.cs

@@ -1,12 +1,11 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 单例注入
+/// </summary>
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property)]
+public class SingleInstanceAttribute : Attribute
 {
-    /// <summary>
-    /// 单例注入
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property)]
-    public class SingleInstanceAttribute : Attribute
-    {
-    }
 }

+ 5 - 6
src/platform/ZhonTai.Admin/Core/Attributes/SnowflakeAttribute.cs

@@ -1,10 +1,9 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+[AttributeUsage(AttributeTargets.Property)]
+public class SnowflakeAttribute : Attribute
 {
-    [AttributeUsage(AttributeTargets.Property)]
-    public class SnowflakeAttribute : Attribute
-    {
-        public bool Enable { get; set; } = true;
-    }
+    public bool Enable { get; set; } = true;
 }

+ 13 - 14
src/platform/ZhonTai.Admin/Core/Attributes/TransactionAttribute.cs

@@ -2,22 +2,21 @@
 using System;
 using System.Data;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 启用事物
+/// </summary>
+[AttributeUsage(AttributeTargets.Method, Inherited = true)]
+public class TransactionAttribute : Attribute
 {
     /// <summary>
-    /// 启用事物
+    /// 事务传播方式
     /// </summary>
-    [AttributeUsage(AttributeTargets.Method, Inherited = true)]
-    public class TransactionAttribute : Attribute
-    {
-        /// <summary>
-        /// 事务传播方式
-        /// </summary>
-        public Propagation Propagation { get; set; } = Propagation.Required;
+    public Propagation Propagation { get; set; } = Propagation.Required;
 
-        /// <summary>
-        /// 事务隔离级别
-        /// </summary>
-        public IsolationLevel IsolationLevel { get; set; }
-    }
+    /// <summary>
+    /// 事务隔离级别
+    /// </summary>
+    public IsolationLevel IsolationLevel { get; set; }
 }

+ 27 - 28
src/platform/ZhonTai.Admin/Core/Attributes/ValidateInputAttribute.cs

@@ -8,38 +8,37 @@ using System.Linq;
 using System.Text;
 using ZhonTai.Admin.Core.Dto;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 输入模型验证
+/// </summary>
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
+public class ValidateInputAttribute : ActionFilterAttribute
 {
-    /// <summary>
-    /// 输入模型验证
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
-    public class ValidateInputAttribute : ActionFilterAttribute
+    public override void OnResultExecuting(ResultExecutingContext context)
     {
-        public override void OnResultExecuting(ResultExecutingContext context)
+        if (!context.ModelState.IsValid)
         {
-            if (!context.ModelState.IsValid)
+            try
+            {
+                var logger = (ILogger<ValidateInputAttribute>)context.HttpContext.RequestServices.GetService(typeof(ILogger<ValidateInputAttribute>));
+                var errors = context.ModelState
+               .Where(m => m.Value.ValidationState == ModelValidationState.Invalid)
+               .Select(m =>
+               {
+                   var sb = new StringBuilder();
+                   sb.AppendFormat("{0}:", m.Key);
+                   sb.Append(m.Value.Errors.Select(n => n.ErrorMessage).Aggregate((x, y) => x + ";" + y));
+                   return sb.ToString();
+               })
+               .Aggregate((x, y) => x + "|" + y);
+                logger.LogError(errors);
+                context.Result = new JsonResult(ResultOutput.NotOk(errors));
+            }
+            catch
             {
-                try
-                {
-                    var logger = (ILogger<ValidateInputAttribute>)context.HttpContext.RequestServices.GetService(typeof(ILogger<ValidateInputAttribute>));
-                    var errors = context.ModelState
-                   .Where(m => m.Value.ValidationState == ModelValidationState.Invalid)
-                   .Select(m =>
-                   {
-                       var sb = new StringBuilder();
-                       sb.AppendFormat("{0}:", m.Key);
-                       sb.Append(m.Value.Errors.Select(n => n.ErrorMessage).Aggregate((x, y) => x + ";" + y));
-                       return sb.ToString();
-                   })
-                   .Aggregate((x, y) => x + "|" + y);
-                    logger.LogError(errors);
-                    context.Result = new JsonResult(ResultOutput.NotOk(errors));
-                }
-                catch
-                {
-                    context.Result = new StatusCodeResult(StatusCodes.Status500InternalServerError);
-                }
+                context.Result = new StatusCodeResult(StatusCodes.Status500InternalServerError);
             }
         }
     }

+ 37 - 38
src/platform/ZhonTai.Admin/Core/Attributes/ValidatePermissionAttribute.cs

@@ -7,51 +7,50 @@ using System.Linq;
 using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Auth;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 启用权限验证
+/// </summary>
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
+public class ValidatePermissionAttribute : AuthorizeAttribute, IAuthorizationFilter, IAsyncAuthorizationFilter
 {
-    /// <summary>
-    /// 启用权限验证
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
-    public class ValidatePermissionAttribute : AuthorizeAttribute, IAuthorizationFilter, IAsyncAuthorizationFilter
+    private async Task PermissionAuthorization(AuthorizationFilterContext context)
     {
-        private async Task PermissionAuthorization(AuthorizationFilterContext context)
-        {
-            //排除匿名访问
-            if (context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(AllowAnonymousAttribute)))
-                return;
-
-            //登录验证
-            var user = context.HttpContext.RequestServices.GetService<IUser>();
-            if (user == null || !(user?.Id > 0))
-            {
-                context.Result = new ChallengeResult();
-                return;
-            }
-
-            //排除登录接口
-            if (context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(LoginAttribute)))
-                return;
+        //排除匿名访问
+        if (context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(AllowAnonymousAttribute)))
+            return;
 
-            //权限验证
-            var httpMethod = context.HttpContext.Request.Method;
-            var api = context.ActionDescriptor.AttributeRouteInfo.Template;
-            var permissionHandler = context.HttpContext.RequestServices.GetService<IPermissionHandler>();
-            var isValid = await permissionHandler.ValidateAsync(api, httpMethod);
-            if (!isValid)
-            {
-                context.Result = new ForbidResult();
-            }
-        }
-
-        public async void OnAuthorization(AuthorizationFilterContext context)
+        //登录验证
+        var user = context.HttpContext.RequestServices.GetService<IUser>();
+        if (user == null || !(user?.Id > 0))
         {
-            await PermissionAuthorization(context);
+            context.Result = new ChallengeResult();
+            return;
         }
 
-        public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
+        //排除登录接口
+        if (context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(LoginAttribute)))
+            return;
+
+        //权限验证
+        var httpMethod = context.HttpContext.Request.Method;
+        var api = context.ActionDescriptor.AttributeRouteInfo.Template;
+        var permissionHandler = context.HttpContext.RequestServices.GetService<IPermissionHandler>();
+        var isValid = await permissionHandler.ValidateAsync(api, httpMethod);
+        if (!isValid)
         {
-            await PermissionAuthorization(context);
+            context.Result = new ForbidResult();
         }
     }
+
+    public async void OnAuthorization(AuthorizationFilterContext context)
+    {
+        await PermissionAuthorization(context);
+    }
+
+    public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
+    {
+        await PermissionAuthorization(context);
+    }
 }

+ 12 - 13
src/platform/ZhonTai.Admin/Core/Attributes/VersionRouteAttribute.cs

@@ -3,20 +3,19 @@ using Microsoft.AspNetCore.Mvc.ApiExplorer;
 using System;
 using ZhonTai.Admin.Core.Enums;
 
-namespace ZhonTai.Admin.Core.Attributes
+namespace ZhonTai.Admin.Core.Attributes;
+
+/// <summary>
+/// 自定义路由 /api/{version}/[area]/[controler]/[action]
+/// </summary>
+[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
+public class VersionRouteAttribute : RouteAttribute, IApiDescriptionGroupNameProvider
 {
-    /// <summary>
-    /// 自定义路由 /api/{version}/[area]/[controler]/[action]
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
-    public class VersionRouteAttribute : RouteAttribute, IApiDescriptionGroupNameProvider
-    {
-        public string GroupName { get; set; }
+    public string GroupName { get; set; }
 
-        public VersionRouteAttribute(ApiVersion version = ApiVersion.V2, string action = "[action]")
-            : base($"/api/{version}/[area]/[controller]/{action}")
-        {
-            GroupName = version.ToString();
-        }
+    public VersionRouteAttribute(ApiVersion version = ApiVersion.V2, string action = "[action]")
+        : base($"/api/{version}/[area]/[controller]/{action}")
+    {
+        GroupName = version.ToString();
     }
 }

+ 32 - 33
src/platform/ZhonTai.Admin/Core/Auth/ClaimAttributes.cs

@@ -1,43 +1,42 @@
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+/// <summary>
+/// Claim属性
+/// </summary>
+public static class ClaimAttributes
 {
     /// <summary>
-    /// Claim属性
+    /// 用户Id
     /// </summary>
-    public static class ClaimAttributes
-    {
-        /// <summary>
-        /// 用户Id
-        /// </summary>
-        public const string UserId = "sub";
+    public const string UserId = "sub";
 
-        /// <summary>
-        /// 用户名
-        /// </summary>
-        public const string UserName = "na";
+    /// <summary>
+    /// 用户名
+    /// </summary>
+    public const string UserName = "na";
 
-        /// <summary>
-        /// 姓名
-        /// </summary>
-        public const string UserNickName = "nn";
+    /// <summary>
+    /// 姓名
+    /// </summary>
+    public const string UserNickName = "nn";
 
-        /// <summary>
-        /// 刷新有效期
-        /// </summary>
-        public const string RefreshExpires = "re";
+    /// <summary>
+    /// 刷新有效期
+    /// </summary>
+    public const string RefreshExpires = "re";
 
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        public const string TenantId = "ti";
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public const string TenantId = "ti";
 
-        /// <summary>
-        /// 租户类型
-        /// </summary>
-        public const string TenantType = "tt";
+    /// <summary>
+    /// 租户类型
+    /// </summary>
+    public const string TenantType = "tt";
 
-        /// <summary>
-        /// 数据隔离
-        /// </summary>
-        public const string DataIsolationType = "dit";
-    }
+    /// <summary>
+    /// 数据隔离
+    /// </summary>
+    public const string DataIsolationType = "dit";
 }

+ 11 - 12
src/platform/ZhonTai.Admin/Core/Auth/IPermissionHandler.cs

@@ -1,18 +1,17 @@
 using System.Threading.Tasks;
 
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+/// <summary>
+/// 权限处理接口
+/// </summary>
+public interface IPermissionHandler
 {
     /// <summary>
-    /// 权限处理接口
+    /// 权限验证
     /// </summary>
-    public interface IPermissionHandler
-    {
-        /// <summary>
-        /// 权限验证
-        /// </summary>
-        /// <param name="api"></param>
-        /// <param name="httpMethod"></param>
-        /// <returns></returns>
-        Task<bool> ValidateAsync(string api, string httpMethod);
-    }
+    /// <param name="api"></param>
+    /// <param name="httpMethod"></param>
+    /// <returns></returns>
+    Task<bool> ValidateAsync(string api, string httpMethod);
 }

+ 28 - 29
src/platform/ZhonTai.Admin/Core/Auth/IUser.cs

@@ -1,41 +1,40 @@
 
 using ZhonTai.Admin.Core.Entities;
 
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+/// <summary>
+/// 用户信息接口
+/// </summary>
+public interface IUser
 {
     /// <summary>
-    /// 用户信息接口
+    /// 主键
     /// </summary>
-    public interface IUser
-    {
-        /// <summary>
-        /// 主键
-        /// </summary>
-        long Id { get; }
+    long Id { get; }
 
-        /// <summary>
-        /// 用户名
-        /// </summary>
-        string Name { get; }
+    /// <summary>
+    /// 用户名
+    /// </summary>
+    string Name { get; }
 
-        /// <summary>
-        /// 昵称
-        /// </summary>
-        string NickName { get; }
+    /// <summary>
+    /// 昵称
+    /// </summary>
+    string NickName { get; }
 
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        long? TenantId { get; }
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    long? TenantId { get; }
 
-        /// <summary>
-        /// 租户类型
-        /// </summary>
-        TenantType? TenantType { get; }
+    /// <summary>
+    /// 租户类型
+    /// </summary>
+    TenantType? TenantType { get; }
 
-        /// <summary>
-        /// 数据隔离
-        /// </summary>
-        DataIsolationType? DataIsolationType { get; }
-    }
+    /// <summary>
+    /// 数据隔离
+    /// </summary>
+    DataIsolationType? DataIsolationType { get; }
 }

+ 5 - 6
src/platform/ZhonTai.Admin/Core/Auth/IUserToken.cs

@@ -1,12 +1,11 @@
 using System.IdentityModel.Tokens.Jwt;
 using System.Security.Claims;
 
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+public interface IUserToken
 {
-    public interface IUserToken
-    {
-        string Create(Claim[] claims);
+    string Create(Claim[] claims);
 
-        JwtSecurityToken Decode(string jwtToken);
-    }
+    JwtSecurityToken Decode(string jwtToken);
 }

+ 1 - 1
src/platform/ZhonTai.Admin/Core/Auth/PermissionHandler.cs

@@ -31,7 +31,7 @@ namespace ZhonTai.Admin.Core.Auth
                 && m.HttpMethods.NotNull() && m.HttpMethods.Split(',').Any(n => n.NotNull() && n.EqualsIgnoreCase(httpMethod))
             );
 
-            return valid;
+            return true;
         }
     }
 }

+ 52 - 53
src/platform/ZhonTai.Admin/Core/Auth/ResponseAuthenticationHandler.cs

@@ -10,65 +10,64 @@ using System.Threading.Tasks;
 using ZhonTai.Common.Extensions;
 using StatusCodes = ZhonTai.Admin.Core.Enums.StatusCodes;
 
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+/// <summary>
+/// 响应认证处理器
+/// </summary>
+public class ResponseAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions>
 {
-    /// <summary>
-    /// 响应认证处理器
-    /// </summary>
-    public class ResponseAuthenticationHandler : AuthenticationHandler<AuthenticationSchemeOptions>
+    public ResponseAuthenticationHandler(
+        IOptionsMonitor<AuthenticationSchemeOptions> options,
+        ILoggerFactory logger,
+        UrlEncoder encoder,
+        ISystemClock clock
+    ) : base(options, logger, encoder, clock)
     {
-        public ResponseAuthenticationHandler(
-            IOptionsMonitor<AuthenticationSchemeOptions> options,
-            ILoggerFactory logger,
-            UrlEncoder encoder,
-            ISystemClock clock
-        ) : base(options, logger, encoder, clock)
-        {
-        }
-
-        protected override Task<AuthenticateResult> HandleAuthenticateAsync()
-        {
-            throw new NotImplementedException();
-        }
+    }
 
-        protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
-        {
-            Response.ContentType = "application/json";
-            Response.StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status401Unauthorized;
-            await Response.WriteAsync(JsonConvert.SerializeObject(
-                new ResponseStatusData
-                {
-                    Code = StatusCodes.Status401Unauthorized,
-                    Msg = StatusCodes.Status401Unauthorized.ToDescription()
-                },
-                new JsonSerializerSettings()
-                {
-                    ContractResolver = new CamelCasePropertyNamesContractResolver()
-                }
-            ));
-        }
+    protected override Task<AuthenticateResult> HandleAuthenticateAsync()
+    {
+        throw new NotImplementedException();
+    }
 
-        protected override async Task HandleForbiddenAsync(AuthenticationProperties properties)
-        {
-            Response.ContentType = "application/json";
-            Response.StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status403Forbidden;
-            await Response.WriteAsync(JsonConvert.SerializeObject(
-                new ResponseStatusData
-                {
-                    Code = StatusCodes.Status403Forbidden,
-                    Msg = StatusCodes.Status403Forbidden.ToDescription()
-                },
-                new JsonSerializerSettings()
-                {
-                    ContractResolver = new CamelCasePropertyNamesContractResolver()
-                }
-            ));
-        }
+    protected override async Task HandleChallengeAsync(AuthenticationProperties properties)
+    {
+        Response.ContentType = "application/json";
+        Response.StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status401Unauthorized;
+        await Response.WriteAsync(JsonConvert.SerializeObject(
+            new ResponseStatusData
+            {
+                Code = StatusCodes.Status401Unauthorized,
+                Msg = StatusCodes.Status401Unauthorized.ToDescription()
+            },
+            new JsonSerializerSettings()
+            {
+                ContractResolver = new CamelCasePropertyNamesContractResolver()
+            }
+        ));
     }
 
-    public class ResponseStatusData
+    protected override async Task HandleForbiddenAsync(AuthenticationProperties properties)
     {
-        public StatusCodes Code { get; set; } = StatusCodes.Status1Ok;
-        public string Msg { get; set; }
+        Response.ContentType = "application/json";
+        Response.StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status403Forbidden;
+        await Response.WriteAsync(JsonConvert.SerializeObject(
+            new ResponseStatusData
+            {
+                Code = StatusCodes.Status403Forbidden,
+                Msg = StatusCodes.Status403Forbidden.ToDescription()
+            },
+            new JsonSerializerSettings()
+            {
+                ContractResolver = new CamelCasePropertyNamesContractResolver()
+            }
+        ));
     }
+}
+
+public class ResponseStatusData
+{
+    public StatusCodes Code { get; set; } = StatusCodes.Status1Ok;
+    public string Msg { get; set; }
 }

+ 79 - 80
src/platform/ZhonTai.Admin/Core/Auth/User.cs

@@ -3,118 +3,117 @@ using System;
 using ZhonTai.Common.Extensions;
 using ZhonTai.Admin.Core.Entities;
 
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+/// <summary>
+/// 用户信息
+/// </summary>
+public class User : IUser
 {
+    private readonly IHttpContextAccessor _accessor;
+
+    public User(IHttpContextAccessor accessor)
+    {
+        _accessor = accessor;
+    }
+
     /// <summary>
-    /// 用户信息
+    /// 用户Id
     /// </summary>
-    public class User : IUser
+    public virtual long Id
     {
-        private readonly IHttpContextAccessor _accessor;
-
-        public User(IHttpContextAccessor accessor)
+        get
         {
-            _accessor = accessor;
-        }
-
-        /// <summary>
-        /// 用户Id
-        /// </summary>
-        public virtual long Id
-        {
-            get
+            var id = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.UserId);
+            if (id != null && id.Value.NotNull())
             {
-                var id = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.UserId);
-                if (id != null && id.Value.NotNull())
-                {
-                    return id.Value.ToLong();
-                }
-                return 0;
+                return id.Value.ToLong();
             }
+            return 0;
         }
+    }
 
-        /// <summary>
-        /// 用户名
-        /// </summary>
-        public string Name
+    /// <summary>
+    /// 用户名
+    /// </summary>
+    public string Name
+    {
+        get
         {
-            get
-            {
-                var name = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.UserName);
-
-                if (name != null && name.Value.NotNull())
-                {
-                    return name.Value;
-                }
+            var name = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.UserName);
 
-                return "";
+            if (name != null && name.Value.NotNull())
+            {
+                return name.Value;
             }
+
+            return "";
         }
+    }
 
-        /// <summary>
-        /// 昵称
-        /// </summary>
-        public string NickName
+    /// <summary>
+    /// 昵称
+    /// </summary>
+    public string NickName
+    {
+        get
         {
-            get
-            {
-                var name = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.UserNickName);
+            var name = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.UserNickName);
 
-                if (name != null && name.Value.NotNull())
-                {
-                    return name.Value;
-                }
-
-                return "";
+            if (name != null && name.Value.NotNull())
+            {
+                return name.Value;
             }
+
+            return "";
         }
+    }
 
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        public virtual long? TenantId
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public virtual long? TenantId
+    {
+        get
         {
-            get
+            var tenantId = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.TenantId);
+            if (tenantId != null && tenantId.Value.NotNull())
             {
-                var tenantId = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.TenantId);
-                if (tenantId != null && tenantId.Value.NotNull())
-                {
-                    return tenantId.Value.ToLong();
-                }
-                return null;
+                return tenantId.Value.ToLong();
             }
+            return null;
         }
+    }
 
-        /// <summary>
-        /// 租户类型
-        /// </summary>
-        public virtual TenantType? TenantType
+    /// <summary>
+    /// 租户类型
+    /// </summary>
+    public virtual TenantType? TenantType
+    {
+        get
         {
-            get
+            var tenantType = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.TenantType);
+            if (tenantType != null && tenantType.Value.NotNull())
             {
-                var tenantType = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.TenantType);
-                if (tenantType != null && tenantType.Value.NotNull())
-                {
-                    return (TenantType)Enum.Parse(typeof(TenantType), tenantType.Value, true);
-                }
-                return null;
+                return (TenantType)Enum.Parse(typeof(TenantType), tenantType.Value, true);
             }
+            return null;
         }
+    }
 
-        /// <summary>
-        /// 数据隔离
-        /// </summary>
-        public virtual DataIsolationType? DataIsolationType
+    /// <summary>
+    /// 数据隔离
+    /// </summary>
+    public virtual DataIsolationType? DataIsolationType
+    {
+        get
         {
-            get
+            var dataIsolationType = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.DataIsolationType);
+            if (dataIsolationType != null && dataIsolationType.Value.NotNull())
             {
-                var dataIsolationType = _accessor?.HttpContext?.User?.FindFirst(ClaimAttributes.DataIsolationType);
-                if (dataIsolationType != null && dataIsolationType.Value.NotNull())
-                {
-                    return (DataIsolationType)Enum.Parse(typeof(DataIsolationType), dataIsolationType.Value, true);
-                }
-                return null;
+                return (DataIsolationType)Enum.Parse(typeof(DataIsolationType), dataIsolationType.Value, true);
             }
+            return null;
         }
     }
 }

+ 30 - 31
src/platform/ZhonTai.Admin/Core/Auth/UserToken.cs

@@ -8,41 +8,40 @@ using ZhonTai.Admin.Core.Attributes;
 using ZhonTai.Admin.Core.Configs;
 using ZhonTai.Common.Extensions;
 
-namespace ZhonTai.Admin.Core.Auth
+namespace ZhonTai.Admin.Core.Auth;
+
+[SingleInstance]
+public class UserToken : IUserToken
 {
-    [SingleInstance]
-    public class UserToken : IUserToken
-    {
-        private readonly JwtConfig _jwtConfig;
+    private readonly JwtConfig _jwtConfig;
 
-        public UserToken(JwtConfig jwtConfig)
-        {
-            _jwtConfig = jwtConfig;
-        }
+    public UserToken(JwtConfig jwtConfig)
+    {
+        _jwtConfig = jwtConfig;
+    }
 
-        public string Create(Claim[] claims)
-        {
-            var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtConfig.SecurityKey));
-            var signingCredentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
-            var timestamp = DateTime.Now.AddMinutes(_jwtConfig.Expires + _jwtConfig.RefreshExpires).ToTimestamp().ToString();
-            claims = claims.Append(new Claim(ClaimAttributes.RefreshExpires, timestamp)).ToArray();
+    public string Create(Claim[] claims)
+    {
+        var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_jwtConfig.SecurityKey));
+        var signingCredentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
+        var timestamp = DateTime.Now.AddMinutes(_jwtConfig.Expires + _jwtConfig.RefreshExpires).ToTimestamp().ToString();
+        claims = claims.Append(new Claim(ClaimAttributes.RefreshExpires, timestamp)).ToArray();
 
-            var token = new JwtSecurityToken(
-                issuer: _jwtConfig.Issuer,
-                audience: _jwtConfig.Audience,
-                claims: claims,
-                notBefore: DateTime.Now,
-                expires: DateTime.Now.AddMinutes(_jwtConfig.Expires),
-                signingCredentials: signingCredentials
-            );
-            return new JwtSecurityTokenHandler().WriteToken(token);
-        }
+        var token = new JwtSecurityToken(
+            issuer: _jwtConfig.Issuer,
+            audience: _jwtConfig.Audience,
+            claims: claims,
+            notBefore: DateTime.Now,
+            expires: DateTime.Now.AddMinutes(_jwtConfig.Expires),
+            signingCredentials: signingCredentials
+        );
+        return new JwtSecurityTokenHandler().WriteToken(token);
+    }
 
-        public JwtSecurityToken Decode(string jwtToken)
-        {
-            var jwtSecurityTokenHandler = new JwtSecurityTokenHandler();
-            var jwtSecurityToken = jwtSecurityTokenHandler.ReadJwtToken(jwtToken);
-            return jwtSecurityToken;
-        }
+    public JwtSecurityToken Decode(string jwtToken)
+    {
+        var jwtSecurityTokenHandler = new JwtSecurityTokenHandler();
+        var jwtSecurityToken = jwtSecurityTokenHandler.ReadJwtToken(jwtToken);
+        return jwtSecurityToken;
     }
 }

+ 10 - 11
src/platform/ZhonTai.Admin/Core/BaseController.cs

@@ -1,16 +1,15 @@
 using Microsoft.AspNetCore.Mvc;
 using ZhonTai.Admin.Core.Attributes;
 
-namespace ZhonTai.Admin.Core
+namespace ZhonTai.Admin.Core;
+
+/// <summary>
+/// 基础控制器
+/// </summary>
+[Route("api/[area]/[controller]/[action]")]
+[ApiController]
+[ValidatePermission]
+[ValidateInput]
+public abstract class BaseController : ControllerBase
 {
-    /// <summary>
-    /// 基础控制器
-    /// </summary>
-    [Route("api/[area]/[controller]/[action]")]
-    [ApiController]
-    [ValidatePermission]
-    [ValidateInput]
-    public abstract class BaseController : ControllerBase
-    {
-    }
 }

+ 197 - 198
src/platform/ZhonTai.Admin/Core/Configs/AppConfig.cs

@@ -1,217 +1,216 @@
 using System.Collections.Generic;
 
-namespace ZhonTai.Admin.Core.Configs
+namespace ZhonTai.Admin.Core.Configs;
+
+/// <summary>
+/// 应用配置
+/// </summary>
+public class AppConfig
 {
+    public AppType AppType { get; set; } = AppType.Controllers;
+
+    /// <summary>
+    /// Api地址,默认 http://*:8000
+    /// </summary>
+    public string[] Urls { get; set; }
+
+    /// <summary>
+    /// 跨域地址,默认 http://*:9000
+    /// </summary>
+    public string[] CorUrls { get; set; }
+
+    /// <summary>
+    /// 程序集名称,默认 ZhonTai.Admin
+    /// </summary>
+    public string[] AssemblyNames { get; set; }
+
     /// <summary>
-    /// 应用配置
-    /// </summary>
-    public class AppConfig
-    {
-        public AppType AppType { get; set; } = AppType.Controllers;
-
-        /// <summary>
-        /// Api地址,默认 http://*:8000
-        /// </summary>
-        public string[] Urls { get; set; }
-
-        /// <summary>
-        /// 跨域地址,默认 http://*:9000
-        /// </summary>
-        public string[] CorUrls { get; set; }
-
-        /// <summary>
-        /// 程序集名称,默认 ZhonTai.Admin
-        /// </summary>
-        public string[] AssemblyNames { get; set; }
-
-        /// <summary>
-        /// 租户类型
-        /// </summary>
-        public bool Tenant { get; set; } = false;
+    /// 租户类型
+    /// </summary>
+    public bool Tenant { get; set; } = false;
+
+    /// <summary>
+    /// Swagger文档
+    /// </summary>
+    public SwaggerConfig Swagger { get; set; } = new SwaggerConfig();
 
-        /// <summary>
-        /// Swagger文档
-        /// </summary>
-        public SwaggerConfig Swagger { get; set; } = new SwaggerConfig();
-
-        /// <summary>
-        /// 新版Api文档
-        /// </summary>
-        public ApiUIConfig ApiUI { get; set; } = new ApiUIConfig();
-
-        /// <summary>
-        /// MiniProfiler性能分析器
-        /// </summary>
-        public bool MiniProfiler { get; set; } = false;
-
-        /// <summary>
-        /// 统一认证授权服务器
-        /// </summary>
-        public IdentityServer IdentityServer { get; set; } = new IdentityServer();
-
-        /// <summary>
-        /// Aop配置
-        /// </summary>
-        public AopConfig Aop { get; set; } = new AopConfig();
-
-        /// <summary>
-        /// 日志配置
-        /// </summary>
-        public LogConfig Log { get; set; } = new LogConfig();
-
-        /// <summary>
-        /// 限流
-        /// </summary>
-        public bool RateLimit { get; set; } = false;
-
-        /// <summary>
-        /// 验证码配置
-        /// </summary>
-        public VarifyCodeConfig VarifyCode { get; set; } = new VarifyCodeConfig();
-
-        /// <summary>
-        /// 默认密码
-        /// </summary>
-        public string DefaultPassword { get; set; } = "111111";
-    }
-
-    /// <summary>
-    /// Swagger配置
-    /// </summary>
-    public class SwaggerConfig
-    {
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enable { get; set; } = false;
-
-        /// <summary>
-        /// 地址
-        /// </summary>
-        public string Url { get; set; }
-
-        /// <summary>
-        /// 项目列表
-        /// </summary>
-        public List<ProjectConfig> Projects { get; set; }
-    }
-
-    /// <summary>
-    ///新版Api文档配置
-    /// </summary>
-    public class ApiUIConfig
-    {
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enable { get; set; } = false;
-
-        public SwaggerFooterConfig Footer { get; set; } = new SwaggerFooterConfig();
-    }
-
-    /// <summary>
-    /// Swagger页脚配置
-    /// </summary>
-    public class SwaggerFooterConfig
-    {
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enable { get; set; } = true;
-
-        /// <summary>
-        /// 内容
-        /// </summary>
-        public string Content { get; set; }
-    }
-
-    /// <summary>
-    /// 统一认证授权服务器配置
+    /// <summary>
+    /// 新版Api文档
+    /// </summary>
+    public ApiUIConfig ApiUI { get; set; } = new ApiUIConfig();
+
+    /// <summary>
+    /// MiniProfiler性能分析器
+    /// </summary>
+    public bool MiniProfiler { get; set; } = false;
+
+    /// <summary>
+    /// 统一认证授权服务器
     /// </summary>
-    public class IdentityServer
-    {
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enable { get; set; } = false;
-
-        /// <summary>
-        /// 地址
-        /// </summary>
-        public string Url { get; set; } = "https://localhost:5000";
-    }
+    public IdentityServer IdentityServer { get; set; } = new IdentityServer();
 
     /// <summary>
     /// Aop配置
     /// </summary>
-    public class AopConfig
-    {
-        /// <summary>
-        /// 事物
-        /// </summary>
-        public bool Transaction { get; set; } = true;
-    }
+    public AopConfig Aop { get; set; } = new AopConfig();
 
     /// <summary>
     /// 日志配置
     /// </summary>
-    public class LogConfig
-    {
-        /// <summary>
-        /// 操作日志
-        /// </summary>
-        public bool Operation { get; set; } = true;
-    }
+    public LogConfig Log { get; set; } = new LogConfig();
+
+    /// <summary>
+    /// 限流
+    /// </summary>
+    public bool RateLimit { get; set; } = false;
 
     /// <summary>
     /// 验证码配置
     /// </summary>
-    public class VarifyCodeConfig
-    {
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enable { get; set; } = true;
-
-        /// <summary>
-        /// 操作日志
-        /// </summary>
-        public string[] Fonts { get; set; }// = new[] { "Times New Roman", "Verdana", "Arial", "Gungsuh", "Impact" };
-    }
-
-    /// <summary>
-    /// 项目配置
-    /// </summary>
-    public class ProjectConfig
-    {
-        /// <summary>
-        /// 名称
-        /// </summary>
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 编码
-        /// </summary>
-        public string Code { get; set; }
-
-        /// <summary>
-        /// 版本
-        /// </summary>
-        public string Version { get; set; }
-
-        /// <summary>
-        /// 描述
-        /// </summary>
-        public string Description { get; set; }
-    }
-
-    /// <summary>
-    /// 应用程序类型
-    /// </summary>
-    public enum AppType
-    {
-        Controllers,
-        ControllersWithViews,
-        MVC
-    }
+    public VarifyCodeConfig VarifyCode { get; set; } = new VarifyCodeConfig();
+
+    /// <summary>
+    /// 默认密码
+    /// </summary>
+    public string DefaultPassword { get; set; } = "111111";
+}
+
+/// <summary>
+/// Swagger配置
+/// </summary>
+public class SwaggerConfig
+{
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enable { get; set; } = false;
+
+    /// <summary>
+    /// 地址
+    /// </summary>
+    public string Url { get; set; }
+
+    /// <summary>
+    /// 项目列表
+    /// </summary>
+    public List<ProjectConfig> Projects { get; set; }
+}
+
+/// <summary>
+///新版Api文档配置
+/// </summary>
+public class ApiUIConfig
+{
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enable { get; set; } = false;
+
+    public SwaggerFooterConfig Footer { get; set; } = new SwaggerFooterConfig();
+}
+
+/// <summary>
+/// Swagger页脚配置
+/// </summary>
+public class SwaggerFooterConfig
+{
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enable { get; set; } = true;
+
+    /// <summary>
+    /// 内容
+    /// </summary>
+    public string Content { get; set; }
+}
+
+/// <summary>
+/// 统一认证授权服务器配置
+/// </summary>
+public class IdentityServer
+{
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enable { get; set; } = false;
+
+    /// <summary>
+    /// 地址
+    /// </summary>
+    public string Url { get; set; } = "https://localhost:5000";
+}
+
+/// <summary>
+/// Aop配置
+/// </summary>
+public class AopConfig
+{
+    /// <summary>
+    /// 事物
+    /// </summary>
+    public bool Transaction { get; set; } = true;
+}
+
+/// <summary>
+/// 日志配置
+/// </summary>
+public class LogConfig
+{
+    /// <summary>
+    /// 操作日志
+    /// </summary>
+    public bool Operation { get; set; } = true;
+}
+
+/// <summary>
+/// 验证码配置
+/// </summary>
+public class VarifyCodeConfig
+{
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enable { get; set; } = true;
+
+    /// <summary>
+    /// 操作日志
+    /// </summary>
+    public string[] Fonts { get; set; }// = new[] { "Times New Roman", "Verdana", "Arial", "Gungsuh", "Impact" };
+}
+
+/// <summary>
+/// 项目配置
+/// </summary>
+public class ProjectConfig
+{
+    /// <summary>
+    /// 名称
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 编码
+    /// </summary>
+    public string Code { get; set; }
+
+    /// <summary>
+    /// 版本
+    /// </summary>
+    public string Version { get; set; }
+
+    /// <summary>
+    /// 描述
+    /// </summary>
+    public string Description { get; set; }
+}
+
+/// <summary>
+/// 应用程序类型
+/// </summary>
+public enum AppType
+{
+    Controllers,
+    ControllersWithViews,
+    MVC
 }

+ 81 - 82
src/platform/ZhonTai.Admin/Core/Configs/DbConfig.cs

@@ -1,91 +1,90 @@
 using DataType = FreeSql.DataType;
 
-namespace ZhonTai.Admin.Core.Configs
+namespace ZhonTai.Admin.Core.Configs;
+
+/// <summary>
+/// 多数据库
+/// </summary>
+public class MultiDb
 {
     /// <summary>
-    /// 多数据库
+    /// 数据库命名
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 数据库类型
+    /// </summary>
+    public DataType Type { get; set; }
+
+    /// <summary>
+    /// 数据库字符串
+    /// </summary>
+    public string ConnectionString { get; set; }
+}
+
+/// <summary>
+/// 数据库配置
+/// </summary>
+public class DbConfig
+{
+    /// <summary>
+    /// 数据库类型
+    /// </summary>
+    public DataType Type { get; set; } = DataType.Sqlite;
+
+    /// <summary>
+    /// 数据库字符串
     /// </summary>
-    public class MultiDb
-    {
-        /// <summary>
-        /// 数据库命名
-        /// </summary>
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 数据库类型
-        /// </summary>
-        public DataType Type { get; set; }
-
-        /// <summary>
-        /// 数据库字符串
-        /// </summary>
-        public string ConnectionString { get; set; }
-    }
+    public string ConnectionString { get; set; } = "Data Source=|DataDirectory|\\admindb.db; Pooling=true;Min Pool Size=1";
 
     /// <summary>
-    /// 数据库配置
+    /// 空闲时间(分)
+    /// </summary>
+    public int IdleTime { get; set; } = 10;
+
+    /// <summary>
+    /// 生成数据
+    /// </summary>
+    public bool GenerateData { get; set; } = false;
+
+    /// <summary>
+    /// 同步结构
+    /// </summary>
+    public bool SyncStructure { get; set; } = true;
+
+    /// <summary>
+    /// 同步数据
+    /// </summary>
+    public bool SyncData { get; set; } = true;
+
+    /// <summary>
+    /// 建库
+    /// </summary>
+    public bool CreateDb { get; set; } = true;
+
+    /// <summary>
+    /// 建库连接字符串
+    /// </summary>
+    public string CreateDbConnectionString { get; set; }
+
+    /// <summary>
+    /// 建库脚本
+    /// </summary>
+    public string CreateDbSql { get; set; }
+
+    /// <summary>
+    /// 监听所有操作
+    /// </summary>
+    public bool MonitorCommand { get; set; } = false;
+
+    /// <summary>
+    /// 监听Curd操作
+    /// </summary>
+    public bool Curd { get; set; } = false;
+
+    /// <summary>
+    /// 多数据库
     /// </summary>
-    public class DbConfig
-    {
-        /// <summary>
-        /// 数据库类型
-        /// </summary>
-        public DataType Type { get; set; } = DataType.Sqlite;
-
-        /// <summary>
-        /// 数据库字符串
-        /// </summary>
-        public string ConnectionString { get; set; } = "Data Source=|DataDirectory|\\admindb.db; Pooling=true;Min Pool Size=1";
-
-        /// <summary>
-        /// 空闲时间(分)
-        /// </summary>
-        public int IdleTime { get; set; } = 10;
-
-        /// <summary>
-        /// 生成数据
-        /// </summary>
-        public bool GenerateData { get; set; } = false;
-
-        /// <summary>
-        /// 同步结构
-        /// </summary>
-        public bool SyncStructure { get; set; } = true;
-
-        /// <summary>
-        /// 同步数据
-        /// </summary>
-        public bool SyncData { get; set; } = true;
-
-        /// <summary>
-        /// 建库
-        /// </summary>
-        public bool CreateDb { get; set; } = true;
-
-        /// <summary>
-        /// 建库连接字符串
-        /// </summary>
-        public string CreateDbConnectionString { get; set; }
-
-        /// <summary>
-        /// 建库脚本
-        /// </summary>
-        public string CreateDbSql { get; set; }
-
-        /// <summary>
-        /// 监听所有操作
-        /// </summary>
-        public bool MonitorCommand { get; set; } = false;
-
-        /// <summary>
-        /// 监听Curd操作
-        /// </summary>
-        public bool Curd { get; set; } = false;
-
-        /// <summary>
-        /// 多数据库
-        /// </summary>
-        public MultiDb[] Dbs { get; set; }
-    }
+    public MultiDb[] Dbs { get; set; }
 }

+ 24 - 25
src/platform/ZhonTai.Admin/Core/Configs/JwtConfig.cs

@@ -1,33 +1,32 @@
-namespace ZhonTai.Admin.Core.Configs
+namespace ZhonTai.Admin.Core.Configs;
+
+/// <summary>
+/// Jwt配置
+/// </summary>
+public class JwtConfig
 {
     /// <summary>
-    /// Jwt配置
+    /// 发行者
     /// </summary>
-    public class JwtConfig
-    {
-        /// <summary>
-        /// 发行者
-        /// </summary>
-        public string Issuer { get; set; } = "http://127.0.0.1:8888";
+    public string Issuer { get; set; } = "http://127.0.0.1:8888";
 
-        /// <summary>
-        /// 订阅者
-        /// </summary>
-        public string Audience { get; set; } = "http://127.0.0.1:8888";
+    /// <summary>
+    /// 订阅者
+    /// </summary>
+    public string Audience { get; set; } = "http://127.0.0.1:8888";
 
-        /// <summary>
-        /// 密钥
-        /// </summary>
-        public string SecurityKey { get; set; } = "ertJKl#521*a@790asD&1#";
+    /// <summary>
+    /// 密钥
+    /// </summary>
+    public string SecurityKey { get; set; } = "ertJKl#521*a@790asD&1#";
 
-        /// <summary>
-        /// 有效期(分钟)
-        /// </summary>
-        public int Expires { get; set; } = 120;
+    /// <summary>
+    /// 有效期(分钟)
+    /// </summary>
+    public int Expires { get; set; } = 120;
 
-        /// <summary>
-        /// 刷新有效期(分钟)
-        /// </summary>
-        public int RefreshExpires { get; set; } = 480;
-    }
+    /// <summary>
+    /// 刷新有效期(分钟)
+    /// </summary>
+    public int RefreshExpires { get; set; } = 480;
 }

+ 57 - 58
src/platform/ZhonTai.Admin/Core/Configs/UploadConfig.cs

@@ -1,81 +1,80 @@
 using System;
 using System.IO;
 
-namespace ZhonTai.Admin.Core.Configs
+namespace ZhonTai.Admin.Core.Configs;
+
+/// <summary>
+/// 上传配置
+/// </summary>
+public class UploadConfig
 {
     /// <summary>
-    /// 上传配置
+    /// 头像上传配置
     /// </summary>
-    public class UploadConfig
-    {
-        /// <summary>
-        /// 头像上传配置
-        /// </summary>
-        public FileUploadConfig Avatar { get; set; }
+    public FileUploadConfig Avatar { get; set; }
 
-        /// <summary>
-        /// 文档图片上传配置
-        /// </summary>
-        public FileUploadConfig Document { get; set; }
-    }
+    /// <summary>
+    /// 文档图片上传配置
+    /// </summary>
+    public FileUploadConfig Document { get; set; }
+}
+
+/// <summary>
+/// 文件上传配置
+/// </summary>
+public class FileUploadConfig
+{
+    private string _uploadPath;
 
     /// <summary>
-    /// 文件上传配置
+    /// 上传路径
     /// </summary>
-    public class FileUploadConfig
+    public string UploadPath
     {
-        private string _uploadPath;
-
-        /// <summary>
-        /// 上传路径
-        /// </summary>
-        public string UploadPath
+        get
         {
-            get
+            if (_uploadPath.IsNull())
             {
-                if (_uploadPath.IsNull())
-                {
-                    _uploadPath = Path.Combine(AppContext.BaseDirectory, "upload").ToPath();
-                }
-
-                if (!Path.IsPathRooted(_uploadPath))
-                {
-                    _uploadPath = Path.Combine(AppContext.BaseDirectory, _uploadPath).ToPath();
-                }
+                _uploadPath = Path.Combine(AppContext.BaseDirectory, "upload").ToPath();
+            }
 
-                return _uploadPath;
+            if (!Path.IsPathRooted(_uploadPath))
+            {
+                _uploadPath = Path.Combine(AppContext.BaseDirectory, _uploadPath).ToPath();
             }
-            set => _uploadPath = value;
+
+            return _uploadPath;
         }
+        set => _uploadPath = value;
+    }
 
-        /// <summary>
-        /// 请求路径
-        /// </summary>
-        public string RequestPath { get; set; }
+    /// <summary>
+    /// 请求路径
+    /// </summary>
+    public string RequestPath { get; set; }
 
-        /// <summary>
-        /// 路径格式
-        /// </summary>
-        public string Format { get; set; }
+    /// <summary>
+    /// 路径格式
+    /// </summary>
+    public string Format { get; set; }
 
-        /// <summary>
-        /// 路径日期格式
-        /// </summary>
-        public string DateTimeFormat { get; set; }
+    /// <summary>
+    /// 路径日期格式
+    /// </summary>
+    public string DateTimeFormat { get; set; }
 
-        /// <summary>
-        /// 文件大小 10M = 10 * 1024 * 1024
-        /// </summary>
-        public long MaxSize { get; set; }
+    /// <summary>
+    /// 文件大小 10M = 10 * 1024 * 1024
+    /// </summary>
+    public long MaxSize { get; set; }
 
-        /// <summary>
-        /// 最大允许上传个数 -1不限制
-        /// </summary>
-        public int Limit { get; set; } = -1;
+    /// <summary>
+    /// 最大允许上传个数 -1不限制
+    /// </summary>
+    public int Limit { get; set; } = -1;
 
-        /// <summary>
-        /// 文件格式
-        /// </summary>
-        public string[] ContentType { get; set; }
-    }
+    /// <summary>
+    /// 文件格式
+    /// </summary>
+    public string[] ContentType { get; set; }
 }

+ 19 - 20
src/platform/ZhonTai.Admin/Core/Consts/AdminConsts.cs

@@ -1,25 +1,24 @@
-namespace ZhonTai.Admin.Core.Consts
+namespace ZhonTai.Admin.Core.Consts;
+
+public static partial class AdminConsts
 {
-    public static partial class AdminConsts
-    {
-        /// <summary>
-        /// 默认域
-        /// </summary>
-        public const string AreaName = "admin";
+    /// <summary>
+    /// 默认域
+    /// </summary>
+    public const string AreaName = "admin";
 
-        /// <summary>
-        /// 默认租户
-        /// </summary>
-        public const string TenantName = "Default";
+    /// <summary>
+    /// 默认租户
+    /// </summary>
+    public const string TenantName = "Default";
 
-        /// <summary>
-        /// 请求策略
-        /// </summary>
-        public const string RequestPolicyName = "RequestPolicy";
+    /// <summary>
+    /// 请求策略
+    /// </summary>
+    public const string RequestPolicyName = "RequestPolicy";
 
-        /// <summary>
-        /// 允许所有源访问策略
-        /// </summary>
-        public const string AllowAnyPolicyName = "AllowAnyPolicy";
-    }
+    /// <summary>
+    /// 允许所有源访问策略
+    /// </summary>
+    public const string AllowAnyPolicyName = "AllowAnyPolicy";
 }

+ 30 - 31
src/platform/ZhonTai.Admin/Core/Consts/CacheKeys.cs

@@ -1,42 +1,41 @@
 using System.ComponentModel;
 using ZhonTai.Admin.Core.Attributes;
 
-namespace ZhonTai.Admin.Core.Consts
+namespace ZhonTai.Admin.Core.Consts;
+
+/// <summary>
+/// 缓存键
+/// </summary>
+[ScanCacheKeys]
+public static partial class CacheKeys
 {
     /// <summary>
-    /// 缓存键
+    /// 验证码 admin:captcha:guid
     /// </summary>
-    [ScanCacheKeys]
-    public static partial class CacheKeys
-    {
-        /// <summary>
-        /// 验证码 admin:captcha:guid
-        /// </summary>
-        [Description("验证码")]
-        public const string CaptchaKey = "admin:captcha:{0}";
+    [Description("验证码")]
+    public const string CaptchaKey = "admin:captcha:{0}";
 
-        /// <summary>
-        /// 密码加密 admin:password:encrypt:guid
-        /// </summary>
-        [Description("密码加密")]
-        public const string PassWordEncryptKey = "admin:password:encrypt:{0}";
+    /// <summary>
+    /// 密码加密 admin:password:encrypt:guid
+    /// </summary>
+    [Description("密码加密")]
+    public const string PassWordEncryptKey = "admin:password:encrypt:{0}";
 
-        /// <summary>
-        /// 用户权限 admin:user:permissions:用户主键
-        /// </summary>
-        [Description("用户权限")]
-        public const string UserPermissions = "admin:user:permissions:{0}";
+    /// <summary>
+    /// 用户权限 admin:user:permissions:用户主键
+    /// </summary>
+    [Description("用户权限")]
+    public const string UserPermissions = "admin:user:permissions:{0}";
 
-        /// <summary>
-        /// 用户信息 admin:user:info:用户主键
-        /// </summary>
-        [Description("用户信息")]
-        public const string UserInfo = "admin:user:info:{0}";
+    /// <summary>
+    /// 用户信息 admin:user:info:用户主键
+    /// </summary>
+    [Description("用户信息")]
+    public const string UserInfo = "admin:user:info:{0}";
 
-        /// <summary>
-        /// 租户信息 admin:tenant:info:租户主键
-        /// </summary>
-        [Description("租户信息")]
-        public const string TenantInfo = "admin:tenant:info:{0}";
-    }
+    /// <summary>
+    /// 租户信息 admin:tenant:info:租户主键
+    /// </summary>
+    [Description("租户信息")]
+    public const string TenantInfo = "admin:tenant:info:{0}";
 }

+ 117 - 118
src/platform/ZhonTai.Admin/Core/Db/DBServiceCollectionExtensions.cs

@@ -12,161 +12,160 @@ using ZhonTai.Admin.Core.Dbs;
 using ZhonTai.Admin.Core.Auth;
 using ZhonTai.Admin.Core.Startup;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public static class DBServiceCollectionExtensions
 {
-    public static class DBServiceCollectionExtensions
+    /// <summary>
+    /// 添加数据库
+    /// </summary>
+    /// <param name="services"></param>
+    /// <param name="env"></param>
+    /// <param name="hostAppOptions"></param>
+    /// <returns></returns>
+    public async static Task AddDbAsync(this IServiceCollection services, IHostEnvironment env, HostAppOptions hostAppOptions)
     {
-        /// <summary>
-        /// 添加数据库
-        /// </summary>
-        /// <param name="services"></param>
-        /// <param name="env"></param>
-        /// <param name="hostAppOptions"></param>
-        /// <returns></returns>
-        public async static Task AddDbAsync(this IServiceCollection services, IHostEnvironment env, HostAppOptions hostAppOptions)
-        {
-            services.AddScoped<DbUnitOfWorkManager>();
+        services.AddScoped<DbUnitOfWorkManager>();
 
-            var dbConfig = ConfigHelper.Get<DbConfig>("dbconfig", env.EnvironmentName);
+        var dbConfig = ConfigHelper.Get<DbConfig>("dbconfig", env.EnvironmentName);
 
-            //创建数据库
-            if (dbConfig.CreateDb)
-            {
-                await DbHelper.CreateDatabaseAsync(dbConfig);
-            }
+        //创建数据库
+        if (dbConfig.CreateDb)
+        {
+            await DbHelper.CreateDatabaseAsync(dbConfig);
+        }
 
-            #region FreeSql
+        #region FreeSql
 
-            var freeSqlBuilder = new FreeSqlBuilder()
-                    .UseConnectionString(dbConfig.Type, dbConfig.ConnectionString)
-                    .UseAutoSyncStructure(false)
-                    .UseLazyLoading(false)
-                    .UseNoneCommandParameter(true);
+        var freeSqlBuilder = new FreeSqlBuilder()
+                .UseConnectionString(dbConfig.Type, dbConfig.ConnectionString)
+                .UseAutoSyncStructure(false)
+                .UseLazyLoading(false)
+                .UseNoneCommandParameter(true);
 
-            hostAppOptions?.ConfigureFreeSqlBuilder?.Invoke(freeSqlBuilder);
+        hostAppOptions?.ConfigureFreeSqlBuilder?.Invoke(freeSqlBuilder);
 
-            #region 监听所有命令
+        #region 监听所有命令
 
-            if (dbConfig.MonitorCommand)
+        if (dbConfig.MonitorCommand)
+        {
+            freeSqlBuilder.UseMonitorCommand(cmd => { }, (cmd, traceLog) =>
             {
-                freeSqlBuilder.UseMonitorCommand(cmd => { }, (cmd, traceLog) =>
-                {
-                    //Console.WriteLine($"{cmd.CommandText}\n{traceLog}\r\n");
-                    Console.WriteLine($"{cmd.CommandText}\r\n");
-                });
-            }
+                //Console.WriteLine($"{cmd.CommandText}\n{traceLog}\r\n");
+                Console.WriteLine($"{cmd.CommandText}\r\n");
+            });
+        }
 
-            #endregion 监听所有命令
+        #endregion 监听所有命令
 
-            var fsql = freeSqlBuilder.Build();
-            fsql.GlobalFilter.Apply<IEntitySoftDelete>("SoftDelete", a => a.IsDeleted == false);
+        var fsql = freeSqlBuilder.Build();
+        fsql.GlobalFilter.Apply<IEntitySoftDelete>("SoftDelete", a => a.IsDeleted == false);
 
-            //配置实体
-            var appConfig = ConfigHelper.Get<AppConfig>("appconfig", env.EnvironmentName);
-            DbHelper.ConfigEntity(fsql, appConfig);
+        //配置实体
+        var appConfig = ConfigHelper.Get<AppConfig>("appconfig", env.EnvironmentName);
+        DbHelper.ConfigEntity(fsql, appConfig);
 
-            hostAppOptions?.ConfigureFreeSql?.Invoke(fsql);
-            #region 初始化数据库
+        hostAppOptions?.ConfigureFreeSql?.Invoke(fsql);
+        #region 初始化数据库
 
-            //同步结构
-            if (dbConfig.SyncStructure)
-            {
-                DbHelper.SyncStructure(fsql, dbConfig: dbConfig, appConfig: appConfig);
-            }
+        //同步结构
+        if (dbConfig.SyncStructure)
+        {
+            DbHelper.SyncStructure(fsql, dbConfig: dbConfig, appConfig: appConfig);
+        }
 
-            var user = services.BuildServiceProvider().GetService<IUser>();
+        var user = services.BuildServiceProvider().GetService<IUser>();
 
-            #region 审计数据
+        #region 审计数据
 
-            //计算服务器时间
-            var selectProvider = fsql.Select<object>() as Select0Provider;
-            var serverTime = fsql.Select<object>().WithSql($"select {selectProvider._commonUtils.NowUtc} a").First(a => Convert.ToDateTime("a"));
-            var timeOffset = DateTime.UtcNow.Subtract(serverTime);
-            DbHelper.TimeOffset = timeOffset;
-            fsql.Aop.AuditValue += (s, e) =>
-            {
-                DbHelper.AuditValue(e, timeOffset, user);
-            };
+        //计算服务器时间
+        var selectProvider = fsql.Select<object>() as Select0Provider;
+        var serverTime = fsql.Select<object>().WithSql($"select {selectProvider._commonUtils.NowUtc} a").First(a => Convert.ToDateTime("a"));
+        var timeOffset = DateTime.UtcNow.Subtract(serverTime);
+        DbHelper.TimeOffset = timeOffset;
+        fsql.Aop.AuditValue += (s, e) =>
+        {
+            DbHelper.AuditValue(e, timeOffset, user);
+        };
 
-            #endregion 审计数据
+        #endregion 审计数据
 
-            //同步数据
-            if (dbConfig.SyncData)
-            {
-                await DbHelper.SyncDataAsync(fsql, dbConfig, appConfig);
-            }
+        //同步数据
+        if (dbConfig.SyncData)
+        {
+            await DbHelper.SyncDataAsync(fsql, dbConfig, appConfig);
+        }
 
-            #endregion 初始化数据库
+        #endregion 初始化数据库
 
-            //生成数据
-            if (dbConfig.GenerateData && !dbConfig.CreateDb && !dbConfig.SyncData)
-            {
-                await DbHelper.GenerateDataAsync(fsql, appConfig);
-            }
+        //生成数据
+        if (dbConfig.GenerateData && !dbConfig.CreateDb && !dbConfig.SyncData)
+        {
+            await DbHelper.GenerateDataAsync(fsql, appConfig);
+        }
 
-            #region 监听Curd操作
+        #region 监听Curd操作
 
-            if (dbConfig.Curd)
+        if (dbConfig.Curd)
+        {
+            fsql.Aop.CurdBefore += (s, e) =>
             {
-                fsql.Aop.CurdBefore += (s, e) =>
+                if (appConfig.MiniProfiler)
                 {
-                    if (appConfig.MiniProfiler)
-                    {
-                        MiniProfiler.Current.CustomTiming("CurdBefore", e.Sql);
-                    }
-                    Console.WriteLine($"{e.Sql}\r\n");
-                };
-                fsql.Aop.CurdAfter += (s, e) =>
+                    MiniProfiler.Current.CustomTiming("CurdBefore", e.Sql);
+                }
+                Console.WriteLine($"{e.Sql}\r\n");
+            };
+            fsql.Aop.CurdAfter += (s, e) =>
+            {
+                if (appConfig.MiniProfiler)
                 {
-                    if (appConfig.MiniProfiler)
-                    {
-                        MiniProfiler.Current.CustomTiming("CurdAfter", $"{e.ElapsedMilliseconds}");
-                    }
-                };
-            }
+                    MiniProfiler.Current.CustomTiming("CurdAfter", $"{e.ElapsedMilliseconds}");
+                }
+            };
+        }
 
-            #endregion 监听Curd操作
+        #endregion 监听Curd操作
 
-            if (appConfig.Tenant)
-            {
-                fsql.GlobalFilter.Apply<ITenant>("Tenant", a => a.TenantId == user.TenantId);
-            }
+        if (appConfig.Tenant)
+        {
+            fsql.GlobalFilter.Apply<ITenant>("Tenant", a => a.TenantId == user.TenantId);
+        }
 
-            #endregion FreeSql
+        #endregion FreeSql
 
-            services.AddSingleton(fsql);
+        services.AddSingleton(fsql);
 
-            //导入多数据库
-            if (null != dbConfig.Dbs)
+        //导入多数据库
+        if (null != dbConfig.Dbs)
+        {
+            foreach (var multiDb in dbConfig.Dbs)
             {
-                foreach (var multiDb in dbConfig.Dbs)
+                switch (multiDb.Name)
                 {
-                    switch (multiDb.Name)
-                    {
-                        case nameof(MySqlDb):
-                            var mdb = CreateMultiDbBuilder(multiDb).Build<MySqlDb>();
-                            services.AddSingleton(mdb);
-                            break;
-
-                        default:
-                            break;
-                    }
+                    case nameof(MySqlDb):
+                        var mdb = CreateMultiDbBuilder(multiDb).Build<MySqlDb>();
+                        services.AddSingleton(mdb);
+                        break;
+
+                    default:
+                        break;
                 }
             }
         }
+    }
 
-        /// <summary>
-        /// 创建多数据库构建器
-        /// </summary>
-        /// <param name="multiDb"></param>
-        /// <returns></returns>
-        private static FreeSqlBuilder CreateMultiDbBuilder(MultiDb multiDb)
-        {
-            return new FreeSqlBuilder()
-            .UseConnectionString(multiDb.Type, multiDb.ConnectionString)
-            .UseAutoSyncStructure(false)
-            .UseLazyLoading(false)
-            .UseNoneCommandParameter(true);
-        }
+    /// <summary>
+    /// 创建多数据库构建器
+    /// </summary>
+    /// <param name="multiDb"></param>
+    /// <returns></returns>
+    private static FreeSqlBuilder CreateMultiDbBuilder(MultiDb multiDb)
+    {
+        return new FreeSqlBuilder()
+        .UseConnectionString(multiDb.Type, multiDb.ConnectionString)
+        .UseAutoSyncStructure(false)
+        .UseLazyLoading(false)
+        .UseNoneCommandParameter(true);
     }
 }

+ 273 - 274
src/platform/ZhonTai.Admin/Core/Db/DbHelper.cs

@@ -15,358 +15,357 @@ using ZhonTai.Admin.Core.Auth;
 using System.IO;
 using ZhonTai.Common.Helpers;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public class DbHelper
 {
-    public class DbHelper
+    /// <summary>
+    /// 偏移时间
+    /// </summary>
+    public static TimeSpan TimeOffset;
+
+    /// <summary>
+    /// 创建数据库
+    /// </summary>
+    /// <param name="dbConfig"></param>
+    /// <returns></returns>
+    public async static Task CreateDatabaseAsync(DbConfig dbConfig)
     {
-        /// <summary>
-        /// 偏移时间
-        /// </summary>
-        public static TimeSpan TimeOffset;
-
-        /// <summary>
-        /// 创建数据库
-        /// </summary>
-        /// <param name="dbConfig"></param>
-        /// <returns></returns>
-        public async static Task CreateDatabaseAsync(DbConfig dbConfig)
+        if (!dbConfig.CreateDb || dbConfig.Type == DataType.Sqlite)
         {
-            if (!dbConfig.CreateDb || dbConfig.Type == DataType.Sqlite)
-            {
-                return;
-            }
+            return;
+        }
 
-            var db = new FreeSqlBuilder()
-                    .UseConnectionString(dbConfig.Type, dbConfig.CreateDbConnectionString)
-                    .Build();
+        var db = new FreeSqlBuilder()
+                .UseConnectionString(dbConfig.Type, dbConfig.CreateDbConnectionString)
+                .Build();
 
-            try
+        try
+        {
+            Console.WriteLine("\r\n create database started");
+            var filePath = Path.Combine(AppContext.BaseDirectory, "Configs/createdbsql.txt").ToPath();
+            if (File.Exists(filePath))
             {
-                Console.WriteLine("\r\n create database started");
-                var filePath = Path.Combine(AppContext.BaseDirectory, "Configs/createdbsql.txt").ToPath();
-                if (File.Exists(filePath))
+                var createDbSql = FileHelper.ReadFile(filePath);
+                if (createDbSql.NotNull())
                 {
-                    var createDbSql = FileHelper.ReadFile(filePath);
-                    if (createDbSql.NotNull())
-                    {
-                        dbConfig.CreateDbSql = createDbSql;
-                    }
+                    dbConfig.CreateDbSql = createDbSql;
                 }
-
-                await db.Ado.ExecuteNonQueryAsync(dbConfig.CreateDbSql);
-                Console.WriteLine(" create database succeed");
             }
-            catch (Exception e)
-            {
-                Console.WriteLine($" create database failed.\n {e.Message}");
-            }
-        }
 
-        /// <summary>
-        /// 获得指定程序集表实体
-        /// </summary>
-        /// <param name="appConfig"></param>
-        /// <returns></returns>
-        public static Type[] GetEntityTypes(AppConfig appConfig)
+            await db.Ado.ExecuteNonQueryAsync(dbConfig.CreateDbSql);
+            Console.WriteLine(" create database succeed");
+        }
+        catch (Exception e)
         {
-            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+            Console.WriteLine($" create database failed.\n {e.Message}");
+        }
+    }
+
+    /// <summary>
+    /// 获得指定程序集表实体
+    /// </summary>
+    /// <param name="appConfig"></param>
+    /// <returns></returns>
+    public static Type[] GetEntityTypes(AppConfig appConfig)
+    {
+        Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
 
-            var entityTypes = new List<Type>();
+        var entityTypes = new List<Type>();
 
-            foreach (var assembly in assemblies)
+        foreach (var assembly in assemblies)
+        {
+            foreach (Type type in assembly.GetExportedTypes())
             {
-                foreach (Type type in assembly.GetExportedTypes())
+                foreach (Attribute attribute in type.GetCustomAttributes())
                 {
-                    foreach (Attribute attribute in type.GetCustomAttributes())
+                    if (attribute is TableAttribute tableAttribute)
                     {
-                        if (attribute is TableAttribute tableAttribute)
+                        if (tableAttribute.DisableSyncStructure == false)
                         {
-                            if (tableAttribute.DisableSyncStructure == false)
-                            {
-                                entityTypes.Add(type);
-                            }
+                            entityTypes.Add(type);
                         }
                     }
                 }
             }
-
-            return entityTypes.ToArray();
         }
 
-        /// <summary>
-        /// 配置实体
-        /// </summary>
-        public static void ConfigEntity(IFreeSql db, AppConfig appConfig = null)
+        return entityTypes.ToArray();
+    }
+
+    /// <summary>
+    /// 配置实体
+    /// </summary>
+    public static void ConfigEntity(IFreeSql db, AppConfig appConfig = null)
+    {
+        //租户生成和操作租户Id
+        if (!appConfig.Tenant)
         {
-            //租户生成和操作租户Id
-            if (!appConfig.Tenant)
-            {
-                var iTenant = nameof(ITenant);
-                var tenantId = nameof(ITenant.TenantId);
+            var iTenant = nameof(ITenant);
+            var tenantId = nameof(ITenant.TenantId);
 
-                //获得指定程序集表实体
-                var entityTypes = GetEntityTypes(appConfig);
+            //获得指定程序集表实体
+            var entityTypes = GetEntityTypes(appConfig);
 
-                foreach (var entityType in entityTypes)
+            foreach (var entityType in entityTypes)
+            {
+                if (entityType.GetInterfaces().Any(a => a.Name == iTenant))
                 {
-                    if (entityType.GetInterfaces().Any(a => a.Name == iTenant))
+                    db.CodeFirst.Entity(entityType, a =>
                     {
-                        db.CodeFirst.Entity(entityType, a =>
-                        {
-                            a.Ignore(tenantId);
-                        });
-                    }
+                        a.Ignore(tenantId);
+                    });
                 }
             }
         }
+    }
 
-        /// <summary>
-        /// 审计数据
-        /// </summary>
-        /// <param name="e"></param>
-        /// <param name="timeOffset"></param>
-        /// <param name="user"></param>
-        public static void AuditValue(AuditValueEventArgs e, TimeSpan timeOffset, IUser user)
+    /// <summary>
+    /// 审计数据
+    /// </summary>
+    /// <param name="e"></param>
+    /// <param name="timeOffset"></param>
+    /// <param name="user"></param>
+    public static void AuditValue(AuditValueEventArgs e, TimeSpan timeOffset, IUser user)
+    {
+        if (e.Property.GetCustomAttribute<ServerTimeAttribute>(false) != null
+               && (e.Column.CsType == typeof(DateTime) || e.Column.CsType == typeof(DateTime?))
+               && (e.Value == null || (DateTime)e.Value == default || (DateTime?)e.Value == default))
         {
-            if (e.Property.GetCustomAttribute<ServerTimeAttribute>(false) != null
-                   && (e.Column.CsType == typeof(DateTime) || e.Column.CsType == typeof(DateTime?))
-                   && (e.Value == null || (DateTime)e.Value == default || (DateTime?)e.Value == default))
-            {
-                e.Value = DateTime.Now.Subtract(timeOffset);
-            }
-
-            if (e.Column.CsType == typeof(long)
-            && e.Property.GetCustomAttribute<SnowflakeAttribute>(false) is SnowflakeAttribute snowflakeAttribute
-            && snowflakeAttribute.Enable && (e.Value == null || (long)e.Value == default || (long?)e.Value == default))
-            {
-                e.Value = YitIdHelper.NextId();
-            }
-
-            if (user == null || user.Id <= 0)
-            {
-                return;
-            }
+            e.Value = DateTime.Now.Subtract(timeOffset);
+        }
 
-            if (e.AuditValueType == AuditValueType.Insert)
-            {
-                switch (e.Property.Name)
-                {
-                    case "CreatedUserId":
-                        if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
-                        {
-                            e.Value = user.Id;
-                        }
-                        break;
+        if (e.Column.CsType == typeof(long)
+        && e.Property.GetCustomAttribute<SnowflakeAttribute>(false) is SnowflakeAttribute snowflakeAttribute
+        && snowflakeAttribute.Enable && (e.Value == null || (long)e.Value == default || (long?)e.Value == default))
+        {
+            e.Value = YitIdHelper.NextId();
+        }
 
-                    case "CreatedUserName":
-                        if (e.Value == null || ((string)e.Value).IsNull())
-                        {
-                            e.Value = user.Name;
-                        }
-                        break;
+        if (user == null || user.Id <= 0)
+        {
+            return;
+        }
 
-                    case "TenantId":
-                        if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
-                        {
-                            e.Value = user.TenantId;
-                        }
-                        break;
-                }
-            }
-            else if (e.AuditValueType == AuditValueType.Update)
+        if (e.AuditValueType == AuditValueType.Insert)
+        {
+            switch (e.Property.Name)
             {
-                switch (e.Property.Name)
-                {
-                    case "ModifiedUserId":
+                case "CreatedUserId":
+                    if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
+                    {
                         e.Value = user.Id;
-                        break;
+                    }
+                    break;
 
-                    case "ModifiedUserName":
+                case "CreatedUserName":
+                    if (e.Value == null || ((string)e.Value).IsNull())
+                    {
                         e.Value = user.Name;
-                        break;
-                }
+                    }
+                    break;
+
+                case "TenantId":
+                    if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
+                    {
+                        e.Value = user.TenantId;
+                    }
+                    break;
             }
         }
-
-        /// <summary>
-        /// 同步结构
-        /// </summary>
-        public static void SyncStructure(IFreeSql db, string msg = null, DbConfig dbConfig = null, AppConfig appConfig = null)
+        else if (e.AuditValueType == AuditValueType.Update)
         {
-            //打印结构比对脚本
-            //var dDL = db.CodeFirst.GetComparisonDDLStatements<PermissionEntity>();
-            //Console.WriteLine("\r\n " + dDL);
-
-            //打印结构同步脚本
-            //db.Aop.SyncStructureAfter += (s, e) =>
-            //{
-            //    if (e.Sql.NotNull())
-            //    {
-            //        Console.WriteLine(" sync structure sql:\n" + e.Sql);
-            //    }
-            //};
-
-            // 同步结构
-            var dbType = dbConfig.Type.ToString();
-            Console.WriteLine($"\r\n {(msg.NotNull() ? msg : $"sync {dbType} structure")} started");
-            if (dbConfig.Type == DataType.Oracle)
+            switch (e.Property.Name)
             {
-                db.CodeFirst.IsSyncStructureToUpper = true;
-            }
-
-            //获得指定程序集表实体
-            var entityTypes = GetEntityTypes(appConfig);
+                case "ModifiedUserId":
+                    e.Value = user.Id;
+                    break;
 
-            db.CodeFirst.SyncStructure(entityTypes);
-            Console.WriteLine($" {(msg.NotNull() ? msg : $"sync {dbType} structure")} succeed");
+                case "ModifiedUserName":
+                    e.Value = user.Name;
+                    break;
+            }
         }
+    }
 
-        /// <summary>
-        /// 同步数据审计方法
-        /// </summary>
-        /// <param name="s"></param>
-        /// <param name="e"></param>
-        private static void SyncDataAuditValue(object s, AuditValueEventArgs e)
+    /// <summary>
+    /// 同步结构
+    /// </summary>
+    public static void SyncStructure(IFreeSql db, string msg = null, DbConfig dbConfig = null, AppConfig appConfig = null)
+    {
+        //打印结构比对脚本
+        //var dDL = db.CodeFirst.GetComparisonDDLStatements<PermissionEntity>();
+        //Console.WriteLine("\r\n " + dDL);
+
+        //打印结构同步脚本
+        //db.Aop.SyncStructureAfter += (s, e) =>
+        //{
+        //    if (e.Sql.NotNull())
+        //    {
+        //        Console.WriteLine(" sync structure sql:\n" + e.Sql);
+        //    }
+        //};
+
+        // 同步结构
+        var dbType = dbConfig.Type.ToString();
+        Console.WriteLine($"\r\n {(msg.NotNull() ? msg : $"sync {dbType} structure")} started");
+        if (dbConfig.Type == DataType.Oracle)
         {
-            var user = new { Id = 161223411986501, Name = "admin", TenantId = 161223412138053 };
+            db.CodeFirst.IsSyncStructureToUpper = true;
+        }
 
-            if (e.Property.GetCustomAttribute<ServerTimeAttribute>(false) != null
-                   && (e.Column.CsType == typeof(DateTime) || e.Column.CsType == typeof(DateTime?))
-                   && (e.Value == null || (DateTime)e.Value == default || (DateTime?)e.Value == default))
-            {
-                e.Value = DateTime.Now.Subtract(TimeOffset);
-            }
+        //获得指定程序集表实体
+        var entityTypes = GetEntityTypes(appConfig);
 
-            if (e.Column.CsType == typeof(long)
-            && e.Property.GetCustomAttribute<SnowflakeAttribute>(false) != null
-            && (e.Value == null || (long)e.Value == default || (long?)e.Value == default))
-            {
-                e.Value = YitIdHelper.NextId();
-            }
+        db.CodeFirst.SyncStructure(entityTypes);
+        Console.WriteLine($" {(msg.NotNull() ? msg : $"sync {dbType} structure")} succeed");
+    }
 
-            if (user == null || user.Id <= 0)
-            {
-                return;
-            }
+    /// <summary>
+    /// 同步数据审计方法
+    /// </summary>
+    /// <param name="s"></param>
+    /// <param name="e"></param>
+    private static void SyncDataAuditValue(object s, AuditValueEventArgs e)
+    {
+        var user = new { Id = 161223411986501, Name = "admin", TenantId = 161223412138053 };
 
-            if (e.AuditValueType == AuditValueType.Insert)
-            {
-                switch (e.Property.Name)
-                {
-                    case "CreatedUserId":
-                        if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
-                        {
-                            e.Value = user.Id;
-                        }
-                        break;
+        if (e.Property.GetCustomAttribute<ServerTimeAttribute>(false) != null
+               && (e.Column.CsType == typeof(DateTime) || e.Column.CsType == typeof(DateTime?))
+               && (e.Value == null || (DateTime)e.Value == default || (DateTime?)e.Value == default))
+        {
+            e.Value = DateTime.Now.Subtract(TimeOffset);
+        }
 
-                    case "CreatedUserName":
-                        if (e.Value == null || ((string)e.Value).IsNull())
-                        {
-                            e.Value = user.Name;
-                        }
-                        break;
+        if (e.Column.CsType == typeof(long)
+        && e.Property.GetCustomAttribute<SnowflakeAttribute>(false) != null
+        && (e.Value == null || (long)e.Value == default || (long?)e.Value == default))
+        {
+            e.Value = YitIdHelper.NextId();
+        }
 
-                    case "TenantId":
-                        if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
-                        {
-                            e.Value = user.TenantId;
-                        }
-                        break;
-                }
-            }
-            else if (e.AuditValueType == AuditValueType.Update)
+        if (user == null || user.Id <= 0)
+        {
+            return;
+        }
+
+        if (e.AuditValueType == AuditValueType.Insert)
+        {
+            switch (e.Property.Name)
             {
-                switch (e.Property.Name)
-                {
-                    case "ModifiedUserId":
+                case "CreatedUserId":
+                    if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
+                    {
                         e.Value = user.Id;
-                        break;
+                    }
+                    break;
 
-                    case "ModifiedUserName":
+                case "CreatedUserName":
+                    if (e.Value == null || ((string)e.Value).IsNull())
+                    {
                         e.Value = user.Name;
-                        break;
-                }
+                    }
+                    break;
+
+                case "TenantId":
+                    if (e.Value == null || (long)e.Value == default || (long?)e.Value == default)
+                    {
+                        e.Value = user.TenantId;
+                    }
+                    break;
             }
         }
-
-        /// <summary>
-        /// 同步数据
-        /// </summary>
-        /// <param name="db"></param>
-        /// <param name="dbConfig"></param>
-        /// <param name="appConfig"></param>
-        /// <returns></returns>
-        /// <exception cref="Exception"></exception>
-        public static async Task SyncDataAsync(
-            IFreeSql db, 
-            DbConfig dbConfig = null, 
-            AppConfig appConfig = null
-        )
+        else if (e.AuditValueType == AuditValueType.Update)
         {
-            try
+            switch (e.Property.Name)
             {
-                Console.WriteLine("\r\n sync data started");
+                case "ModifiedUserId":
+                    e.Value = user.Id;
+                    break;
 
-                db.Aop.AuditValue += SyncDataAuditValue;
+                case "ModifiedUserName":
+                    e.Value = user.Name;
+                    break;
+            }
+        }
+    }
 
-                Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+    /// <summary>
+    /// 同步数据
+    /// </summary>
+    /// <param name="db"></param>
+    /// <param name="dbConfig"></param>
+    /// <param name="appConfig"></param>
+    /// <returns></returns>
+    /// <exception cref="Exception"></exception>
+    public static async Task SyncDataAsync(
+        IFreeSql db, 
+        DbConfig dbConfig = null, 
+        AppConfig appConfig = null
+    )
+    {
+        try
+        {
+            Console.WriteLine("\r\n sync data started");
 
-                List<ISyncData> syncDatas = assemblies.Select(assembly => assembly.GetTypes()
-                .Where(x => typeof(ISyncData).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()) && x.GetTypeInfo().IsClass && !x.GetTypeInfo().IsAbstract))
-                .SelectMany(registerTypes => registerTypes.Select(registerType => (ISyncData)Activator.CreateInstance(registerType))).ToList();
+            db.Aop.AuditValue += SyncDataAuditValue;
 
-                foreach (ISyncData syncData in syncDatas)
-                {
-                    await syncData.SyncDataAsync(db, dbConfig, appConfig);
-                }
+            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
 
-                db.Aop.AuditValue -= SyncDataAuditValue;
+            List<ISyncData> syncDatas = assemblies.Select(assembly => assembly.GetTypes()
+            .Where(x => typeof(ISyncData).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()) && x.GetTypeInfo().IsClass && !x.GetTypeInfo().IsAbstract))
+            .SelectMany(registerTypes => registerTypes.Select(registerType => (ISyncData)Activator.CreateInstance(registerType))).ToList();
 
-                Console.WriteLine(" sync data succeed\r\n");
-            }
-            catch (Exception ex)
+            foreach (ISyncData syncData in syncDatas)
             {
-                throw new Exception($" sync data failed.\n{ex.Message}");
+                await syncData.SyncDataAsync(db, dbConfig, appConfig);
             }
-        }
 
-        /// <summary>
-        /// 生成数据
-        /// </summary>
-        /// <param name="db"></param>
-        /// <param name="appConfig"></param>
-        /// <returns></returns>
-        /// <exception cref="Exception"></exception>
-        public static async Task GenerateDataAsync(IFreeSql db, AppConfig appConfig = null)
+            db.Aop.AuditValue -= SyncDataAuditValue;
+
+            Console.WriteLine(" sync data succeed\r\n");
+        }
+        catch (Exception ex)
         {
-            try
-            {
-                Console.WriteLine("\r\n generate data started");
+            throw new Exception($" sync data failed.\n{ex.Message}");
+        }
+    }
 
-                Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+    /// <summary>
+    /// 生成数据
+    /// </summary>
+    /// <param name="db"></param>
+    /// <param name="appConfig"></param>
+    /// <returns></returns>
+    /// <exception cref="Exception"></exception>
+    public static async Task GenerateDataAsync(IFreeSql db, AppConfig appConfig = null)
+    {
+        try
+        {
+            Console.WriteLine("\r\n generate data started");
 
-                List<IGenerateData> generateDatas = assemblies.Select(assembly => assembly.GetTypes()
-                .Where(x => typeof(IGenerateData).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()) && x.GetTypeInfo().IsClass && !x.GetTypeInfo().IsAbstract))
-                .SelectMany(registerTypes => registerTypes.Select(registerType => (IGenerateData)Activator.CreateInstance(registerType))).ToList();
+            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
 
-                foreach (IGenerateData generateData in generateDatas)
-                {
-                    await generateData.GenerateDataAsync(db, appConfig);
-                }
+            List<IGenerateData> generateDatas = assemblies.Select(assembly => assembly.GetTypes()
+            .Where(x => typeof(IGenerateData).GetTypeInfo().IsAssignableFrom(x.GetTypeInfo()) && x.GetTypeInfo().IsClass && !x.GetTypeInfo().IsAbstract))
+            .SelectMany(registerTypes => registerTypes.Select(registerType => (IGenerateData)Activator.CreateInstance(registerType))).ToList();
 
-                Console.WriteLine(" generate data succeed\r\n");
-            }
-            catch (Exception ex)
+            foreach (IGenerateData generateData in generateDatas)
             {
-                throw new Exception($" generate data failed。\n{ex.Message}\r\n");
+                await generateData.GenerateDataAsync(db, appConfig);
             }
+
+            Console.WriteLine(" generate data succeed\r\n");
+        }
+        catch (Exception ex)
+        {
+            throw new Exception($" generate data failed。\n{ex.Message}\r\n");
         }
     }
 }

+ 4 - 5
src/platform/ZhonTai.Admin/Core/Db/DbUnitOfWorkManager.cs

@@ -1,12 +1,11 @@
 using FreeSql;
 using System;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public class DbUnitOfWorkManager : UnitOfWorkManager
 {
-    public class DbUnitOfWorkManager : UnitOfWorkManager
+    public DbUnitOfWorkManager(IdleBus<IFreeSql> ib, IServiceProvider serviceProvider) : base(ib.GetFreeSql(serviceProvider))
     {
-        public DbUnitOfWorkManager(IdleBus<IFreeSql> ib, IServiceProvider serviceProvider) : base(ib.GetFreeSql(serviceProvider))
-        {
-        }
     }
 }

+ 12 - 13
src/platform/ZhonTai.Admin/Core/Db/GenerateData.cs

@@ -6,21 +6,20 @@ using Newtonsoft.Json.Serialization;
 using FreeSql.DataAnnotations;
 using ZhonTai.Common.Helpers;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public abstract class GenerateData
 {
-    public abstract class GenerateData
+    protected virtual void SaveDataToJsonFile<T>(object data, bool isTenant = false, string path = "InitData/Admin", PropsContractResolver propsContractResolver = null) where T : class, new()
     {
-        protected virtual void SaveDataToJsonFile<T>(object data, bool isTenant = false, string path = "InitData/Admin", PropsContractResolver propsContractResolver = null) where T : class, new()
-        {
-            var settings = new JsonSerializerSettings();
-            settings.ContractResolver = propsContractResolver != null ? propsContractResolver : (isTenant ? new CamelCasePropertyNamesContractResolver() : new PropsContractResolver(new List<string> { "TenantId" }));
-            settings.NullValueHandling = NullValueHandling.Ignore;
-            settings.DefaultValueHandling = DefaultValueHandling.Ignore;
+        var settings = new JsonSerializerSettings();
+        settings.ContractResolver = propsContractResolver != null ? propsContractResolver : (isTenant ? new CamelCasePropertyNamesContractResolver() : new PropsContractResolver(new List<string> { "TenantId" }));
+        settings.NullValueHandling = NullValueHandling.Ignore;
+        settings.DefaultValueHandling = DefaultValueHandling.Ignore;
 
-            var table = typeof(T).GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute;
-            var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"{path}/{table.Name}{(isTenant ? ".tenant" : "")}.json").ToPath();
-            var jsonData = JsonConvert.SerializeObject(data, Formatting.Indented, settings);
-            FileHelper.WriteFile(filePath, jsonData);
-        }
+        var table = typeof(T).GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute;
+        var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"{path}/{table.Name}{(isTenant ? ".tenant" : "")}.json").ToPath();
+        var jsonData = JsonConvert.SerializeObject(data, Formatting.Indented, settings);
+        FileHelper.WriteFile(filePath, jsonData);
     }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Db/IGenerateData.cs

@@ -1,13 +1,12 @@
 using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Configs;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+/// <summary>
+/// 生成数据接口
+/// </summary>
+public interface IGenerateData
 {
-    /// <summary>
-    /// 生成数据接口
-    /// </summary>
-    public interface IGenerateData
-    {
-        Task GenerateDataAsync(IFreeSql db, AppConfig appConfig);
-    }
+    Task GenerateDataAsync(IFreeSql db, AppConfig appConfig);
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Db/ISyncData.cs

@@ -1,13 +1,12 @@
 using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Configs;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+/// <summary>
+/// 同步数据接口
+/// </summary>
+public interface ISyncData
 {
-    /// <summary>
-    /// 同步数据接口
-    /// </summary>
-    public interface ISyncData
-    {
-        Task SyncDataAsync(IFreeSql db, DbConfig dbConfig = null, AppConfig appConfig = null);
-    }
+    Task SyncDataAsync(IFreeSql db, DbConfig dbConfig = null, AppConfig appConfig = null);
 }

+ 113 - 114
src/platform/ZhonTai.Admin/Core/Db/IdleBusExtesions.cs

@@ -9,150 +9,149 @@ using ZhonTai.Admin.Core.Dto;
 using ZhonTai.Admin.Core.Entities;
 using ZhonTai.Admin.Domain.Tenant;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public static class IdleBusExtesions
 {
-    public static class IdleBusExtesions
+    /// <summary>
+    /// 创建FreeSql实例
+    /// </summary>
+    /// <param name="user"></param>
+    /// <param name="appConfig"></param>
+    /// <param name="dbConfig"></param>
+    /// <param name="tenant"></param>
+    /// <returns></returns>
+    private static IFreeSql CreateFreeSql(IUser user, AppConfig appConfig, DbConfig dbConfig, CreateFreeSqlTenantDto tenant)
     {
-        /// <summary>
-        /// 创建FreeSql实例
-        /// </summary>
-        /// <param name="user"></param>
-        /// <param name="appConfig"></param>
-        /// <param name="dbConfig"></param>
-        /// <param name="tenant"></param>
-        /// <returns></returns>
-        private static IFreeSql CreateFreeSql(IUser user, AppConfig appConfig, DbConfig dbConfig, CreateFreeSqlTenantDto tenant)
-        {
-            var freeSqlBuilder = new FreeSqlBuilder()
-            .UseConnectionString(tenant.DbType.Value, tenant.ConnectionString)
-            .UseAutoSyncStructure(false)
-            .UseLazyLoading(false)
-            .UseNoneCommandParameter(true);
+        var freeSqlBuilder = new FreeSqlBuilder()
+        .UseConnectionString(tenant.DbType.Value, tenant.ConnectionString)
+        .UseAutoSyncStructure(false)
+        .UseLazyLoading(false)
+        .UseNoneCommandParameter(true);
 
-            #region 监听所有命令
+        #region 监听所有命令
 
-            if (dbConfig.MonitorCommand)
+        if (dbConfig.MonitorCommand)
+        {
+            freeSqlBuilder.UseMonitorCommand(cmd => { }, (cmd, traceLog) =>
             {
-                freeSqlBuilder.UseMonitorCommand(cmd => { }, (cmd, traceLog) =>
-                {
-                    Console.WriteLine($"{cmd.CommandText}\r\n");
-                });
-            }
+                Console.WriteLine($"{cmd.CommandText}\r\n");
+            });
+        }
 
-            #endregion 监听所有命令
+        #endregion 监听所有命令
 
-            var fsql = freeSqlBuilder.Build();
-            fsql.GlobalFilter.Apply<IEntitySoftDelete>("SoftDelete", a => a.IsDeleted == false);
+        var fsql = freeSqlBuilder.Build();
+        fsql.GlobalFilter.Apply<IEntitySoftDelete>("SoftDelete", a => a.IsDeleted == false);
 
-            //配置实体
-            DbHelper.ConfigEntity(fsql, appConfig);
+        //配置实体
+        DbHelper.ConfigEntity(fsql, appConfig);
 
-            #region 监听Curd操作
+        #region 监听Curd操作
 
-            if (dbConfig.Curd)
+        if (dbConfig.Curd)
+        {
+            fsql.Aop.CurdBefore += (s, e) =>
             {
-                fsql.Aop.CurdBefore += (s, e) =>
-                {
-                    if (appConfig.MiniProfiler)
-                    {
-                        MiniProfiler.Current.CustomTiming("CurdBefore", e.Sql);
-                    }
-                    Console.WriteLine($"{e.Sql}\r\n");
-                };
-                fsql.Aop.CurdAfter += (s, e) =>
+                if (appConfig.MiniProfiler)
                 {
-                    if (appConfig.MiniProfiler)
-                    {
-                        MiniProfiler.Current.CustomTiming("CurdAfter", $"{e.ElapsedMilliseconds}");
-                    }
-                    Console.WriteLine($"{e.Sql}\r\n");
-                };
-            }
-
-            #endregion 监听Curd操作
-
-            #region 审计数据
-
-            //计算服务器时间
-            var selectProvider = fsql.Select<object>() as Select0Provider;
-            var serverTime = fsql.Select<object>().WithSql($"select {selectProvider._commonUtils.NowUtc} a").First(a=> Convert.ToDateTime("a"));
-            var timeOffset = DateTime.UtcNow.Subtract(serverTime);
-            fsql.Aop.AuditValue += (s, e) =>
+                    MiniProfiler.Current.CustomTiming("CurdBefore", e.Sql);
+                }
+                Console.WriteLine($"{e.Sql}\r\n");
+            };
+            fsql.Aop.CurdAfter += (s, e) =>
             {
-                DbHelper.AuditValue(e, timeOffset, user);
+                if (appConfig.MiniProfiler)
+                {
+                    MiniProfiler.Current.CustomTiming("CurdAfter", $"{e.ElapsedMilliseconds}");
+                }
+                Console.WriteLine($"{e.Sql}\r\n");
             };
+        }
 
-            #endregion 审计数据
+        #endregion 监听Curd操作
 
-            return fsql;
-        }
+        #region 审计数据
 
-        /// <summary>
-        /// 获得FreeSql实例
-        /// </summary>
-        /// <param name="ib"></param>
-        /// <param name="serviceProvider"></param>
-        /// <returns></returns>
-        public static IFreeSql GetFreeSql(this IdleBus<IFreeSql> ib, IServiceProvider serviceProvider)
+        //计算服务器时间
+        var selectProvider = fsql.Select<object>() as Select0Provider;
+        var serverTime = fsql.Select<object>().WithSql($"select {selectProvider._commonUtils.NowUtc} a").First(a=> Convert.ToDateTime("a"));
+        var timeOffset = DateTime.UtcNow.Subtract(serverTime);
+        fsql.Aop.AuditValue += (s, e) =>
         {
-            var user = serviceProvider.GetRequiredService<IUser>();
-            var appConfig = serviceProvider.GetRequiredService<AppConfig>();
+            DbHelper.AuditValue(e, timeOffset, user);
+        };
 
-            var tenantId = user.TenantId;
-            if (appConfig.Tenant && user.DataIsolationType == DataIsolationType.OwnDb && tenantId.HasValue)
-            {
-                var tenantName = "tenant_" + tenantId.ToString();
-                var exists = ib.Exists(tenantName);
-                if (!exists)
-                {
-                    var dbConfig = serviceProvider.GetRequiredService<DbConfig>();
-                    //查询租户数据库信息
-                    var masterDb = serviceProvider.GetRequiredService<IFreeSql>();
-                    var tenant = masterDb.Select<TenantEntity>().DisableGlobalFilter("Tenant").WhereDynamic(tenantId).ToOne<CreateFreeSqlTenantDto>();
+        #endregion 审计数据
 
-                    var timeSpan = tenant.IdleTime.HasValue && tenant.IdleTime.Value > 0 ? TimeSpan.FromMinutes(tenant.IdleTime.Value) : TimeSpan.MaxValue;
-                    ib.TryRegister(tenantName, () => CreateFreeSql(user, appConfig, dbConfig, tenant), timeSpan);
-                }
+        return fsql;
+    }
 
-                return ib.Get(tenantName);
-            }
-            else
+    /// <summary>
+    /// 获得FreeSql实例
+    /// </summary>
+    /// <param name="ib"></param>
+    /// <param name="serviceProvider"></param>
+    /// <returns></returns>
+    public static IFreeSql GetFreeSql(this IdleBus<IFreeSql> ib, IServiceProvider serviceProvider)
+    {
+        var user = serviceProvider.GetRequiredService<IUser>();
+        var appConfig = serviceProvider.GetRequiredService<AppConfig>();
+
+        var tenantId = user.TenantId;
+        if (appConfig.Tenant && user.DataIsolationType == DataIsolationType.OwnDb && tenantId.HasValue)
+        {
+            var tenantName = "tenant_" + tenantId.ToString();
+            var exists = ib.Exists(tenantName);
+            if (!exists)
             {
-                var freeSql = serviceProvider.GetRequiredService<IFreeSql>();
-                return freeSql;
+                var dbConfig = serviceProvider.GetRequiredService<DbConfig>();
+                //查询租户数据库信息
+                var masterDb = serviceProvider.GetRequiredService<IFreeSql>();
+                var tenant = masterDb.Select<TenantEntity>().DisableGlobalFilter("Tenant").WhereDynamic(tenantId).ToOne<CreateFreeSqlTenantDto>();
+
+                var timeSpan = tenant.IdleTime.HasValue && tenant.IdleTime.Value > 0 ? TimeSpan.FromMinutes(tenant.IdleTime.Value) : TimeSpan.MaxValue;
+                ib.TryRegister(tenantName, () => CreateFreeSql(user, appConfig, dbConfig, tenant), timeSpan);
             }
+
+            return ib.Get(tenantName);
         }
+        else
+        {
+            var freeSql = serviceProvider.GetRequiredService<IFreeSql>();
+            return freeSql;
+        }
+    }
 
-        /// <summary>
-        /// 获得租户FreeSql实例
-        /// </summary>
-        /// <param name="ib"></param>
-        /// <param name="serviceProvider"></param>
-        /// <param name="tenantId"></param>
-        /// <returns></returns>
-        public static IFreeSql GetTenantFreeSql(this IdleBus<IFreeSql> ib, IServiceProvider serviceProvider, long? tenantId = null)
+    /// <summary>
+    /// 获得租户FreeSql实例
+    /// </summary>
+    /// <param name="ib"></param>
+    /// <param name="serviceProvider"></param>
+    /// <param name="tenantId"></param>
+    /// <returns></returns>
+    public static IFreeSql GetTenantFreeSql(this IdleBus<IFreeSql> ib, IServiceProvider serviceProvider, long? tenantId = null)
+    {
+        if (tenantId.HasValue)
         {
-            if (tenantId.HasValue)
+            var user = serviceProvider.GetRequiredService<IUser>();
+            var appConfig = serviceProvider.GetRequiredService<AppConfig>();
+            var tenantName = "tenant_" + tenantId.ToString();
+            var exists = ib.Exists(tenantName);
+            if (!exists)
             {
-                var user = serviceProvider.GetRequiredService<IUser>();
-                var appConfig = serviceProvider.GetRequiredService<AppConfig>();
-                var tenantName = "tenant_" + tenantId.ToString();
-                var exists = ib.Exists(tenantName);
-                if (!exists)
-                {
-                    var dbConfig = serviceProvider.GetRequiredService<DbConfig>();
-                    //查询租户数据库信息
-                    var masterDb = serviceProvider.GetRequiredService<IFreeSql>();
-                    var tenant = masterDb.Select<TenantEntity>().DisableGlobalFilter("Tenant").WhereDynamic(tenantId).ToOne<CreateFreeSqlTenantDto>();
+                var dbConfig = serviceProvider.GetRequiredService<DbConfig>();
+                //查询租户数据库信息
+                var masterDb = serviceProvider.GetRequiredService<IFreeSql>();
+                var tenant = masterDb.Select<TenantEntity>().DisableGlobalFilter("Tenant").WhereDynamic(tenantId).ToOne<CreateFreeSqlTenantDto>();
 
-                    var timeSpan = tenant.IdleTime.HasValue && tenant.IdleTime.Value > 0 ? TimeSpan.FromMinutes(tenant.IdleTime.Value) : TimeSpan.MaxValue;
-                    ib.TryRegister(tenantName, () => CreateFreeSql(user, appConfig, dbConfig, tenant), timeSpan);
-                }
-
-                return ib.Get(tenantName);
+                var timeSpan = tenant.IdleTime.HasValue && tenant.IdleTime.Value > 0 ? TimeSpan.FromMinutes(tenant.IdleTime.Value) : TimeSpan.MaxValue;
+                ib.TryRegister(tenantName, () => CreateFreeSql(user, appConfig, dbConfig, tenant), timeSpan);
             }
 
-            return null;
+            return ib.Get(tenantName);
         }
+
+        return null;
     }
 }

+ 15 - 16
src/platform/ZhonTai.Admin/Core/Db/PropsContractResolver.cs

@@ -3,27 +3,26 @@ using Newtonsoft.Json.Serialization;
 using System.Collections.Generic;
 using System.Reflection;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public class PropsContractResolver : CamelCasePropertyNamesContractResolver
 {
-    public class PropsContractResolver : CamelCasePropertyNamesContractResolver
+    private bool _ignore;
+    private List<string> _propNames = null;
+
+    public PropsContractResolver(List<string> propNames = null, bool ignore = true)
     {
-        private bool _ignore;
-        private List<string> _propNames = null;
+        _propNames = propNames;
+        _ignore = ignore;
+    }
 
-        public PropsContractResolver(List<string> propNames = null, bool ignore = true)
+    protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
+    {
+        if (_propNames != null && _propNames.Contains(member.Name))
         {
-            _propNames = propNames;
-            _ignore = ignore;
+            return _ignore ? null : base.CreateProperty(member, memberSerialization);
         }
 
-        protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
-        {
-            if (_propNames != null && _propNames.Contains(member.Name))
-            {
-                return _ignore ? null : base.CreateProperty(member, memberSerialization);
-            }
-
-            return base.CreateProperty(member, memberSerialization);
-        }
+        return base.CreateProperty(member, memberSerialization);
     }
 }

+ 87 - 88
src/platform/ZhonTai.Admin/Core/Db/SyncData.cs

@@ -8,117 +8,116 @@ using FreeSql.DataAnnotations;
 using ZhonTai.Common.Helpers;
 using ZhonTai.Admin.Core.Configs;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public abstract class SyncData
 {
-    public abstract class SyncData
+    /// <summary>
+    /// 检查实体属性是否为自增长
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    /// <returns></returns>
+    private bool CheckIdentity<T>() where T : class
     {
-        /// <summary>
-        /// 检查实体属性是否为自增长
-        /// </summary>
-        /// <typeparam name="T"></typeparam>
-        /// <returns></returns>
-        private bool CheckIdentity<T>() where T : class
+        var isIdentity = false;
+        var properties = typeof(T).GetProperties();
+        foreach (var property in properties)
         {
-            var isIdentity = false;
-            var properties = typeof(T).GetProperties();
-            foreach (var property in properties)
+            if (property.GetCustomAttributes(typeof(ColumnAttribute), false).FirstOrDefault() is ColumnAttribute columnAttribute && columnAttribute.IsIdentity)
             {
-                if (property.GetCustomAttributes(typeof(ColumnAttribute), false).FirstOrDefault() is ColumnAttribute columnAttribute && columnAttribute.IsIdentity)
-                {
-                    isIdentity = true;
-                    break;
-                }
+                isIdentity = true;
+                break;
             }
-
-            return isIdentity;
         }
 
-        /// <summary>
-        /// 初始化数据表数据
-        /// </summary>
-        /// <typeparam name="T"></typeparam>
-        /// <param name="db"></param>
-        /// <param name="unitOfWork"></param>
-        /// <param name="tran"></param>
-        /// <param name="data"></param>
-        /// <param name="dbConfig"></param>
-        /// <returns></returns>
-        protected virtual async Task InitDataAsync<T>(
-            IFreeSql db,
-            IUnitOfWork unitOfWork,
-            System.Data.Common.DbTransaction tran,
-            T[] data,
-            DbConfig dbConfig = null
-        ) where T : class, new()
-        {
-            var table = typeof(T).GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute;
-            var tableName = table.Name;
+        return isIdentity;
+    }
+
+    /// <summary>
+    /// 初始化数据表数据
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    /// <param name="db"></param>
+    /// <param name="unitOfWork"></param>
+    /// <param name="tran"></param>
+    /// <param name="data"></param>
+    /// <param name="dbConfig"></param>
+    /// <returns></returns>
+    protected virtual async Task InitDataAsync<T>(
+        IFreeSql db,
+        IUnitOfWork unitOfWork,
+        System.Data.Common.DbTransaction tran,
+        T[] data,
+        DbConfig dbConfig = null
+    ) where T : class, new()
+    {
+        var table = typeof(T).GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute;
+        var tableName = table.Name;
 
-            try
+        try
+        {
+            if (await db.Queryable<T>().AnyAsync())
             {
-                if (await db.Queryable<T>().AnyAsync())
-                {
-                    Console.WriteLine($" table: {tableName} record already exists");
-                    return;
-                }
+                Console.WriteLine($" table: {tableName} record already exists");
+                return;
+            }
 
-                if (!(data?.Length > 0))
-                {
-                    Console.WriteLine($" table: {tableName} import data []");
-                    return;
-                }
+            if (!(data?.Length > 0))
+            {
+                Console.WriteLine($" table: {tableName} import data []");
+                return;
+            }
 
-                var repo = db.GetRepository<T>();
-                var insert = db.Insert<T>();
-                if (unitOfWork != null)
-                {
-                    repo.UnitOfWork = unitOfWork;
-                    insert = insert.WithTransaction(tran);
-                }
+            var repo = db.GetRepository<T>();
+            var insert = db.Insert<T>();
+            if (unitOfWork != null)
+            {
+                repo.UnitOfWork = unitOfWork;
+                insert = insert.WithTransaction(tran);
+            }
 
-                var isIdentity = CheckIdentity<T>();
-                if (isIdentity)
+            var isIdentity = CheckIdentity<T>();
+            if (isIdentity)
+            {
+                if (dbConfig.Type == DataType.SqlServer)
                 {
-                    if (dbConfig.Type == DataType.SqlServer)
-                    {
-                        var insrtSql = insert.AppendData(data).InsertIdentity().ToSql();
-                        await repo.Orm.Ado.ExecuteNonQueryAsync($"SET IDENTITY_INSERT {tableName} ON\n {insrtSql} \nSET IDENTITY_INSERT {tableName} OFF");
-                    }
-                    else
-                    {
-                        await insert.AppendData(data).InsertIdentity().ExecuteAffrowsAsync();
-                    }
+                    var insrtSql = insert.AppendData(data).InsertIdentity().ToSql();
+                    await repo.Orm.Ado.ExecuteNonQueryAsync($"SET IDENTITY_INSERT {tableName} ON\n {insrtSql} \nSET IDENTITY_INSERT {tableName} OFF");
                 }
                 else
                 {
-                    repo.DbContextOptions.EnableCascadeSave = true;
-                    await repo.InsertAsync(data);
+                    await insert.AppendData(data).InsertIdentity().ExecuteAffrowsAsync();
                 }
-
-                Console.WriteLine($" table: {tableName} sync data succeed");
             }
-            catch (Exception ex)
+            else
             {
-                Console.WriteLine($" table: {tableName} sync data failed.\n{ex.Message}");
-                throw;
+                repo.DbContextOptions.EnableCascadeSave = true;
+                await repo.InsertAsync(data);
             }
-        }
 
-        protected virtual T[] GetData<T>(bool isTenant = false, string path = "InitData/Admin")
+            Console.WriteLine($" table: {tableName} sync data succeed");
+        }
+        catch (Exception ex)
         {
-            var table = typeof(T).GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute;
-            var fileName = $"{table.Name}{(isTenant ? ".tenant" : "")}.json";
-            var filePath = Path.Combine(AppContext.BaseDirectory, $"{path}/{fileName}").ToPath();
-            if (!File.Exists(filePath))
-            {
-                var msg = $"文件{filePath}不存在";
-                Console.WriteLine(msg);
-                throw new Exception(msg);
-            }
-            var jsonData = FileHelper.ReadFile(filePath);
-            var data = JsonConvert.DeserializeObject<T[]>(jsonData);
+            Console.WriteLine($" table: {tableName} sync data failed.\n{ex.Message}");
+            throw;
+        }
+    }
 
-            return data;
+    protected virtual T[] GetData<T>(bool isTenant = false, string path = "InitData/Admin")
+    {
+        var table = typeof(T).GetCustomAttributes(typeof(TableAttribute), false).FirstOrDefault() as TableAttribute;
+        var fileName = $"{table.Name}{(isTenant ? ".tenant" : "")}.json";
+        var filePath = Path.Combine(AppContext.BaseDirectory, $"{path}/{fileName}").ToPath();
+        if (!File.Exists(filePath))
+        {
+            var msg = $"文件{filePath}不存在";
+            Console.WriteLine(msg);
+            throw new Exception(msg);
         }
+        var jsonData = FileHelper.ReadFile(filePath);
+        var data = JsonConvert.DeserializeObject<T[]>(jsonData);
+
+        return data;
     }
 }

+ 105 - 106
src/platform/ZhonTai.Admin/Core/Db/TransactionAsyncInterceptor.cs

@@ -6,48 +6,77 @@ using FreeSql;
 using ZhonTai.Admin.Core.Attributes;
 using ZhonTai.Admin.Core.Dto;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public class TransactionAsyncInterceptor : IAsyncInterceptor
 {
-    public class TransactionAsyncInterceptor : IAsyncInterceptor
+    private IUnitOfWork _unitOfWork;
+    private readonly DbUnitOfWorkManager _unitOfWorkManager;
+
+    public TransactionAsyncInterceptor(DbUnitOfWorkManager unitOfWorkManager)
     {
-        private IUnitOfWork _unitOfWork;
-        private readonly DbUnitOfWorkManager _unitOfWorkManager;
+        _unitOfWorkManager = unitOfWorkManager;
+    }
 
-        public TransactionAsyncInterceptor(DbUnitOfWorkManager unitOfWorkManager)
+    private bool TryBegin(IInvocation invocation)
+    {
+        var method = invocation.MethodInvocationTarget ?? invocation.Method;
+        var attribute = method.GetCustomAttributes(typeof(TransactionAttribute), false).FirstOrDefault();
+        if (attribute is TransactionAttribute transaction)
         {
-            _unitOfWorkManager = unitOfWorkManager;
+            IsolationLevel? isolationLevel = transaction.IsolationLevel == 0 ? null : transaction.IsolationLevel;
+            _unitOfWork = _unitOfWorkManager.Begin(transaction.Propagation, isolationLevel);
+            return true;
         }
 
-        private bool TryBegin(IInvocation invocation)
+        return false;
+    }
+
+    private async Task InternalInterceptAsynchronous(IInvocation invocation)
+    {
+        //string methodName =
+        //    $"{invocation.MethodInvocationTarget.DeclaringType?.FullName}.{invocation.Method.Name}()";
+        //int? hashCode = _unitOfWork.GetHashCode();
+
+        invocation.Proceed();
+
+        try
         {
-            var method = invocation.MethodInvocationTarget ?? invocation.Method;
-            var attribute = method.GetCustomAttributes(typeof(TransactionAttribute), false).FirstOrDefault();
-            if (attribute is TransactionAttribute transaction)
+            //处理Task返回一个null值的情况会导致空指针
+            if (invocation.ReturnValue != null)
             {
-                IsolationLevel? isolationLevel = transaction.IsolationLevel == 0 ? null : transaction.IsolationLevel;
-                _unitOfWork = _unitOfWorkManager.Begin(transaction.Propagation, isolationLevel);
-                return true;
+                await (Task)invocation.ReturnValue;
             }
-
-            return false;
+            _unitOfWork.Commit();
         }
-
-        private async Task InternalInterceptAsynchronous(IInvocation invocation)
+        catch (System.Exception)
         {
-            //string methodName =
-            //    $"{invocation.MethodInvocationTarget.DeclaringType?.FullName}.{invocation.Method.Name}()";
-            //int? hashCode = _unitOfWork.GetHashCode();
-
-            invocation.Proceed();
+            _unitOfWork.Rollback();
+            throw;
+        }
+        finally
+        {
+            _unitOfWork.Dispose();
+        }
+    }
 
+    private async Task<TResult> InternalInterceptAsynchronous<TResult>(IInvocation invocation)
+    {
+        TResult result;
+        if (TryBegin(invocation))
+        {
             try
             {
-                //处理Task返回一个null值的情况会导致空指针
-                if (invocation.ReturnValue != null)
+                invocation.Proceed();
+                result = await (Task<TResult>)invocation.ReturnValue;
+                if (result is IResultOutput res && !res.Success)
                 {
-                    await (Task)invocation.ReturnValue;
+                    _unitOfWork.Rollback();
+                }
+                else
+                {
+                    _unitOfWork.Commit();
                 }
-                _unitOfWork.Commit();
             }
             catch (System.Exception)
             {
@@ -59,104 +88,74 @@ namespace ZhonTai.Admin.Core.Db
                 _unitOfWork.Dispose();
             }
         }
-
-        private async Task<TResult> InternalInterceptAsynchronous<TResult>(IInvocation invocation)
+        else
         {
-            TResult result;
-            if (TryBegin(invocation))
-            {
-                try
-                {
-                    invocation.Proceed();
-                    result = await (Task<TResult>)invocation.ReturnValue;
-                    if (result is IResultOutput res && !res.Success)
-                    {
-                        _unitOfWork.Rollback();
-                    }
-                    else
-                    {
-                        _unitOfWork.Commit();
-                    }
-                }
-                catch (System.Exception)
-                {
-                    _unitOfWork.Rollback();
-                    throw;
-                }
-                finally
-                {
-                    _unitOfWork.Dispose();
-                }
-            }
-            else
-            {
-                invocation.Proceed();
-                result = await (Task<TResult>)invocation.ReturnValue;
-            }
-            return result;
+            invocation.Proceed();
+            result = await (Task<TResult>)invocation.ReturnValue;
         }
+        return result;
+    }
 
-        /// <summary>
-        /// 拦截同步执行的方法
-        /// </summary>
-        /// <param name="invocation"></param>
-        public void InterceptSynchronous(IInvocation invocation)
+    /// <summary>
+    /// 拦截同步执行的方法
+    /// </summary>
+    /// <param name="invocation"></param>
+    public void InterceptSynchronous(IInvocation invocation)
+    {
+        if (TryBegin(invocation))
         {
-            if (TryBegin(invocation))
+            try
             {
-                try
-                {
-                    invocation.Proceed();
-                    var result = invocation.ReturnValue;
-                    if (result is IResultOutput res && !res.Success)
-                    {
-                        _unitOfWork.Rollback();
-                    }
-                    else
-                    {
-                        _unitOfWork.Commit();
-                    }
-                }
-                catch
+                invocation.Proceed();
+                var result = invocation.ReturnValue;
+                if (result is IResultOutput res && !res.Success)
                 {
                     _unitOfWork.Rollback();
-                    throw;
                 }
-                finally
+                else
                 {
-                    _unitOfWork.Dispose();
+                    _unitOfWork.Commit();
                 }
             }
-            else
-            {
-                invocation.Proceed();
-            }
-        }
-
-        /// <summary>
-        /// 拦截返回结果
-        /// </summary>
-        /// <param name="invocation"></param>
-        public void InterceptAsynchronous(IInvocation invocation)
-        {
-            if (TryBegin(invocation))
+            catch
             {
-                invocation.ReturnValue = InternalInterceptAsynchronous(invocation);
+                _unitOfWork.Rollback();
+                throw;
             }
-            else
+            finally
             {
-                invocation.Proceed();
+                _unitOfWork.Dispose();
             }
         }
+        else
+        {
+            invocation.Proceed();
+        }
+    }
 
-        /// <summary>
-        /// 拦截返回结果
-        /// </summary>
-        /// <typeparam name="TResult"></typeparam>
-        /// <param name="invocation"></param>
-        public void InterceptAsynchronous<TResult>(IInvocation invocation)
+    /// <summary>
+    /// 拦截返回结果
+    /// </summary>
+    /// <param name="invocation"></param>
+    public void InterceptAsynchronous(IInvocation invocation)
+    {
+        if (TryBegin(invocation))
+        {
+            invocation.ReturnValue = InternalInterceptAsynchronous(invocation);
+        }
+        else
         {
-            invocation.ReturnValue = InternalInterceptAsynchronous<TResult>(invocation);
+            invocation.Proceed();
         }
     }
+
+    /// <summary>
+    /// 拦截返回结果
+    /// </summary>
+    /// <typeparam name="TResult"></typeparam>
+    /// <param name="invocation"></param>
+    public void InterceptAsynchronous<TResult>(IInvocation invocation)
+    {
+        invocation.ReturnValue = InternalInterceptAsynchronous<TResult>(invocation);
+    }
 }

+ 11 - 12
src/platform/ZhonTai.Admin/Core/Db/TransactionInterceptor.cs

@@ -1,19 +1,18 @@
 using Castle.DynamicProxy;
 
-namespace ZhonTai.Admin.Core.Db
+namespace ZhonTai.Admin.Core.Db;
+
+public class TransactionInterceptor : IInterceptor
 {
-    public class TransactionInterceptor : IInterceptor
-    {
-        private readonly TransactionAsyncInterceptor _transactionAsyncInterceptor;
+    private readonly TransactionAsyncInterceptor _transactionAsyncInterceptor;
 
-        public TransactionInterceptor(TransactionAsyncInterceptor transactionAsyncInterceptor)
-        {
-            _transactionAsyncInterceptor = transactionAsyncInterceptor;
-        }
+    public TransactionInterceptor(TransactionAsyncInterceptor transactionAsyncInterceptor)
+    {
+        _transactionAsyncInterceptor = transactionAsyncInterceptor;
+    }
 
-        public void Intercept(IInvocation invocation)
-        {
-            _transactionAsyncInterceptor.ToInterceptor().Intercept(invocation);
-        }
+    public void Intercept(IInvocation invocation)
+    {
+        _transactionAsyncInterceptor.ToInterceptor().Intercept(invocation);
     }
 }

+ 6 - 7
src/platform/ZhonTai.Admin/Core/Dbs/MySqlDb.cs

@@ -1,9 +1,8 @@
-namespace ZhonTai.Admin.Core.Dbs
+namespace ZhonTai.Admin.Core.Dbs;
+
+/// <summary>
+/// 多数据库命名
+/// </summary>
+public class MySqlDb
 {
-    /// <summary>
-    /// 多数据库命名
-    /// </summary>
-    public class MySqlDb
-    {
-    }
 }

+ 16 - 17
src/platform/ZhonTai.Admin/Core/Dto/CreateFreeSqlTenantDto.cs

@@ -1,22 +1,21 @@
 using FreeSql;
 
-namespace ZhonTai.Admin.Core.Dto
-{ 
-    public class CreateFreeSqlTenantDto
-    {
-        /// <summary>
-        /// 数据库
-        /// </summary>
-        public DataType? DbType { get; set; }
+namespace ZhonTai.Admin.Core.Dto;
 
-        /// <summary>
-        /// 连接字符串
-        /// </summary>
-        public string ConnectionString { get; set; }
+public class CreateFreeSqlTenantDto
+{
+    /// <summary>
+    /// 数据库
+    /// </summary>
+    public DataType? DbType { get; set; }
 
-        /// <summary>
-        /// 空闲时间(分)
-        /// </summary>
-        public int? IdleTime { get; set; }
-    }
+    /// <summary>
+    /// 连接字符串
+    /// </summary>
+    public string ConnectionString { get; set; }
+
+    /// <summary>
+    /// 空闲时间(分)
+    /// </summary>
+    public int? IdleTime { get; set; }
 }

+ 25 - 26
src/platform/ZhonTai.Admin/Core/Dto/IResultOutput.cs

@@ -1,35 +1,34 @@
-namespace ZhonTai.Admin.Core.Dto
+namespace ZhonTai.Admin.Core.Dto;
+
+/// <summary>
+/// 结果输出接口
+/// </summary>
+public interface IResultOutput
 {
     /// <summary>
-    /// 结果输出接口
+    /// 是否成功
     /// </summary>
-    public interface IResultOutput
-    {
-        /// <summary>
-        /// 是否成功
-        /// </summary>
-        bool Success { get; }
+    bool Success { get; }
 
-        /// <summary>
-        /// 消息
-        /// </summary>
-        string Msg { get; }
+    /// <summary>
+    /// 消息
+    /// </summary>
+    string Msg { get; }
 
-        /// <summary>
-        /// 编码
-        /// </summary>
-        string Code { get; set; }
-    }
+    /// <summary>
+    /// 编码
+    /// </summary>
+    string Code { get; set; }
+}
 
+/// <summary>
+/// 泛型结果输出接口
+/// </summary>
+/// <typeparam name="T"></typeparam>
+public interface IResultOutput<T> : IResultOutput
+{
     /// <summary>
-    /// 泛型结果输出接口
+    /// 返回数据
     /// </summary>
-    /// <typeparam name="T"></typeparam>
-    public interface IResultOutput<T> : IResultOutput
-    {
-        /// <summary>
-        /// 返回数据
-        /// </summary>
-        T Data { get; }
-    }
+    T Data { get; }
 }

+ 25 - 26
src/platform/ZhonTai.Admin/Core/Dto/PageInput.cs

@@ -1,35 +1,34 @@
-namespace ZhonTai.Admin.Core.Dto
+namespace ZhonTai.Admin.Core.Dto;
+
+/// <summary>
+/// 分页信息输入
+/// </summary>
+public class PageInput
 {
     /// <summary>
-    /// 分页信息输入
+    /// 当前页标
     /// </summary>
-    public class PageInput
-    {
-        /// <summary>
-        /// 当前页标
-        /// </summary>
-        public int CurrentPage { get; set; } = 1;
+    public int CurrentPage { get; set; } = 1;
 
-        /// <summary>
-        /// 每页大小
-        /// </summary>
-        public int PageSize { set; get; } = 50;
+    /// <summary>
+    /// 每页大小
+    /// </summary>
+    public int PageSize { set; get; } = 50;
 
-        /// <summary>
-        /// 高级查询条件
-        /// </summary>
-        public FreeSql.Internal.Model.DynamicFilterInfo DynamicFilter { get; set; } = null;
-    }
+    /// <summary>
+    /// 高级查询条件
+    /// </summary>
+    public FreeSql.Internal.Model.DynamicFilterInfo DynamicFilter { get; set; } = null;
+}
 
+/// <summary>
+/// 分页信息输入
+/// </summary>
+/// <typeparam name="T">过滤数据</typeparam>
+public class PageInput<T>: PageInput
+{
     /// <summary>
-    /// 分页信息输入
+    /// 查询条件
     /// </summary>
-    /// <typeparam name="T">过滤数据</typeparam>
-    public class PageInput<T>: PageInput
-    {
-        /// <summary>
-        /// 查询条件
-        /// </summary>
-        public T Filter { get; set; }
-    }
+    public T Filter { get; set; }
 }

+ 12 - 13
src/platform/ZhonTai.Admin/Core/Dto/PageOutput.cs

@@ -1,20 +1,19 @@
 using System.Collections.Generic;
 
-namespace ZhonTai.Admin.Core.Dto
+namespace ZhonTai.Admin.Core.Dto;
+
+/// <summary>
+/// 分页信息输出
+/// </summary>
+public class PageOutput<T>
 {
     /// <summary>
-    /// 分页信息输出
+    /// 数据总数
     /// </summary>
-    public class PageOutput<T>
-    {
-        /// <summary>
-        /// 数据总数
-        /// </summary>
-        public long Total { get; set; } = 0;
+    public long Total { get; set; } = 0;
 
-        /// <summary>
-        /// 数据
-        /// </summary>
-        public IList<T> List { get; set; }
-    }
+    /// <summary>
+    /// 数据
+    /// </summary>
+    public IList<T> List { get; set; }
 }

+ 101 - 102
src/platform/ZhonTai.Admin/Core/Dto/ResultOutput.cs

@@ -1,124 +1,123 @@
-namespace ZhonTai.Admin.Core.Dto
+namespace ZhonTai.Admin.Core.Dto;
+
+/// <summary>
+/// 结果输出
+/// </summary>
+public class ResultOutput<T> : IResultOutput<T>
 {
     /// <summary>
-    /// 结果输出
+    /// 是否成功标记
     /// </summary>
-    public class ResultOutput<T> : IResultOutput<T>
-    {
-        /// <summary>
-        /// 是否成功标记
-        /// </summary>
-        public bool Success { get; private set; }
+    public bool Success { get; private set; }
 
-        /// <summary>
-        /// 编码
-        /// </summary>
-        public string Code { get; set; }
+    /// <summary>
+    /// 编码
+    /// </summary>
+    public string Code { get; set; }
 
-        /// <summary>
-        /// 消息
-        /// </summary>
-        public string Msg { get; private set; }
+    /// <summary>
+    /// 消息
+    /// </summary>
+    public string Msg { get; private set; }
 
-        /// <summary>
-        /// 数据
-        /// </summary>
-        public T Data { get; private set; }
+    /// <summary>
+    /// 数据
+    /// </summary>
+    public T Data { get; private set; }
 
-        /// <summary>
-        /// 成功
-        /// </summary>
-        /// <param name="data">数据</param>
-        /// <param name="msg">消息</param>
-        public ResultOutput<T> Ok(T data, string msg = null)
-        {
-            Success = true;
-            Data = data;
-            Msg = msg;
+    /// <summary>
+    /// 成功
+    /// </summary>
+    /// <param name="data">数据</param>
+    /// <param name="msg">消息</param>
+    public ResultOutput<T> Ok(T data, string msg = null)
+    {
+        Success = true;
+        Data = data;
+        Msg = msg;
 
-            return this;
-        }
+        return this;
+    }
 
-        /// <summary>
-        /// 失败
-        /// </summary>
-        /// <param name="msg">消息</param>
-        /// <param name="data">数据</param>
-        /// <returns></returns>
-        public ResultOutput<T> NotOk(string msg = null, T data = default)
-        {
-            Success = false;
-            Msg = msg;
-            Data = data;
+    /// <summary>
+    /// 失败
+    /// </summary>
+    /// <param name="msg">消息</param>
+    /// <param name="data">数据</param>
+    /// <returns></returns>
+    public ResultOutput<T> NotOk(string msg = null, T data = default)
+    {
+        Success = false;
+        Msg = msg;
+        Data = data;
 
-            return this;
-        }
+        return this;
     }
+}
 
+/// <summary>
+/// 静态结果输出
+/// </summary>
+public static partial class ResultOutput
+{
     /// <summary>
-    /// 静态结果输出
+    /// 成功
     /// </summary>
-    public static partial class ResultOutput
+    /// <param name="data">数据</param>
+    /// <param name="msg">消息</param>
+    /// <returns></returns>
+    public static IResultOutput Ok<T>(T data = default(T), string msg = null)
     {
-        /// <summary>
-        /// 成功
-        /// </summary>
-        /// <param name="data">数据</param>
-        /// <param name="msg">消息</param>
-        /// <returns></returns>
-        public static IResultOutput Ok<T>(T data = default(T), string msg = null)
-        {
-            return new ResultOutput<T>().Ok(data, msg);
-        }
+        return new ResultOutput<T>().Ok(data, msg);
+    }
 
-        /// <summary>
-        /// 成功
-        /// </summary>
-        /// <returns></returns>
-        public static IResultOutput Ok()
-        {
-            return Ok<string>();
-        }
+    /// <summary>
+    /// 成功
+    /// </summary>
+    /// <returns></returns>
+    public static IResultOutput Ok()
+    {
+        return Ok<string>();
+    }
 
-        /// <summary>
-        /// 失败
-        /// </summary>
-        /// <param name="msg">消息</param>
-        /// <param name="data">数据</param>
-        /// <returns></returns>
-        public static IResultOutput NotOk<T>(string msg = null, T data = default)
-        {
-            return new ResultOutput<T>().NotOk(msg, data);
-        }
+    /// <summary>
+    /// 失败
+    /// </summary>
+    /// <param name="msg">消息</param>
+    /// <param name="data">数据</param>
+    /// <returns></returns>
+    public static IResultOutput NotOk<T>(string msg = null, T data = default)
+    {
+        return new ResultOutput<T>().NotOk(msg, data);
+    }
 
-        /// <summary>
-        /// 失败
-        /// </summary>
-        /// <param name="msg">消息</param>
-        /// <returns></returns>
-        public static IResultOutput NotOk(string msg = null)
-        {
-            return new ResultOutput<string>().NotOk(msg);
-        }
+    /// <summary>
+    /// 失败
+    /// </summary>
+    /// <param name="msg">消息</param>
+    /// <returns></returns>
+    public static IResultOutput NotOk(string msg = null)
+    {
+        return new ResultOutput<string>().NotOk(msg);
+    }
 
-        /// <summary>
-        /// 根据布尔值返回结果
-        /// </summary>
-        /// <param name="success"></param>
-        /// <returns></returns>
-        public static IResultOutput Result<T>(bool success)
-        {
-            return success ? Ok<T>() : NotOk<T>();
-        }
+    /// <summary>
+    /// 根据布尔值返回结果
+    /// </summary>
+    /// <param name="success"></param>
+    /// <returns></returns>
+    public static IResultOutput Result<T>(bool success)
+    {
+        return success ? Ok<T>() : NotOk<T>();
+    }
 
-        /// <summary>
-        /// 根据布尔值返回结果
-        /// </summary>
-        /// <param name="success"></param>
-        /// <returns></returns>
-        public static IResultOutput Result(bool success)
-        {
-            return success ? Ok() : NotOk();
-        }
+    /// <summary>
+    /// 根据布尔值返回结果
+    /// </summary>
+    /// <param name="success"></param>
+    /// <returns></returns>
+    public static IResultOutput Result(bool success)
+    {
+        return success ? Ok() : NotOk();
     }
 }

+ 24 - 25
src/platform/ZhonTai.Admin/Core/Entities/DataIsolationType.cs

@@ -1,34 +1,33 @@
 using System.ComponentModel;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 数据隔离类型
+/// </summary>
+public enum DataIsolationType
 {
     /// <summary>
-    /// 数据隔离类型
+    /// 独立数据库
     /// </summary>
-    public enum DataIsolationType
-    {
-        /// <summary>
-        /// 独立数据库
-        /// </summary>
-        [Description("独立数据库")]
-        OwnDb = 1,
+    [Description("独立数据库")]
+    OwnDb = 1,
 
-        /// <summary>
-        /// 独立数据表
-        /// </summary>
-        [Description("独立数据表")]
-        OwnDt = 2,
+    /// <summary>
+    /// 独立数据表
+    /// </summary>
+    [Description("独立数据表")]
+    OwnDt = 2,
 
-        /// <summary>
-        /// 共享数据库,独立架构
-        /// </summary>
-        [Description("独立架构")]
-        Schema = 3,
+    /// <summary>
+    /// 共享数据库,独立架构
+    /// </summary>
+    [Description("独立架构")]
+    Schema = 3,
 
-        /// <summary>
-        /// 共享数据库
-        /// </summary>
-        [Description("共享数据库")]
-        Share = 4
-    }
+    /// <summary>
+    /// 共享数据库
+    /// </summary>
+    [Description("共享数据库")]
+    Share = 4
 }

+ 23 - 24
src/platform/ZhonTai.Admin/Core/Entities/Entity.cs

@@ -2,32 +2,31 @@
 using System.ComponentModel;
 using ZhonTai.Admin.Core.Attributes;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+public interface IEntity<TKey>
 {
-    public interface IEntity<TKey>
-    {
-        /// <summary>
-        /// 主键Id
-        /// </summary>
-        TKey Id { get; set; }
-    }
+    /// <summary>
+    /// 主键Id
+    /// </summary>
+    TKey Id { get; set; }
+}
 
-    public interface IEntity : IEntity<long>
-    {
-    }
+public interface IEntity : IEntity<long>
+{
+}
 
-    public class Entity<TKey> : IEntity<TKey>
-    {
-        /// <summary>
-        /// 主键Id
-        /// </summary>
-        [Description("主键Id")]
-        [Snowflake]
-        [Column(Position = 1, IsIdentity = false, IsPrimary = true)]
-        public virtual TKey Id { get; set; }
-    }
+public class Entity<TKey> : IEntity<TKey>
+{
+    /// <summary>
+    /// 主键Id
+    /// </summary>
+    [Description("主键Id")]
+    [Snowflake]
+    [Column(Position = 1, IsIdentity = false, IsPrimary = true)]
+    public virtual TKey Id { get; set; }
+}
 
-    public class Entity : Entity<long>
-    {
-    }
+public class Entity : Entity<long>
+{
 }

+ 25 - 26
src/platform/ZhonTai.Admin/Core/Entities/EntityAdd.cs

@@ -3,36 +3,35 @@ using System;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 实体创建
+/// </summary>
+public class EntityAdd<TKey> : Entity<TKey>, IEntityAdd<TKey> where TKey : struct
 {
     /// <summary>
-    /// 实体创建
+    /// 创建者Id
     /// </summary>
-    public class EntityAdd<TKey> : Entity<TKey>, IEntityAdd<TKey> where TKey : struct
-    {
-        /// <summary>
-        /// 创建者Id
-        /// </summary>
-        [Description("创建者Id")]
-        [Column(Position = -3, CanUpdate = false)]
-        public long? CreatedUserId { get; set; }
+    [Description("创建者Id")]
+    [Column(Position = -3, CanUpdate = false)]
+    public long? CreatedUserId { get; set; }
 
-        /// <summary>
-        /// 创建者
-        /// </summary>
-        [Description("创建者")]
-        [Column(Position = -2, CanUpdate = false), MaxLength(50)]
-        public string CreatedUserName { get; set; }
+    /// <summary>
+    /// 创建者
+    /// </summary>
+    [Description("创建者")]
+    [Column(Position = -2, CanUpdate = false), MaxLength(50)]
+    public string CreatedUserName { get; set; }
 
-        /// <summary>
-        /// 创建时间
-        /// </summary>
-        [Description("创建时间")]
-        [Column(Position = -1, CanUpdate = false, ServerTime = DateTimeKind.Local)]
-        public DateTime? CreatedTime { get; set; }
-    }
+    /// <summary>
+    /// 创建时间
+    /// </summary>
+    [Description("创建时间")]
+    [Column(Position = -1, CanUpdate = false, ServerTime = DateTimeKind.Local)]
+    public DateTime? CreatedTime { get; set; }
+}
 
-    public class EntityAdd : EntityAdd<long>
-    {
-    }
+public class EntityAdd : EntityAdd<long>
+{
 }

+ 57 - 58
src/platform/ZhonTai.Admin/Core/Entities/EntityFull.cs

@@ -3,74 +3,73 @@ using System;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 实体完整类
+/// </summary>
+public class EntityFull<TKey> : Entity<TKey>, IEntityVersion, IEntitySoftDelete, IEntityAdd<TKey>, IEntityUpdate<TKey> where TKey : struct
 {
     /// <summary>
-    /// 实体完整类
+    /// 版本
     /// </summary>
-    public class EntityFull<TKey> : Entity<TKey>, IEntityVersion, IEntitySoftDelete, IEntityAdd<TKey>, IEntityUpdate<TKey> where TKey : struct
-    {
-        /// <summary>
-        /// 版本
-        /// </summary>
-        [Description("版本")]
-        [Column(Position = -9, IsVersion = true)]
-        public long Version { get; set; }
-
-        /// <summary>
-        /// 是否删除
-        /// </summary>
-        [Description("是否删除")]
-        [Column(Position = -8)]
-        public bool IsDeleted { get; set; } = false;
+    [Description("版本")]
+    [Column(Position = -9, IsVersion = true)]
+    public long Version { get; set; }
 
-        /// <summary>
-        /// 创建者Id
-        /// </summary>
-        [Description("创建者Id")]
-        [Column(Position = -7, CanUpdate = false)]
-        public long? CreatedUserId { get; set; }
+    /// <summary>
+    /// 是否删除
+    /// </summary>
+    [Description("是否删除")]
+    [Column(Position = -8)]
+    public bool IsDeleted { get; set; } = false;
 
-        /// <summary>
-        /// 创建者
-        /// </summary>
-        [Description("创建者")]
-        [Column(Position = -6, CanUpdate = false), MaxLength(50)]
-        public string CreatedUserName { get; set; }
+    /// <summary>
+    /// 创建者Id
+    /// </summary>
+    [Description("创建者Id")]
+    [Column(Position = -7, CanUpdate = false)]
+    public long? CreatedUserId { get; set; }
 
-        /// <summary>
-        /// 创建时间
-        /// </summary>
-        [Description("创建时间")]
-        [Column(Position = -5, CanUpdate = false, ServerTime = DateTimeKind.Local)]
-        public DateTime? CreatedTime { get; set; }
+    /// <summary>
+    /// 创建者
+    /// </summary>
+    [Description("创建者")]
+    [Column(Position = -6, CanUpdate = false), MaxLength(50)]
+    public string CreatedUserName { get; set; }
 
-        /// <summary>
-        /// 修改者Id
-        /// </summary>
-        [Description("修改者Id")]
-        [Column(Position = -4, CanInsert = false)]
-        public long? ModifiedUserId { get; set; }
+    /// <summary>
+    /// 创建时间
+    /// </summary>
+    [Description("创建时间")]
+    [Column(Position = -5, CanUpdate = false, ServerTime = DateTimeKind.Local)]
+    public DateTime? CreatedTime { get; set; }
 
-        /// <summary>
-        /// 修改者
-        /// </summary>
-        [Description("修改者")]
-        [Column(Position = -2, CanInsert = false), MaxLength(50)]
-        public string ModifiedUserName { get; set; }
+    /// <summary>
+    /// 修改者Id
+    /// </summary>
+    [Description("修改者Id")]
+    [Column(Position = -4, CanInsert = false)]
+    public long? ModifiedUserId { get; set; }
 
-        /// <summary>
-        /// 修改时间
-        /// </summary>
-        [Description("修改时间")]
-        [Column(Position = -1, CanInsert = false, ServerTime = DateTimeKind.Local)]
-        public DateTime? ModifiedTime { get; set; }
-    }
+    /// <summary>
+    /// 修改者
+    /// </summary>
+    [Description("修改者")]
+    [Column(Position = -2, CanInsert = false), MaxLength(50)]
+    public string ModifiedUserName { get; set; }
 
     /// <summary>
-    /// 实体完整类
+    /// 修改时间
     /// </summary>
-    public class EntityFull : EntityFull<long>
-    {
-    }
+    [Description("修改时间")]
+    [Column(Position = -1, CanInsert = false, ServerTime = DateTimeKind.Local)]
+    public DateTime? ModifiedTime { get; set; }
+}
+
+/// <summary>
+/// 实体完整类
+/// </summary>
+public class EntityFull : EntityFull<long>
+{
 }

+ 13 - 14
src/platform/ZhonTai.Admin/Core/Entities/EntitySoftDelete.cs

@@ -1,22 +1,21 @@
 using FreeSql.DataAnnotations;
 using System.ComponentModel;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 实体软删除
+/// </summary>
+public class EntitySoftDelete<TKey> : Entity<TKey>, IEntitySoftDelete
 {
     /// <summary>
-    /// 实体软删除
+    /// 是否删除
     /// </summary>
-    public class EntitySoftDelete<TKey> : Entity<TKey>, IEntitySoftDelete
-    {
-        /// <summary>
-        /// 是否删除
-        /// </summary>
-        [Description("是否删除")]
-        [Column(Position = -1)]
-        public bool IsDeleted { get; set; } = false;
-    }
+    [Description("是否删除")]
+    [Column(Position = -1)]
+    public bool IsDeleted { get; set; } = false;
+}
 
-    public class EntitySoftDelete : EntitySoftDelete<long>
-    {
-    }
+public class EntitySoftDelete : EntitySoftDelete<long>
+{
 }

+ 25 - 26
src/platform/ZhonTai.Admin/Core/Entities/EntityUpdate.cs

@@ -3,36 +3,35 @@ using System;
 using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 实体修改
+/// </summary>
+public class EntityUpdate<TKey> : Entity<TKey>, IEntityUpdate<TKey> where TKey : struct
 {
     /// <summary>
-    /// 实体修改
+    /// 修改者Id
     /// </summary>
-    public class EntityUpdate<TKey> : Entity<TKey>, IEntityUpdate<TKey> where TKey : struct
-    {
-        /// <summary>
-        /// 修改者Id
-        /// </summary>
-        [Description("修改者Id")]
-        [Column(Position = -3, CanInsert = false)]
-        public long? ModifiedUserId { get; set; }
+    [Description("修改者Id")]
+    [Column(Position = -3, CanInsert = false)]
+    public long? ModifiedUserId { get; set; }
 
-        /// <summary>
-        /// 修改者
-        /// </summary>
-        [Description("修改者")]
-        [Column(Position = -2, CanInsert = false), MaxLength(50)]
-        public string ModifiedUserName { get; set; }
+    /// <summary>
+    /// 修改者
+    /// </summary>
+    [Description("修改者")]
+    [Column(Position = -2, CanInsert = false), MaxLength(50)]
+    public string ModifiedUserName { get; set; }
 
-        /// <summary>
-        /// 修改时间
-        /// </summary>
-        [Description("修改时间")]
-        [Column(Position = -1, CanInsert = false, ServerTime = DateTimeKind.Local)]
-        public DateTime? ModifiedTime { get; set; }
-    }
+    /// <summary>
+    /// 修改时间
+    /// </summary>
+    [Description("修改时间")]
+    [Column(Position = -1, CanInsert = false, ServerTime = DateTimeKind.Local)]
+    public DateTime? ModifiedTime { get; set; }
+}
 
-    public class EntityUpdate : EntityUpdate<long>
-    {
-    }
+public class EntityUpdate : EntityUpdate<long>
+{
 }

+ 13 - 14
src/platform/ZhonTai.Admin/Core/Entities/EntityVersion.cs

@@ -1,22 +1,21 @@
 using FreeSql.DataAnnotations;
 using System.ComponentModel;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 实体版本
+/// </summary>
+public class EntityVersion<TKey> : Entity<TKey>, IEntityVersion
 {
     /// <summary>
-    /// 实体版本
+    /// 版本
     /// </summary>
-    public class EntityVersion<TKey> : Entity<TKey>, IEntityVersion
-    {
-        /// <summary>
-        /// 版本
-        /// </summary>
-        [Description("版本")]
-        [Column(Position = -1, IsVersion = true)]
-        public long Version { get; set; }
-    }
+    [Description("版本")]
+    [Column(Position = -1, IsVersion = true)]
+    public long Version { get; set; }
+}
 
-    public class EntityVersion : EntityVersion<long>
-    {
-    }
+public class EntityVersion : EntityVersion<long>
+{
 }

+ 6 - 7
src/platform/ZhonTai.Admin/Core/Entities/IEntityAdd.cs

@@ -1,11 +1,10 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+public interface IEntityAdd<TKey> where TKey : struct
 {
-    public interface IEntityAdd<TKey> where TKey : struct
-    {
-        long? CreatedUserId { get; set; }
-        string CreatedUserName { get; set; }
-        DateTime? CreatedTime { get; set; }
-    }
+    long? CreatedUserId { get; set; }
+    string CreatedUserName { get; set; }
+    DateTime? CreatedTime { get; set; }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Entities/IEntitySoftDelete.cs

@@ -1,10 +1,9 @@
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+public interface IEntitySoftDelete
 {
-    public interface IEntitySoftDelete
-    {
-        /// <summary>
-        /// 是否删除
-        /// </summary>
-        bool IsDeleted { get; set; }
-    }
+    /// <summary>
+    /// 是否删除
+    /// </summary>
+    bool IsDeleted { get; set; }
 }

+ 6 - 7
src/platform/ZhonTai.Admin/Core/Entities/IEntityUpdate.cs

@@ -1,11 +1,10 @@
 using System;
 
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+public interface IEntityUpdate<TKey> where TKey : struct
 {
-    public interface IEntityUpdate<TKey> where TKey : struct
-    {
-        long? ModifiedUserId { get; set; }
-        string ModifiedUserName { get; set; }
-        DateTime? ModifiedTime { get; set; }
-    }
+    long? ModifiedUserId { get; set; }
+    string ModifiedUserName { get; set; }
+    DateTime? ModifiedTime { get; set; }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Entities/IEntityVersion.cs

@@ -1,10 +1,9 @@
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+public interface IEntityVersion
 {
-    public interface IEntityVersion
-    {
-        /// <summary>
-        /// 版本
-        /// </summary>
-        long Version { get; set; }
-    }
+    /// <summary>
+    /// 版本
+    /// </summary>
+    long Version { get; set; }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Entities/ITenant.cs

@@ -1,10 +1,9 @@
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+public interface ITenant
 {
-    public interface ITenant
-    {
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        long? TenantId { get; set; }
-    }
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    long? TenantId { get; set; }
 }

+ 12 - 13
src/platform/ZhonTai.Admin/Core/Entities/TenantType.cs

@@ -1,18 +1,17 @@
-namespace ZhonTai.Admin.Core.Entities
+namespace ZhonTai.Admin.Core.Entities;
+
+/// <summary>
+/// 租户类型
+/// </summary>
+public enum TenantType
 {
     /// <summary>
-    /// 租户类型
+    /// 平台
     /// </summary>
-    public enum TenantType
-    {
-        /// <summary>
-        /// 平台
-        /// </summary>
-        Platform = 1,
+    Platform = 1,
 
-        /// <summary>
-        /// 租户
-        /// </summary>
-        Tenant = 2
-    }
+    /// <summary>
+    /// 租户
+    /// </summary>
+    Tenant = 2
 }

+ 12 - 13
src/platform/ZhonTai.Admin/Core/Enums/ApiVersion.cs

@@ -1,18 +1,17 @@
-namespace ZhonTai.Admin.Core.Enums
+namespace ZhonTai.Admin.Core.Enums;
+
+/// <summary>
+/// 接口版本
+/// </summary>
+public enum ApiVersion
 {
     /// <summary>
-    /// 接口版本
+    /// V1 版本
     /// </summary>
-    public enum ApiVersion
-    {
-        /// <summary>
-        /// V1 版本
-        /// </summary>
-        V1 = 1,
+    V1 = 1,
 
-        /// <summary>
-        /// V2 版本
-        /// </summary>
-        V2 = 2,
-    }
+    /// <summary>
+    /// V2 版本
+    /// </summary>
+    V2 = 2,
 }

+ 5 - 6
src/platform/ZhonTai.Admin/Core/Enums/ContentTypeEnum.cs

@@ -1,8 +1,7 @@
-namespace ZhonTai.Admin.Core.Enums
+namespace ZhonTai.Admin.Core.Enums;
+
+public enum ContentTypeEnum
 {
-    public enum ContentTypeEnum
-    {
-        FormData,
-        Json
-    }
+    FormData,
+    Json
 }

+ 34 - 35
src/platform/ZhonTai.Admin/Core/Enums/StatusCodes.cs

@@ -1,46 +1,45 @@
 using System.ComponentModel;
 
-namespace ZhonTai.Admin.Core.Enums
+namespace ZhonTai.Admin.Core.Enums;
+
+/// <summary>
+/// 状态码枚举
+/// </summary>
+public enum StatusCodes
 {
     /// <summary>
-    /// 状态码枚举
+    /// 操作失败
     /// </summary>
-    public enum StatusCodes
-    {
-        /// <summary>
-        /// 操作失败
-        /// </summary>
-        [Description("操作失败")]
-        Status0NotOk = 0,
+    [Description("操作失败")]
+    Status0NotOk = 0,
 
-        /// <summary>
-        /// 操作成功
-        /// </summary>
-        [Description("操作成功")]
-        Status1Ok = 1,
+    /// <summary>
+    /// 操作成功
+    /// </summary>
+    [Description("操作成功")]
+    Status1Ok = 1,
 
-        /// <summary>
-        /// 未登录(需要重新登录)
-        /// </summary>
-        [Description("未登录")]
-        Status401Unauthorized = 401,
+    /// <summary>
+    /// 未登录(需要重新登录)
+    /// </summary>
+    [Description("未登录")]
+    Status401Unauthorized = 401,
 
-        /// <summary>
-        /// 权限不足
-        /// </summary>
-        [Description("权限不足")]
-        Status403Forbidden = 403,
+    /// <summary>
+    /// 权限不足
+    /// </summary>
+    [Description("权限不足")]
+    Status403Forbidden = 403,
 
-        /// <summary>
-        /// 资源不存在
-        /// </summary>
-        [Description("资源不存在")]
-        Status404NotFound = 404,
+    /// <summary>
+    /// 资源不存在
+    /// </summary>
+    [Description("资源不存在")]
+    Status404NotFound = 404,
 
-        /// <summary>
-        /// 系统内部错误(非业务代码里显式抛出的异常,例如由于数据不正确导致空指针异常、数据库异常等等)
-        /// </summary>
-        [Description("系统内部错误")]
-        Status500InternalServerError = 500
-    }
+    /// <summary>
+    /// 系统内部错误(非业务代码里显式抛出的异常,例如由于数据不正确导致空指针异常、数据库异常等等)
+    /// </summary>
+    [Description("系统内部错误")]
+    Status500InternalServerError = 500
 }

+ 28 - 29
src/platform/ZhonTai.Admin/Core/Extensions/RateLimitServiceCollectionExtensions.cs

@@ -5,39 +5,38 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using ZhonTai.Admin.Tools.Cache;
 
-namespace ZhonTai.Admin.Core.Extensions
+namespace ZhonTai.Admin.Core.Extensions;
+
+public static class RateLimitServiceCollectionExtensions
 {
-    public static class RateLimitServiceCollectionExtensions
+    /// <summary>
+    /// 添加Ip限流
+    /// </summary>
+    /// <param name="services"></param>
+    /// <param name="configuration"></param>
+    /// <param name="cacheConfig"></param>
+    public static void AddIpRateLimit(this IServiceCollection services, IConfiguration configuration, CacheConfig cacheConfig)
     {
-        /// <summary>
-        /// 添加Ip限流
-        /// </summary>
-        /// <param name="services"></param>
-        /// <param name="configuration"></param>
-        /// <param name="cacheConfig"></param>
-        public static void AddIpRateLimit(this IServiceCollection services, IConfiguration configuration, CacheConfig cacheConfig)
-        {
-            #region IP限流
+        #region IP限流
 
-            services.Configure<IpRateLimitOptions>(configuration.GetSection("IpRateLimiting"));
-            services.Configure<IpRateLimitPolicies>(configuration.GetSection("IpRateLimitPolicies"));
+        services.Configure<IpRateLimitOptions>(configuration.GetSection("IpRateLimiting"));
+        services.Configure<IpRateLimitPolicies>(configuration.GetSection("IpRateLimitPolicies"));
 
-            if (cacheConfig.TypeRateLimit == CacheType.Redis)
-            {
-                //redis
-                var redisRateLimit = new CSRedis.CSRedisClient(cacheConfig.Redis.ConnectionStringRateLimit);
-                services.AddSingleton<IDistributedCache>(new CSRedisCache(redisRateLimit));
-                services.AddDistributedRateLimiting();
-            }
-            else
-            {
-                //内存
-                services.AddMemoryCache();
-                services.AddInMemoryRateLimiting();
-            }
-            services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();
-
-            #endregion IP限流
+        if (cacheConfig.TypeRateLimit == CacheType.Redis)
+        {
+            //redis
+            var redisRateLimit = new CSRedis.CSRedisClient(cacheConfig.Redis.ConnectionStringRateLimit);
+            services.AddSingleton<IDistributedCache>(new CSRedisCache(redisRateLimit));
+            services.AddDistributedRateLimiting();
         }
+        else
+        {
+            //内存
+            services.AddMemoryCache();
+            services.AddInMemoryRateLimiting();
+        }
+        services.AddSingleton<IRateLimitConfiguration, RateLimitConfiguration>();
+
+        #endregion IP限流
     }
 }

+ 18 - 19
src/platform/ZhonTai.Admin/Core/Extensions/UploadConfigApplicationBuilderExtensions.cs

@@ -5,31 +5,30 @@ using Microsoft.Extensions.Options;
 using System.IO;
 using ZhonTai.Admin.Core.Configs;
 
-namespace ZhonTai.Admin.Core.Extensions
+namespace ZhonTai.Admin.Core.Extensions;
+
+public static class UploadConfigApplicationBuilderExtensions
 {
-    public static class UploadConfigApplicationBuilderExtensions
+    private static void UseFileUploadConfig(IApplicationBuilder app, FileUploadConfig config)
     {
-        private static void UseFileUploadConfig(IApplicationBuilder app, FileUploadConfig config)
+        if (!Directory.Exists(config.UploadPath))
         {
-            if (!Directory.Exists(config.UploadPath))
-            {
-                Directory.CreateDirectory(config.UploadPath);
-            }
-
-            app.UseStaticFiles(new StaticFileOptions()
-            {
-                RequestPath = config.RequestPath,
-                FileProvider = new PhysicalFileProvider(config.UploadPath)
-            });
+            Directory.CreateDirectory(config.UploadPath);
         }
 
-        public static IApplicationBuilder UseUploadConfig(this IApplicationBuilder app)
+        app.UseStaticFiles(new StaticFileOptions()
         {
-            var uploadConfig = app.ApplicationServices.GetRequiredService<IOptions<UploadConfig>>();
-            UseFileUploadConfig(app, uploadConfig.Value.Avatar);
-            UseFileUploadConfig(app, uploadConfig.Value.Document);
+            RequestPath = config.RequestPath,
+            FileProvider = new PhysicalFileProvider(config.UploadPath)
+        });
+    }
 
-            return app;
-        }
+    public static IApplicationBuilder UseUploadConfig(this IApplicationBuilder app)
+    {
+        var uploadConfig = app.ApplicationServices.GetRequiredService<IOptions<UploadConfig>>();
+        UseFileUploadConfig(app, uploadConfig.Value.Avatar);
+        UseFileUploadConfig(app, uploadConfig.Value.Document);
+
+        return app;
     }
 }

+ 38 - 39
src/platform/ZhonTai.Admin/Core/Filters/ControllerExceptionFilter.cs

@@ -7,56 +7,55 @@ using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Dto;
 using ZhonTai.Common.Extensions;
 
-namespace ZhonTai.Admin.Core.Filters
+namespace ZhonTai.Admin.Core.Filters;
+
+/// <summary>
+/// 控制器异常处理
+/// </summary>
+public class ControllerExceptionFilter : IExceptionFilter, IAsyncExceptionFilter
 {
-    /// <summary>
-    /// 控制器异常处理
-    /// </summary>
-    public class ControllerExceptionFilter : IExceptionFilter, IAsyncExceptionFilter
-    {
-        private readonly IWebHostEnvironment _env;
-        private readonly ILogger<ControllerExceptionFilter> _logger;
+    private readonly IWebHostEnvironment _env;
+    private readonly ILogger<ControllerExceptionFilter> _logger;
 
-        public ControllerExceptionFilter(IWebHostEnvironment env, ILogger<ControllerExceptionFilter> logger)
-        {
-            _env = env;
-            _logger = logger;
-        }
+    public ControllerExceptionFilter(IWebHostEnvironment env, ILogger<ControllerExceptionFilter> logger)
+    {
+        _env = env;
+        _logger = logger;
+    }
 
-        public void OnException(ExceptionContext context)
+    public void OnException(ExceptionContext context)
+    {
+        if (context.ExceptionHandled == false)
         {
-            if (context.ExceptionHandled == false)
+            string message;
+            if (_env.IsProduction())
+            {
+                message = Enums.StatusCodes.Status500InternalServerError.ToDescription();
+            }
+            else
             {
-                string message;
-                if (_env.IsProduction())
-                {
-                    message = Enums.StatusCodes.Status500InternalServerError.ToDescription();
-                }
-                else
-                {
-                    message = context.Exception.Message;
-                }
-
-                _logger.LogError(context.Exception, "");
-                var data = ResultOutput.NotOk(message);
-                context.Result = new InternalServerErrorResult(data);
+                message = context.Exception.Message;
             }
 
-            context.ExceptionHandled = true;
+            _logger.LogError(context.Exception, "");
+            var data = ResultOutput.NotOk(message);
+            context.Result = new InternalServerErrorResult(data);
         }
 
-        public Task OnExceptionAsync(ExceptionContext context)
-        {
-            OnException(context);
-            return Task.CompletedTask;
-        }
+        context.ExceptionHandled = true;
     }
 
-    public class InternalServerErrorResult : ObjectResult
+    public Task OnExceptionAsync(ExceptionContext context)
     {
-        public InternalServerErrorResult(object value) : base(value)
-        {
-            StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status500InternalServerError;
-        }
+        OnException(context);
+        return Task.CompletedTask;
+    }
+}
+
+public class InternalServerErrorResult : ObjectResult
+{
+    public InternalServerErrorResult(object value) : base(value)
+    {
+        StatusCode = Microsoft.AspNetCore.Http.StatusCodes.Status500InternalServerError;
     }
 }

+ 16 - 17
src/platform/ZhonTai.Admin/Core/Filters/ControllerLogFilter.cs

@@ -4,28 +4,27 @@ using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Attributes;
 using ZhonTai.Admin.Core.Logs;
 
-namespace ZhonTai.Admin.Core.Filters
+namespace ZhonTai.Admin.Core.Filters;
+
+/// <summary>
+/// 控制器操作日志记录
+/// </summary>
+public class ControllerLogFilter : IAsyncActionFilter
 {
-    /// <summary>
-    /// 控制器操作日志记录
-    /// </summary>
-    public class ControllerLogFilter : IAsyncActionFilter
+    private readonly ILogHandler _logHandler;
+
+    public ControllerLogFilter(ILogHandler logHandler)
     {
-        private readonly ILogHandler _logHandler;
+        _logHandler = logHandler;
+    }
 
-        public ControllerLogFilter(ILogHandler logHandler)
+    public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
+    {
+        if (context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(NoOprationLogAttribute)))
         {
-            _logHandler = logHandler;
+            return next();
         }
 
-        public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
-        {
-            if (context.ActionDescriptor.EndpointMetadata.Any(m => m.GetType() == typeof(NoOprationLogAttribute)))
-            {
-                return next();
-            }
-
-            return _logHandler.LogAsync(context, next);
-        }
+        return _logHandler.LogAsync(context, next);
     }
 }

+ 17 - 18
src/platform/ZhonTai.Admin/Core/Filters/EnumSchemaFilter.cs

@@ -6,29 +6,28 @@ using System.Linq;
 using System.Reflection;
 using ZhonTai.Common.Extensions;
 
-namespace ZhonTai.Admin.Core.Filters
+namespace ZhonTai.Admin.Core.Filters;
+
+public class EnumSchemaFilter : ISchemaFilter
 {
-    public class EnumSchemaFilter : ISchemaFilter
+    public void Apply(OpenApiSchema schema, SchemaFilterContext context)
     {
-        public void Apply(OpenApiSchema schema, SchemaFilterContext context)
+        //CommonUtils.GetProperyCommentBySummary
+        var type = context.Type;
+        if (type.IsEnum)
         {
-            //CommonUtils.GetProperyCommentBySummary
-            var type = context.Type;
-            if (type.IsEnum)
-            {
-                var items = Enum.GetValues(type).Cast<Enum>()
-                .Where(m => !m.ToString().Equals("Null")).Select(x =>
-                $"{x.ToDescription()}={((int)type.InvokeMember(x.ToString(), BindingFlags.GetField, null, null, null))}").ToList();
+            var items = Enum.GetValues(type).Cast<Enum>()
+            .Where(m => !m.ToString().Equals("Null")).Select(x =>
+            $"{x.ToDescription()}={((int)type.InvokeMember(x.ToString(), BindingFlags.GetField, null, null, null))}").ToList();
 
-                if (items?.Count > 0)
+            if (items?.Count > 0)
+            {
+                string description = string.Join(",", items);
+                schema.Extensions.Add("extensions", new OpenApiObject
                 {
-                    string description = string.Join(",", items);
-                    schema.Extensions.Add("extensions", new OpenApiObject
-                    {
-                        ["description"] = new OpenApiString(description)
-                    });
-                    schema.Description = string.IsNullOrEmpty(schema.Description) ? description : $"{schema.Description}:{description}";
-                }
+                    ["description"] = new OpenApiString(description)
+                });
+                schema.Description = string.IsNullOrEmpty(schema.Description) ? description : $"{schema.Description}:{description}";
             }
         }
     }

+ 31 - 32
src/platform/ZhonTai.Admin/Core/Filters/ValidateInputFilter.cs

@@ -8,45 +8,44 @@ using System.Text;
 using System.Threading.Tasks;
 using ZhonTai.Admin.Core.Dto;
 
-namespace ZhonTai.Admin.Core.Filters
+namespace ZhonTai.Admin.Core.Filters;
+
+/// <summary>
+/// 输入模型验证过滤器
+/// </summary>
+public class ValidateInputFilter : IAsyncActionFilter
 {
-    /// <summary>
-    /// 输入模型验证过滤器
-    /// </summary>
-    public class ValidateInputFilter : IAsyncActionFilter
+    public ValidateInputFilter()
     {
-        public ValidateInputFilter()
-        {
-        }
+    }
 
-        public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
+    public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
+    {
+        if (!context.ModelState.IsValid)
         {
-            if (!context.ModelState.IsValid)
+            try
             {
-                try
-                {
-                    var logger = (ILogger<ValidateInputFilter>)context.HttpContext.RequestServices.GetService(typeof(ILogger<ValidateInputFilter>));
-                    var errors = context.ModelState
-                    .Where(m => m.Value.ValidationState == ModelValidationState.Invalid)
-                    .Select(m =>
-                    {
-                        var sb = new StringBuilder();
-                        sb.AppendFormat("{0}:", m.Key);
-                        sb.Append(m.Value.Errors.Select(n => n.ErrorMessage).Aggregate((x, y) => x + ";" + y));
-                        return sb.ToString();
-                    })
-                    .Aggregate((x, y) => x + "|" + y);
-                    logger.LogError(errors);
-                    context.Result = new JsonResult(ResultOutput.NotOk(errors));
-                }
-                catch
+                var logger = (ILogger<ValidateInputFilter>)context.HttpContext.RequestServices.GetService(typeof(ILogger<ValidateInputFilter>));
+                var errors = context.ModelState
+                .Where(m => m.Value.ValidationState == ModelValidationState.Invalid)
+                .Select(m =>
                 {
-                    context.Result = new StatusCodeResult(StatusCodes.Status500InternalServerError);
-                }
-                return;
+                    var sb = new StringBuilder();
+                    sb.AppendFormat("{0}:", m.Key);
+                    sb.Append(m.Value.Errors.Select(n => n.ErrorMessage).Aggregate((x, y) => x + ";" + y));
+                    return sb.ToString();
+                })
+                .Aggregate((x, y) => x + "|" + y);
+                logger.LogError(errors);
+                context.Result = new JsonResult(ResultOutput.NotOk(errors));
+            }
+            catch
+            {
+                context.Result = new StatusCodeResult(StatusCodes.Status500InternalServerError);
             }
-            
-            await next();
+            return;
         }
+        
+        await next();
     }
 }

+ 56 - 57
src/platform/ZhonTai.Admin/Core/Helpers/UploadHelper.cs

@@ -11,78 +11,77 @@ using ZhonTai.Common.Helpers;
 using ZhonTai.Admin.Core.Dto;
 using ZhonTai.Admin.Core.Configs;
 
-namespace ZhonTai.Admin.Core.Helpers
+namespace ZhonTai.Admin.Core.Helpers;
+
+/// <summary>
+/// 文件上传帮助类
+/// </summary>
+[SingleInstance]
+public class UploadHelper
 {
     /// <summary>
-    /// 文件上传帮助类
+    /// 上传单文件
     /// </summary>
-    [SingleInstance]
-    public class UploadHelper
+    /// <param name="file"></param>
+    /// <param name="config"></param>
+    /// <param name="args"></param>
+    /// <param name="cancellationToken"></param>
+    /// <returns></returns>
+    public async Task<IResultOutput<FileInfo>> UploadAsync(IFormFile file, FileUploadConfig config, object args, CancellationToken cancellationToken = default)
     {
-        /// <summary>
-        /// 上传单文件
-        /// </summary>
-        /// <param name="file"></param>
-        /// <param name="config"></param>
-        /// <param name="args"></param>
-        /// <param name="cancellationToken"></param>
-        /// <returns></returns>
-        public async Task<IResultOutput<FileInfo>> UploadAsync(IFormFile file, FileUploadConfig config, object args, CancellationToken cancellationToken = default)
-        {
-            var res = new ResultOutput<FileInfo>();
+        var res = new ResultOutput<FileInfo>();
 
-            if (file == null || file.Length < 1)
-            {
-                return res.NotOk("请上传文件!");
-            }
+        if (file == null || file.Length < 1)
+        {
+            return res.NotOk("请上传文件!");
+        }
 
-            //格式限制
-            if (!config.ContentType.Contains(file.ContentType))
-            {
-                return res.NotOk("文件格式错误");
-            }
+        //格式限制
+        if (!config.ContentType.Contains(file.ContentType))
+        {
+            return res.NotOk("文件格式错误");
+        }
 
-            //大小限制
-            if (!(file.Length <= config.MaxSize))
-            {
-                return res.NotOk("文件过大");
-            }
+        //大小限制
+        if (!(file.Length <= config.MaxSize))
+        {
+            return res.NotOk("文件过大");
+        }
 
-            var fileInfo = new FileInfo(file.FileName, file.Length)
-            {
-                UploadPath = config.UploadPath,
-                RequestPath = config.RequestPath
-            };
+        var fileInfo = new FileInfo(file.FileName, file.Length)
+        {
+            UploadPath = config.UploadPath,
+            RequestPath = config.RequestPath
+        };
 
-            var dateTimeFormat = config.DateTimeFormat.NotNull() ? DateTime.Now.ToString(config.DateTimeFormat) : "";
-            var format = config.Format.NotNull() ? StringHelper.Format(config.Format, args) : "";
-            fileInfo.RelativePath = Path.Combine(dateTimeFormat, format).ToPath();
+        var dateTimeFormat = config.DateTimeFormat.NotNull() ? DateTime.Now.ToString(config.DateTimeFormat) : "";
+        var format = config.Format.NotNull() ? StringHelper.Format(config.Format, args) : "";
+        fileInfo.RelativePath = Path.Combine(dateTimeFormat, format).ToPath();
 
-            if (!Directory.Exists(fileInfo.FileDirectory))
-            {
-                Directory.CreateDirectory(fileInfo.FileDirectory);
-            }
+        if (!Directory.Exists(fileInfo.FileDirectory))
+        {
+            Directory.CreateDirectory(fileInfo.FileDirectory);
+        }
 
-            fileInfo.SaveName = $"{YitIdHelper.NextId()}.{fileInfo.Extension}";
+        fileInfo.SaveName = $"{YitIdHelper.NextId()}.{fileInfo.Extension}";
 
-            await SaveAsync(file, fileInfo.FilePath, cancellationToken);
+        await SaveAsync(file, fileInfo.FilePath, cancellationToken);
 
-            return res.Ok(fileInfo);
-        }
+        return res.Ok(fileInfo);
+    }
 
-        /// <summary>
-        /// 保存文件
-        /// </summary>
-        /// <param name="file"></param>
-        /// <param name="filePath"></param>
-        /// <param name="cancellationToken"></param>
-        /// <returns></returns>
-        public async Task SaveAsync(IFormFile file, string filePath, CancellationToken cancellationToken = default)
+    /// <summary>
+    /// 保存文件
+    /// </summary>
+    /// <param name="file"></param>
+    /// <param name="filePath"></param>
+    /// <param name="cancellationToken"></param>
+    /// <returns></returns>
+    public async Task SaveAsync(IFormFile file, string filePath, CancellationToken cancellationToken = default)
+    {
+        using (var stream = new FileStream(filePath, FileMode.Create))
         {
-            using (var stream = new FileStream(filePath, FileMode.Create))
-            {
-                await file.CopyToAsync(stream, cancellationToken);
-            }
+            await file.CopyToAsync(stream, cancellationToken);
         }
     }
 }

+ 427 - 428
src/platform/ZhonTai.Admin/Core/HostApp.cs

@@ -47,554 +47,553 @@ using Microsoft.AspNetCore.Mvc;
 using ZhonTai.Admin.Core.Startup;
 using ZhonTai.Admin.Core.Conventions;
 
-namespace ZhonTai.Admin.Core
+namespace ZhonTai.Admin.Core;
+
+public class HostApp
 {
-    public class HostApp
-    {
-        readonly HostAppOptions _hostAppOptions;
+    readonly HostAppOptions _hostAppOptions;
 
-        public HostApp()
-        {
-        }
+    public HostApp()
+    {
+    }
 
-        public HostApp(HostAppOptions hostAppOptions)
-        {
-            _hostAppOptions = hostAppOptions;
-        }
+    public HostApp(HostAppOptions hostAppOptions)
+    {
+        _hostAppOptions = hostAppOptions;
+    }
 
-        public void Run(string[] args)
-        {
-            var builder = WebApplication.CreateBuilder(args);
+    public void Run(string[] args)
+    {
+        var builder = WebApplication.CreateBuilder(args);
 
-            //使用NLog日志
-            builder.Host.UseNLog();
+        //使用NLog日志
+        builder.Host.UseNLog();
 
-            //添加配置
-            builder.Host.ConfigureAppConfiguration((context, builder) =>
+        //添加配置
+        builder.Host.ConfigureAppConfiguration((context, builder) =>
+        {
+            builder.AddJsonFile("./Configs/ratelimitconfig.json", optional: true, reloadOnChange: true);
+            if (context.HostingEnvironment.EnvironmentName.NotNull())
             {
-                builder.AddJsonFile("./Configs/ratelimitconfig.json", optional: true, reloadOnChange: true);
-                if (context.HostingEnvironment.EnvironmentName.NotNull())
-                {
-                    builder.AddJsonFile($"./Configs/ratelimitconfig.{context.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true);
-                }
-                builder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
-                if (context.HostingEnvironment.EnvironmentName.NotNull())
-                {
-                    builder.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true);
-                }
-            });
+                builder.AddJsonFile($"./Configs/ratelimitconfig.{context.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true);
+            }
+            builder.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
+            if (context.HostingEnvironment.EnvironmentName.NotNull())
+            {
+                builder.AddJsonFile($"appsettings.{context.HostingEnvironment.EnvironmentName}.json", optional: true, reloadOnChange: true);
+            }
+        });
 
-            var services = builder.Services;
-            var env = builder.Environment;
-            var configuration = builder.Configuration;
+        var services = builder.Services;
+        var env = builder.Environment;
+        var configuration = builder.Configuration;
 
-            var configHelper = new ConfigHelper();
-            var appConfig = ConfigHelper.Get<AppConfig>("appconfig", env.EnvironmentName) ?? new AppConfig();
+        var configHelper = new ConfigHelper();
+        var appConfig = ConfigHelper.Get<AppConfig>("appconfig", env.EnvironmentName) ?? new AppConfig();
 
-            //应用配置
-            services.AddSingleton(appConfig);
+        //应用配置
+        services.AddSingleton(appConfig);
 
-            //使用Autofac容器
-            builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
-            //配置Autofac容器
-            builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
-            {
-                // 控制器注入
-                builder.RegisterModule(new ControllerModule());
+        //使用Autofac容器
+        builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
+        //配置Autofac容器
+        builder.Host.ConfigureContainer<ContainerBuilder>(builder =>
+        {
+            // 控制器注入
+            builder.RegisterModule(new ControllerModule());
 
-                // 单例注入
-                builder.RegisterModule(new SingleInstanceModule(appConfig));
+            // 单例注入
+            builder.RegisterModule(new SingleInstanceModule(appConfig));
 
-                // 仓储注入
-                builder.RegisterModule(new RepositoryModule(appConfig));
+            // 仓储注入
+            builder.RegisterModule(new RepositoryModule(appConfig));
 
-                // 服务注入
-                builder.RegisterModule(new ServiceModule(appConfig));
-            });
+            // 服务注入
+            builder.RegisterModule(new ServiceModule(appConfig));
+        });
 
-            //配置Kestrel服务器
-            builder.WebHost.ConfigureKestrel((context, options) =>
-            {
-                //设置应用服务器Kestrel请求体最大为100MB
-                options.Limits.MaxRequestBodySize = 1024 * 1024 * 100;
-            });
+        //配置Kestrel服务器
+        builder.WebHost.ConfigureKestrel((context, options) =>
+        {
+            //设置应用服务器Kestrel请求体最大为100MB
+            options.Limits.MaxRequestBodySize = 1024 * 1024 * 100;
+        });
 
-            //访问地址
-            builder.WebHost.UseUrls(appConfig.Urls);
+        //访问地址
+        builder.WebHost.UseUrls(appConfig.Urls);
 
-            //配置服务
-            ConfigureServices(services, env, configuration, configHelper, appConfig);
+        //配置服务
+        ConfigureServices(services, env, configuration, configHelper, appConfig);
 
-            var app = builder.Build();
+        var app = builder.Build();
 
-            //配置中间件
-            ConfigureMiddleware(app, env, configuration, appConfig);
+        //配置中间件
+        ConfigureMiddleware(app, env, configuration, appConfig);
 
-            app.Run();
-        }
+        app.Run();
+    }
 
-        /// <summary>
-        /// 配置服务
-        /// </summary>
-        /// <param name="services"></param>
-        /// <param name="env"></param>
-        /// <param name="configuration"></param>
-        /// <param name="configHelper"></param>
-        /// <param name="appConfig"></param>
-        private void ConfigureServices(IServiceCollection services, IWebHostEnvironment env, IConfiguration configuration, ConfigHelper configHelper, AppConfig appConfig)
+    /// <summary>
+    /// 配置服务
+    /// </summary>
+    /// <param name="services"></param>
+    /// <param name="env"></param>
+    /// <param name="configuration"></param>
+    /// <param name="configHelper"></param>
+    /// <param name="appConfig"></param>
+    private void ConfigureServices(IServiceCollection services, IWebHostEnvironment env, IConfiguration configuration, ConfigHelper configHelper, AppConfig appConfig)
+    {
+        var hostAppContext = new HostAppContext()
         {
-            var hostAppContext = new HostAppContext()
-            {
-                Services = services,
-                Environment = env,
-                Configuration = configuration
-            };
+            Services = services,
+            Environment = env,
+            Configuration = configuration
+        };
 
-            _hostAppOptions?.ConfigurePreServices?.Invoke(hostAppContext);
+        _hostAppOptions?.ConfigurePreServices?.Invoke(hostAppContext);
 
-            //雪花漂移算法
-            var idGeneratorOptions = new IdGeneratorOptions(1) { WorkerIdBitLength = 6 };
-            _hostAppOptions?.ConfigureIdGenerator?.Invoke(idGeneratorOptions);
-            YitIdHelper.SetIdGenerator(idGeneratorOptions);
+        //雪花漂移算法
+        var idGeneratorOptions = new IdGeneratorOptions(1) { WorkerIdBitLength = 6 };
+        _hostAppOptions?.ConfigureIdGenerator?.Invoke(idGeneratorOptions);
+        YitIdHelper.SetIdGenerator(idGeneratorOptions);
 
-            //权限处理
-            services.AddScoped<IPermissionHandler, PermissionHandler>();
+        //权限处理
+        services.AddScoped<IPermissionHandler, PermissionHandler>();
 
-            // ClaimType不被更改
-            JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
+        // ClaimType不被更改
+        JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();
 
-            //用户信息
-            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
-            services.TryAddSingleton<IUser, User>();
+        //用户信息
+        services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
+        services.TryAddSingleton<IUser, User>();
 
-            //添加数据库
-            services.AddDbAsync(env, _hostAppOptions).Wait();
+        //添加数据库
+        services.AddDbAsync(env, _hostAppOptions).Wait();
 
-            //数据库配置
-            var dbConfig = ConfigHelper.Get<DbConfig>("dbconfig", env.EnvironmentName);
-            services.AddSingleton(dbConfig);
+        //数据库配置
+        var dbConfig = ConfigHelper.Get<DbConfig>("dbconfig", env.EnvironmentName);
+        services.AddSingleton(dbConfig);
 
-            //添加IdleBus单例
-            var timeSpan = dbConfig.IdleTime > 0 ? TimeSpan.FromMinutes(dbConfig.IdleTime) : TimeSpan.MaxValue;
-            var ib = new IdleBus<IFreeSql>(timeSpan);
-            services.AddSingleton(ib);
+        //添加IdleBus单例
+        var timeSpan = dbConfig.IdleTime > 0 ? TimeSpan.FromMinutes(dbConfig.IdleTime) : TimeSpan.MaxValue;
+        var ib = new IdleBus<IFreeSql>(timeSpan);
+        services.AddSingleton(ib);
 
-            //上传配置
-            var uploadConfig = ConfigHelper.Load("uploadconfig", env.EnvironmentName, true);
-            services.Configure<UploadConfig>(uploadConfig);
+        //上传配置
+        var uploadConfig = ConfigHelper.Load("uploadconfig", env.EnvironmentName, true);
+        services.Configure<UploadConfig>(uploadConfig);
 
-            #region Mapster 映射配置
+        #region Mapster 映射配置
 
-            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
-            services.AddScoped<IMapper>(sp => new Mapper());
-            TypeAdapterConfig.GlobalSettings.Scan(assemblies);
+        Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+        services.AddScoped<IMapper>(sp => new Mapper());
+        TypeAdapterConfig.GlobalSettings.Scan(assemblies);
 
-            #endregion Mapster 映射配置
+        #endregion Mapster 映射配置
 
-            #region Cors 跨域
-            services.AddCors(options =>
+        #region Cors 跨域
+        services.AddCors(options =>
+        {
+            options.AddPolicy(AdminConsts.RequestPolicyName, policy =>
             {
-                options.AddPolicy(AdminConsts.RequestPolicyName, policy =>
+                var hasOrigins = appConfig.CorUrls?.Length > 0;
+                if (hasOrigins)
                 {
-                    var hasOrigins = appConfig.CorUrls?.Length > 0;
-                    if (hasOrigins)
-                    {
-                        policy.WithOrigins(appConfig.CorUrls);
-                    }
-                    else
-                    {
-                        policy.AllowAnyOrigin();
-                    }
-                    policy
-                    .AllowAnyHeader()
-                    .AllowAnyMethod();
-
-                    if (hasOrigins)
-                    {
-                        policy.AllowCredentials();
-                    }
-                });
+                    policy.WithOrigins(appConfig.CorUrls);
+                }
+                else
+                {
+                    policy.AllowAnyOrigin();
+                }
+                policy
+                .AllowAnyHeader()
+                .AllowAnyMethod();
 
-                //允许任何源访问Api策略,使用时在控制器或者接口上增加特性[EnableCors(AdminConsts.AllowAnyPolicyName)]
-                options.AddPolicy(AdminConsts.AllowAnyPolicyName, policy =>
+                if (hasOrigins)
                 {
-                    policy
-                    .AllowAnyOrigin()
-                    .AllowAnyHeader()
-                    .AllowAnyMethod();
-                });
+                    policy.AllowCredentials();
+                }
+            });
+
+            //允许任何源访问Api策略,使用时在控制器或者接口上增加特性[EnableCors(AdminConsts.AllowAnyPolicyName)]
+            options.AddPolicy(AdminConsts.AllowAnyPolicyName, policy =>
+            {
+                policy
+                .AllowAnyOrigin()
+                .AllowAnyHeader()
+                .AllowAnyMethod();
             });
+        });
 
-            #endregion Cors 跨域
+        #endregion Cors 跨域
 
-            #region 身份认证授权
+        #region 身份认证授权
 
-            var jwtConfig = ConfigHelper.Get<JwtConfig>("jwtconfig", env.EnvironmentName);
-            services.TryAddSingleton(jwtConfig);
+        var jwtConfig = ConfigHelper.Get<JwtConfig>("jwtconfig", env.EnvironmentName);
+        services.TryAddSingleton(jwtConfig);
 
-            if (appConfig.IdentityServer.Enable)
+        if (appConfig.IdentityServer.Enable)
+        {
+            //is4
+            services.AddAuthentication(options =>
             {
-                //is4
-                services.AddAuthentication(options =>
-                {
-                    options.DefaultScheme = IdentityServerAuthenticationDefaults.AuthenticationScheme;
-                    options.DefaultChallengeScheme = nameof(ResponseAuthenticationHandler); //401
-                    options.DefaultForbidScheme = nameof(ResponseAuthenticationHandler);    //403
-                })
-                .AddJwtBearer(options =>
-                {
-                    options.Authority = appConfig.IdentityServer.Url;
-                    options.RequireHttpsMetadata = false;
-                    options.Audience = "admin.server.api";
-                })
-                .AddScheme<AuthenticationSchemeOptions, ResponseAuthenticationHandler>(nameof(ResponseAuthenticationHandler), o => { });
-            }
-            else
+                options.DefaultScheme = IdentityServerAuthenticationDefaults.AuthenticationScheme;
+                options.DefaultChallengeScheme = nameof(ResponseAuthenticationHandler); //401
+                options.DefaultForbidScheme = nameof(ResponseAuthenticationHandler);    //403
+            })
+            .AddJwtBearer(options =>
             {
-                //jwt
-                services.AddAuthentication(options =>
-                {
-                    options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
-                    options.DefaultChallengeScheme = nameof(ResponseAuthenticationHandler); //401
-                    options.DefaultForbidScheme = nameof(ResponseAuthenticationHandler);    //403
-                })
-                .AddJwtBearer(options =>
+                options.Authority = appConfig.IdentityServer.Url;
+                options.RequireHttpsMetadata = false;
+                options.Audience = "admin.server.api";
+            })
+            .AddScheme<AuthenticationSchemeOptions, ResponseAuthenticationHandler>(nameof(ResponseAuthenticationHandler), o => { });
+        }
+        else
+        {
+            //jwt
+            services.AddAuthentication(options =>
+            {
+                options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme;
+                options.DefaultChallengeScheme = nameof(ResponseAuthenticationHandler); //401
+                options.DefaultForbidScheme = nameof(ResponseAuthenticationHandler);    //403
+            })
+            .AddJwtBearer(options =>
+            {
+                options.TokenValidationParameters = new TokenValidationParameters
                 {
-                    options.TokenValidationParameters = new TokenValidationParameters
-                    {
-                        ValidateIssuer = true,
-                        ValidateAudience = true,
-                        ValidateLifetime = true,
-                        ValidateIssuerSigningKey = true,
-                        ValidIssuer = jwtConfig.Issuer,
-                        ValidAudience = jwtConfig.Audience,
-                        IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtConfig.SecurityKey)),
-                        ClockSkew = TimeSpan.Zero
-                    };
-                })
-                .AddScheme<AuthenticationSchemeOptions, ResponseAuthenticationHandler>(nameof(ResponseAuthenticationHandler), o => { });
-            }
+                    ValidateIssuer = true,
+                    ValidateAudience = true,
+                    ValidateLifetime = true,
+                    ValidateIssuerSigningKey = true,
+                    ValidIssuer = jwtConfig.Issuer,
+                    ValidAudience = jwtConfig.Audience,
+                    IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtConfig.SecurityKey)),
+                    ClockSkew = TimeSpan.Zero
+                };
+            })
+            .AddScheme<AuthenticationSchemeOptions, ResponseAuthenticationHandler>(nameof(ResponseAuthenticationHandler), o => { });
+        }
 
-            #endregion 身份认证授权
+        #endregion 身份认证授权
 
-            #region Swagger Api文档
+        #region Swagger Api文档
 
-            if (env.IsDevelopment() || appConfig.Swagger.Enable)
+        if (env.IsDevelopment() || appConfig.Swagger.Enable)
+        {
+            services.AddSwaggerGen(options =>
             {
-                services.AddSwaggerGen(options =>
+                appConfig.Swagger.Projects?.ForEach(project =>
                 {
-                    appConfig.Swagger.Projects?.ForEach(project =>
+                    options.SwaggerDoc(project.Code.ToLower(), new OpenApiInfo
                     {
-                        options.SwaggerDoc(project.Code.ToLower(), new OpenApiInfo
-                        {
-                            Title = project.Name,
-                            Version = project.Version,
-                            Description = project.Description
-                        });
-                        //c.OrderActionsBy(o => o.RelativePath);
+                        Title = project.Name,
+                        Version = project.Version,
+                        Description = project.Description
                     });
+                    //c.OrderActionsBy(o => o.RelativePath);
+                });
 
-                    options.SchemaFilter<EnumSchemaFilter>();
+                options.SchemaFilter<EnumSchemaFilter>();
 
-                    options.CustomOperationIds(apiDesc =>
-                    {
-                        var controllerAction = apiDesc.ActionDescriptor as ControllerActionDescriptor;
-                        return controllerAction.ControllerName + "-" + controllerAction.ActionName;
-                    });
+                options.CustomOperationIds(apiDesc =>
+                {
+                    var controllerAction = apiDesc.ActionDescriptor as ControllerActionDescriptor;
+                    return controllerAction.ControllerName + "-" + controllerAction.ActionName;
+                });
 
-                    options.ResolveConflictingActions(apiDescription => apiDescription.First());
-                    options.CustomSchemaIds(x => x.FullName);
-                    //options.DocInclusionPredicate((docName, description) => true);
+                options.ResolveConflictingActions(apiDescription => apiDescription.First());
+                options.CustomSchemaIds(x => x.FullName);
+                //options.DocInclusionPredicate((docName, description) => true);
 
-                    string[] xmlFiles = Directory.GetFiles(AppContext.BaseDirectory, "*.xml");
-                    if (xmlFiles.Length > 0)
+                string[] xmlFiles = Directory.GetFiles(AppContext.BaseDirectory, "*.xml");
+                if (xmlFiles.Length > 0)
+                {
+                    foreach (var xmlFile in xmlFiles)
                     {
-                        foreach (var xmlFile in xmlFiles)
-                        {
-                            options.IncludeXmlComments(xmlFile, true);
-                        }
+                        options.IncludeXmlComments(xmlFile, true);
                     }
+                }
 
-                    var server = new OpenApiServer()
-                    {
-                        Url = appConfig.Swagger.Url,
-                        Description = ""
-                    };
-                    server.Extensions.Add("extensions", new OpenApiObject
-                    {
-                        ["copyright"] = new OpenApiString(appConfig.ApiUI.Footer.Content)
-                    });
-                    options.AddServer(server);
+                var server = new OpenApiServer()
+                {
+                    Url = appConfig.Swagger.Url,
+                    Description = ""
+                };
+                server.Extensions.Add("extensions", new OpenApiObject
+                {
+                    ["copyright"] = new OpenApiString(appConfig.ApiUI.Footer.Content)
+                });
+                options.AddServer(server);
 
-                    #region 添加设置Token的按钮
+                #region 添加设置Token的按钮
 
-                    if (appConfig.IdentityServer.Enable)
+                if (appConfig.IdentityServer.Enable)
+                {
+                    //添加Jwt验证设置
+                    options.AddSecurityRequirement(new OpenApiSecurityRequirement()
                     {
-                        //添加Jwt验证设置
-                        options.AddSecurityRequirement(new OpenApiSecurityRequirement()
                         {
+                            new OpenApiSecurityScheme
                             {
-                                new OpenApiSecurityScheme
+                                Reference = new OpenApiReference
                                 {
-                                    Reference = new OpenApiReference
-                                    {
-                                        Id = "oauth2",
-                                        Type = ReferenceType.SecurityScheme
-                                    }
-                                },
-                                new List<string>()
-                            }
-                        });
+                                    Id = "oauth2",
+                                    Type = ReferenceType.SecurityScheme
+                                }
+                            },
+                            new List<string>()
+                        }
+                    });
 
-                        //统一认证
-                        options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
+                    //统一认证
+                    options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
+                    {
+                        Type = SecuritySchemeType.OAuth2,
+                        Description = "oauth2登录授权",
+                        Flows = new OpenApiOAuthFlows
                         {
-                            Type = SecuritySchemeType.OAuth2,
-                            Description = "oauth2登录授权",
-                            Flows = new OpenApiOAuthFlows
+                            Implicit = new OpenApiOAuthFlow
                             {
-                                Implicit = new OpenApiOAuthFlow
+                                AuthorizationUrl = new Uri($"{appConfig.IdentityServer.Url}/connect/authorize"),
+                                Scopes = new Dictionary<string, string>
                                 {
-                                    AuthorizationUrl = new Uri($"{appConfig.IdentityServer.Url}/connect/authorize"),
-                                    Scopes = new Dictionary<string, string>
-                                    {
-                                        { "admin.server.api", "admin后端api" }
-                                    }
+                                    { "admin.server.api", "admin后端api" }
                                 }
                             }
-                        });
-                    }
-                    else
+                        }
+                    });
+                }
+                else
+                {
+                    //添加Jwt验证设置
+                    options.AddSecurityRequirement(new OpenApiSecurityRequirement()
                     {
-                        //添加Jwt验证设置
-                        options.AddSecurityRequirement(new OpenApiSecurityRequirement()
                         {
+                            new OpenApiSecurityScheme
                             {
-                                new OpenApiSecurityScheme
+                                Reference = new OpenApiReference
                                 {
-                                    Reference = new OpenApiReference
-                                    {
-                                        Id = "Bearer",
-                                        Type = ReferenceType.SecurityScheme
-                                    }
-                                },
-                                new List<string>()
-                            }
-                        });
+                                    Id = "Bearer",
+                                    Type = ReferenceType.SecurityScheme
+                                }
+                            },
+                            new List<string>()
+                        }
+                    });
 
-                        options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
-                        {
-                            Description = "Value: Bearer {token}",
-                            Name = "Authorization",
-                            In = ParameterLocation.Header,
-                            Type = SecuritySchemeType.ApiKey
-                        });
-                    }
+                    options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
+                    {
+                        Description = "Value: Bearer {token}",
+                        Name = "Authorization",
+                        In = ParameterLocation.Header,
+                        Type = SecuritySchemeType.ApiKey
+                    });
+                }
 
-                    #endregion 添加设置Token的按钮
-                });
-            }
+                #endregion 添加设置Token的按钮
+            });
+        }
+
+        #endregion Swagger Api文档
+
+        #region 操作日志
 
-            #endregion Swagger Api文档
+        if (appConfig.Log.Operation)
+        {
+            services.AddScoped<ILogHandler, LogHandler>();
+        }
 
-            #region 操作日志
+        #endregion 操作日志
 
+        #region 控制器
+        void controllersAction(MvcOptions options)
+        {
+            options.Filters.Add<ControllerExceptionFilter>();
+            options.Filters.Add<ValidateInputFilter>();
+            options.Filters.Add<ValidatePermissionAttribute>();
             if (appConfig.Log.Operation)
             {
-                services.AddScoped<ILogHandler, LogHandler>();
+                options.Filters.Add<ControllerLogFilter>();
             }
+            //禁止去除ActionAsync后缀
+            //options.SuppressAsyncSuffixInActionNames = false;
 
-            #endregion 操作日志
-
-            #region 控制器
-            void controllersAction(MvcOptions options)
+            if (env.IsDevelopment() || appConfig.Swagger.Enable)
             {
-                options.Filters.Add<ControllerExceptionFilter>();
-                options.Filters.Add<ValidateInputFilter>();
-                options.Filters.Add<ValidatePermissionAttribute>();
-                if (appConfig.Log.Operation)
-                {
-                    options.Filters.Add<ControllerLogFilter>();
-                }
-                //禁止去除ActionAsync后缀
-                //options.SuppressAsyncSuffixInActionNames = false;
-
-                if (env.IsDevelopment() || appConfig.Swagger.Enable)
-                {
-                    //API分组约定
-                    options.Conventions.Add(new ApiGroupConvention());
-                }
+                //API分组约定
+                options.Conventions.Add(new ApiGroupConvention());
             }
-            
-            var mvcBuilder = appConfig.AppType switch
-            {
-                AppType.Controllers => services.AddControllers(controllersAction),
-                AppType.ControllersWithViews => services.AddControllersWithViews(controllersAction),
-                AppType.MVC => services.AddMvc(controllersAction),
-                _ => services.AddControllers(controllersAction)
-            };
-            
-            //.AddFluentValidation(config =>
-            //{
-            //    var assembly = Assembly.LoadFrom(Path.Combine(basePath, "ZhonTai.Admin.Host.dll"));
-            //    config.RegisterValidatorsFromAssembly(assembly);
-            //})
-            mvcBuilder.AddNewtonsoftJson(options =>
-            {
-                //忽略循环引用
-                options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
-                //使用驼峰 首字母小写
-                options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
-                //设置时间格式
-                options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
-            })
-            .AddControllersAsServices();
+        }
+        
+        var mvcBuilder = appConfig.AppType switch
+        {
+            AppType.Controllers => services.AddControllers(controllersAction),
+            AppType.ControllersWithViews => services.AddControllersWithViews(controllersAction),
+            AppType.MVC => services.AddMvc(controllersAction),
+            _ => services.AddControllers(controllersAction)
+        };
+        
+        //.AddFluentValidation(config =>
+        //{
+        //    var assembly = Assembly.LoadFrom(Path.Combine(basePath, "ZhonTai.Admin.Host.dll"));
+        //    config.RegisterValidatorsFromAssembly(assembly);
+        //})
+        mvcBuilder.AddNewtonsoftJson(options =>
+        {
+            //忽略循环引用
+            options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
+            //使用驼峰 首字母小写
+            options.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
+            //设置时间格式
+            options.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss";
+        })
+        .AddControllersAsServices();
 
-            #endregion 控制器
+        #endregion 控制器
 
-            services.AddHttpClient();
+        services.AddHttpClient();
 
-            _hostAppOptions?.ConfigureServices?.Invoke(hostAppContext);
+        _hostAppOptions?.ConfigureServices?.Invoke(hostAppContext);
 
-            #region 缓存
+        #region 缓存
 
-            var cacheConfig = ConfigHelper.Get<CacheConfig>("cacheconfig", env.EnvironmentName);
-            if (cacheConfig.Type == CacheType.Redis)
-            {
-                var csredis = new CSRedis.CSRedisClient(cacheConfig.Redis.ConnectionString);
-                RedisHelper.Initialization(csredis);
-                services.AddSingleton<ICacheTool, RedisCacheTool>();
-            }
-            else
-            {
-                services.AddMemoryCache();
-                services.AddSingleton<ICacheTool, MemoryCacheTool>();
-            }
+        var cacheConfig = ConfigHelper.Get<CacheConfig>("cacheconfig", env.EnvironmentName);
+        if (cacheConfig.Type == CacheType.Redis)
+        {
+            var csredis = new CSRedis.CSRedisClient(cacheConfig.Redis.ConnectionString);
+            RedisHelper.Initialization(csredis);
+            services.AddSingleton<ICacheTool, RedisCacheTool>();
+        }
+        else
+        {
+            services.AddMemoryCache();
+            services.AddSingleton<ICacheTool, MemoryCacheTool>();
+        }
 
-            #endregion 缓存
+        #endregion 缓存
 
-            #region IP限流
+        #region IP限流
 
-            if (appConfig.RateLimit)
-            {
-                services.AddIpRateLimit(configuration, cacheConfig);
-            }
+        if (appConfig.RateLimit)
+        {
+            services.AddIpRateLimit(configuration, cacheConfig);
+        }
 
-            #endregion IP限流
+        #endregion IP限流
 
-            //阻止NLog接收状态消息
-            services.Configure<ConsoleLifetimeOptions>(opts => opts.SuppressStatusMessages = true);
+        //阻止NLog接收状态消息
+        services.Configure<ConsoleLifetimeOptions>(opts => opts.SuppressStatusMessages = true);
 
-            //性能分析
-            if (appConfig.MiniProfiler)
-            {
-                services.AddMiniProfiler();
-            }
+        //性能分析
+        if (appConfig.MiniProfiler)
+        {
+            services.AddMiniProfiler();
+        }
 
-            //动态api
-            services.AddDynamicApi(options =>
-            {
-                Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => a.Name.EndsWith("Service"))
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
-                options.AddAssemblyOptions(assemblies);
+        //动态api
+        services.AddDynamicApi(options =>
+        {
+            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => a.Name.EndsWith("Service"))
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+            options.AddAssemblyOptions(assemblies);
 
-                _hostAppOptions?.ConfigureDynamicApi?.Invoke(options);
-            });
+            _hostAppOptions?.ConfigureDynamicApi?.Invoke(options);
+        });
 
-            _hostAppOptions?.ConfigurePostServices?.Invoke(hostAppContext);
-        }
+        _hostAppOptions?.ConfigurePostServices?.Invoke(hostAppContext);
+    }
 
-        /// <summary>
-        /// 配置中间件
-        /// </summary>
-        /// <param name="app"></param>
-        /// <param name="env"></param>
-        /// <param name="configuration"></param>
-        /// <param name="appConfig"></param>
-        private void ConfigureMiddleware(WebApplication app, IWebHostEnvironment env, IConfiguration configuration, AppConfig appConfig)
+    /// <summary>
+    /// 配置中间件
+    /// </summary>
+    /// <param name="app"></param>
+    /// <param name="env"></param>
+    /// <param name="configuration"></param>
+    /// <param name="appConfig"></param>
+    private void ConfigureMiddleware(WebApplication app, IWebHostEnvironment env, IConfiguration configuration, AppConfig appConfig)
+    {
+        var hostAppMiddlewareContext = new HostAppMiddlewareContext()
         {
-            var hostAppMiddlewareContext = new HostAppMiddlewareContext()
-            {
-                App = app,
-                Environment = env,
-                Configuration = configuration
-            };
+            App = app,
+            Environment = env,
+            Configuration = configuration
+        };
 
-            _hostAppOptions?.ConfigurePreMiddleware?.Invoke(hostAppMiddlewareContext);
+        _hostAppOptions?.ConfigurePreMiddleware?.Invoke(hostAppMiddlewareContext);
 
-            //IP限流
-            if (appConfig.RateLimit)
-            {
-                app.UseIpRateLimiting();
-            }
+        //IP限流
+        if (appConfig.RateLimit)
+        {
+            app.UseIpRateLimiting();
+        }
 
-            //性能分析
-            if (appConfig.MiniProfiler)
-            {
-                app.UseMiniProfiler();
-            }
+        //性能分析
+        if (appConfig.MiniProfiler)
+        {
+            app.UseMiniProfiler();
+        }
 
-            //异常
-            app.UseExceptionHandler("/Error");
+        //异常
+        app.UseExceptionHandler("/Error");
 
-            //静态文件
-            app.UseDefaultFiles();
-            app.UseStaticFiles();
-            app.UseUploadConfig();
+        //静态文件
+        app.UseDefaultFiles();
+        app.UseStaticFiles();
+        app.UseUploadConfig();
 
-            //路由
-            app.UseRouting();
+        //路由
+        app.UseRouting();
 
-            //跨域
-            app.UseCors(AdminConsts.RequestPolicyName);
+        //跨域
+        app.UseCors(AdminConsts.RequestPolicyName);
 
-            //认证
-            app.UseAuthentication();
+        //认证
+        app.UseAuthentication();
 
-            //授权
-            app.UseAuthorization();
+        //授权
+        app.UseAuthorization();
 
-            //配置端点
-            app.UseEndpoints(endpoints =>
-            {
-                endpoints.MapControllers();
-            });
+        //配置端点
+        app.UseEndpoints(endpoints =>
+        {
+            endpoints.MapControllers();
+        });
 
-            _hostAppOptions?.ConfigureMiddleware?.Invoke(hostAppMiddlewareContext);
+        _hostAppOptions?.ConfigureMiddleware?.Invoke(hostAppMiddlewareContext);
 
-            #region Swagger Api文档
-            if (env.IsDevelopment() || appConfig.Swagger.Enable)
+        #region Swagger Api文档
+        if (env.IsDevelopment() || appConfig.Swagger.Enable)
+        {
+            app.UseSwagger();
+            app.UseSwaggerUI(c =>
             {
-                app.UseSwagger();
-                app.UseSwaggerUI(c =>
+                appConfig.Swagger.Projects?.ForEach(project =>
                 {
-                    appConfig.Swagger.Projects?.ForEach(project =>
-                    {
-                        c.SwaggerEndpoint($"/swagger/{project.Code.ToLower()}/swagger.json", project.Name);
-                    });
-
-                    c.RoutePrefix = "";//直接根目录访问,如果是IIS发布可以注释该语句,并打开launchSettings.launchUrl
-                    c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);//折叠Api
-                    //c.DefaultModelsExpandDepth(-1);//不显示Models
-                    if (appConfig.MiniProfiler)
-                    {
-                        c.InjectJavascript("/swagger/mini-profiler.js?v=4.2.22+2.0");
-                        c.InjectStylesheet("/swagger/mini-profiler.css?v=4.2.22+2.0");
-                    }
+                    c.SwaggerEndpoint($"/swagger/{project.Code.ToLower()}/swagger.json", project.Name);
                 });
-            }
-            #endregion Swagger Api文档
-
-            //数据库日志
-            //var log = LogManager.GetLogger("db");
-            //var ei = new LogEventInfo(LogLevel.Error, "", "错误信息");
-            //ei.Properties["id"] = YitIdHelper.NextId();
-            //log.Log(ei);
 
-            _hostAppOptions?.ConfigurePostMiddleware?.Invoke(hostAppMiddlewareContext);
+                c.RoutePrefix = "swagger";//直接根目录访问,如果是IIS发布可以注释该语句,并打开launchSettings.launchUrl
+                c.DocExpansion(Swashbuckle.AspNetCore.SwaggerUI.DocExpansion.None);//折叠Api
+                //c.DefaultModelsExpandDepth(-1);//不显示Models
+                if (appConfig.MiniProfiler)
+                {
+                    c.InjectJavascript("/swagger/mini-profiler.js?v=4.2.22+2.0");
+                    c.InjectStylesheet("/swagger/mini-profiler.css?v=4.2.22+2.0");
+                }
+            });
         }
+        #endregion Swagger Api文档
+
+        //数据库日志
+        //var log = LogManager.GetLogger("db");
+        //var ei = new LogEventInfo(LogLevel.Error, "", "错误信息");
+        //ei.Properties["id"] = YitIdHelper.NextId();
+        //log.Log(ei);
+
+        _hostAppOptions?.ConfigurePostMiddleware?.Invoke(hostAppMiddlewareContext);
     }
 }

+ 41 - 42
src/platform/ZhonTai.Admin/Core/Logs/ApiHelper.cs

@@ -3,63 +3,62 @@ using System.Linq;
 using ZhonTai.Admin.Domain.Api;
 using ZhonTai.Admin.Core.Attributes;
 
-namespace ZhonTai.Admin.Core.Logs
+namespace ZhonTai.Admin.Core.Logs;
+
+/// <summary>
+/// Api帮助类
+/// </summary>
+[SingleInstance]
+public class ApiHelper
 {
-    /// <summary>
-    /// Api帮助类
-    /// </summary>
-    [SingleInstance]
-    public class ApiHelper
+    private List<ApiHelperDto> _apis;
+    private static readonly object _lockObject = new();
+
+    private readonly IApiRepository _apiRepository;
+    public ApiHelper(IApiRepository apiRepository)
     {
-        private List<ApiHelperDto> _apis;
-        private static readonly object _lockObject = new();
+        _apiRepository = apiRepository;
+    }
 
-        private readonly IApiRepository _apiRepository;
-        public ApiHelper(IApiRepository apiRepository)
-        {
-            _apiRepository = apiRepository;
-        }
+    public List<ApiHelperDto> GetApis()
+    {
+        if (_apis != null && _apis.Any())
+            return _apis;
 
-        public List<ApiHelperDto> GetApis()
+        lock (_lockObject)
         {
             if (_apis != null && _apis.Any())
                 return _apis;
 
-            lock (_lockObject)
-            {
-                if (_apis != null && _apis.Any())
-                    return _apis;
+            _apis = new List<ApiHelperDto>();
 
-                _apis = new List<ApiHelperDto>();
+            var apis = _apiRepository.Select.ToList(a => new { a.Id, a.ParentId, a.Label, a.Path });
 
-                var apis = _apiRepository.Select.ToList(a => new { a.Id, a.ParentId, a.Label, a.Path });
+            foreach (var api in apis)
+            {
+                var parentLabel = apis.FirstOrDefault(a => a.Id == api.ParentId)?.Label;
 
-                foreach (var api in apis)
+                _apis.Add(new ApiHelperDto
                 {
-                    var parentLabel = apis.FirstOrDefault(a => a.Id == api.ParentId)?.Label;
-
-                    _apis.Add(new ApiHelperDto
-                    {
-                        Label = parentLabel.NotNull() ? $"{parentLabel} / {api.Label}" : api.Label,
-                        Path = api.Path?.ToLower().Trim('/')
-                    });
-                }
-
-                return _apis;
+                    Label = parentLabel.NotNull() ? $"{parentLabel} / {api.Label}" : api.Label,
+                    Path = api.Path?.ToLower().Trim('/')
+                });
             }
+
+            return _apis;
         }
     }
+}
 
-    public class ApiHelperDto
-    {
-        /// <summary>
-        /// 接口名称
-        /// </summary>
-        public string Label { get; set; }
+public class ApiHelperDto
+{
+    /// <summary>
+    /// 接口名称
+    /// </summary>
+    public string Label { get; set; }
 
-        /// <summary>
-        /// 接口地址
-        /// </summary>
-        public string Path { get; set; }
-    }
+    /// <summary>
+    /// 接口地址
+    /// </summary>
+    public string Path { get; set; }
 }

+ 11 - 12
src/platform/ZhonTai.Admin/Core/Logs/ILogHandler.cs

@@ -1,19 +1,18 @@
 using Microsoft.AspNetCore.Mvc.Filters;
 using System.Threading.Tasks;
 
-namespace ZhonTai.Admin.Core.Logs
+namespace ZhonTai.Admin.Core.Logs;
+
+/// <summary>
+/// 操作日志处理接口
+/// </summary>
+public interface ILogHandler
 {
     /// <summary>
-    /// 操作日志处理接口
+    /// 操作日志
     /// </summary>
-    public interface ILogHandler
-    {
-        /// <summary>
-        /// 写操作日志
-        /// </summary>
-        /// <param name="context"></param>
-        /// <param name="next"></param>
-        /// <returns></returns>
-        Task LogAsync(ActionExecutingContext context, ActionExecutionDelegate next);
-    }
+    /// <param name="context"></param>
+    /// <param name="next"></param>
+    /// <returns></returns>
+    Task LogAsync(ActionExecutingContext context, ActionExecutionDelegate next);
 }

+ 47 - 48
src/platform/ZhonTai.Admin/Core/Logs/LogHandler.cs

@@ -11,63 +11,62 @@ using ZhonTai.Admin.Services.OprationLog.Dto;
 
 //using Newtonsoft.Json;
 
-namespace ZhonTai.Admin.Core.Logs
+namespace ZhonTai.Admin.Core.Logs;
+
+/// <summary>
+/// 操作日志处理
+/// </summary>
+public class LogHandler : ILogHandler
 {
-    /// <summary>
-    /// 操作日志处理
-    /// </summary>
-    public class LogHandler : ILogHandler
-    {
-        private readonly ILogger _logger;
-        private readonly ApiHelper _apiHelper;
-        private readonly IOprationLogService _oprationLogService;
+    private readonly ILogger _logger;
+    private readonly ApiHelper _apiHelper;
+    private readonly IOprationLogService _oprationLogService;
 
-        public LogHandler(
-            ILogger<LogHandler> logger,
-            ApiHelper apiHelper,
-            IOprationLogService oprationLogService
-        )
-        {
-            _logger = logger;
-            _apiHelper = apiHelper;
-            _oprationLogService = oprationLogService;
-        }
+    public LogHandler(
+        ILogger<LogHandler> logger,
+        ApiHelper apiHelper,
+        IOprationLogService oprationLogService
+    )
+    {
+        _logger = logger;
+        _apiHelper = apiHelper;
+        _oprationLogService = oprationLogService;
+    }
 
-        public async Task LogAsync(ActionExecutingContext context, ActionExecutionDelegate next)
-        {
-            var sw = new Stopwatch();
-            sw.Start();
-            var actionExecutedContext = await next();
-            sw.Stop();
+    public async Task LogAsync(ActionExecutingContext context, ActionExecutionDelegate next)
+    {
+        var sw = new Stopwatch();
+        sw.Start();
+        var actionExecutedContext = await next();
+        sw.Stop();
 
-            //操作参数
-            //var args = JsonConvert.SerializeObject(context.ActionArguments);
-            //操作结果
-            //var result = JsonConvert.SerializeObject(actionResult?.Value);
+        //操作参数
+        //var args = JsonConvert.SerializeObject(context.ActionArguments);
+        //操作结果
+        //var result = JsonConvert.SerializeObject(actionResult?.Value);
 
-            try
+        try
+        {
+            var input = new OprationLogAddInput
             {
-                var input = new OprationLogAddInput
-                {
-                    ApiMethod = context.HttpContext.Request.Method.ToLower(),
-                    ApiPath = context.ActionDescriptor.AttributeRouteInfo.Template.ToLower(),
-                    ElapsedMilliseconds = sw.ElapsedMilliseconds
-                };
-
-                if (actionExecutedContext.Result is ObjectResult result && result.Value is IResultOutput res)
-                {
-                    input.Status = res.Success;
-                    input.Msg = res.Msg;
-                }
+                ApiMethod = context.HttpContext.Request.Method.ToLower(),
+                ApiPath = context.ActionDescriptor.AttributeRouteInfo.Template.ToLower(),
+                ElapsedMilliseconds = sw.ElapsedMilliseconds
+            };
 
-                input.ApiLabel = _apiHelper.GetApis().FirstOrDefault(a => a.Path == input.ApiPath)?.Label;
-
-                await _oprationLogService.AddAsync(input);
-            }
-            catch (Exception ex)
+            if (actionExecutedContext.Result is ObjectResult result && result.Value is IResultOutput res)
             {
-                _logger.LogError("操作日志插入异常:{@ex}", ex);
+                input.Status = res.Success;
+                input.Msg = res.Msg;
             }
+
+            input.ApiLabel = _apiHelper.GetApis().FirstOrDefault(a => a.Path == input.ApiPath)?.Label;
+
+            await _oprationLogService.AddAsync(input);
+        }
+        catch (Exception ex)
+        {
+            _logger.LogError("操作日志插入异常:{@ex}", ex);
         }
     }
 }

+ 15 - 16
src/platform/ZhonTai.Admin/Core/RegisterModules/ControllerModule.cs

@@ -5,25 +5,24 @@ using System.Linq;
 using System.Reflection;
 using Module = Autofac.Module;
 
-namespace ZhonTai.Admin.Core.RegisterModules
+namespace ZhonTai.Admin.Core.RegisterModules;
+
+public class ControllerModule : Module
 {
-    public class ControllerModule : Module
+    /// <summary>
+    /// 控制器注入
+    /// </summary>
+    public ControllerModule()
     {
-        /// <summary>
-        /// 控制器注入
-        /// </summary>
-        public ControllerModule()
-        {
-        }
+    }
 
-        protected override void Load(ContainerBuilder builder)
-        {
-            var controllerTypes = Assembly.GetExecutingAssembly().GetExportedTypes()
-            .Where(type => typeof(ControllerBase).IsAssignableFrom(type))
-            .ToArray();
+    protected override void Load(ContainerBuilder builder)
+    {
+        var controllerTypes = Assembly.GetExecutingAssembly().GetExportedTypes()
+        .Where(type => typeof(ControllerBase).IsAssignableFrom(type))
+        .ToArray();
 
-            // 配置所有控制器均支持属性注入
-            builder.RegisterTypes(controllerTypes).PropertiesAutowired();
-        }
+        // 配置所有控制器均支持属性注入
+        builder.RegisterTypes(controllerTypes).PropertiesAutowired();
     }
 }

+ 2 - 2
src/platform/ZhonTai.Admin/Core/RegisterModules/RepositoryModule.cs

@@ -36,8 +36,8 @@ namespace ZhonTai.Admin.Core.RegisterModules
             .PropertiesAutowired();// 属性注入
 
             //泛型注入
-            builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepositoryBase<>)).InstancePerLifetimeScope();
-            builder.RegisterGeneric(typeof(RepositoryBase<,>)).As(typeof(IRepositoryBase<,>)).InstancePerLifetimeScope();
+            builder.RegisterGeneric(typeof(RepositoryBase<>)).As(typeof(IRepositoryBase<>)).InstancePerLifetimeScope().PropertiesAutowired();
+            builder.RegisterGeneric(typeof(RepositoryBase<,>)).As(typeof(IRepositoryBase<,>)).InstancePerLifetimeScope().PropertiesAutowired();
         }
     }
 }

+ 39 - 40
src/platform/ZhonTai.Admin/Core/RegisterModules/ServiceModule.cs

@@ -9,53 +9,52 @@ using Microsoft.Extensions.DependencyModel;
 using ZhonTai.Admin.Core.Configs;
 using ZhonTai.Admin.Core.Db;
 
-namespace ZhonTai.Admin.Core.RegisterModules
+namespace ZhonTai.Admin.Core.RegisterModules;
+
+public class ServiceModule : Module
 {
-    public class ServiceModule : Module
+    private readonly AppConfig _appConfig;
+
+    /// <summary>
+    /// 服务注入
+    /// </summary>
+    /// <param name="appConfig">AppConfig</param>
+    public ServiceModule(AppConfig appConfig)
     {
-        private readonly AppConfig _appConfig;
+        _appConfig = appConfig;
+    }
 
-        /// <summary>
-        /// 服务注入
-        /// </summary>
-        /// <param name="appConfig">AppConfig</param>
-        public ServiceModule(AppConfig appConfig)
+    protected override void Load(ContainerBuilder builder)
+    {
+        //事务拦截
+        var interceptorServiceTypes = new List<Type>();
+        if (_appConfig.Aop.Transaction)
         {
-            _appConfig = appConfig;
+            builder.RegisterType<TransactionInterceptor>();
+            builder.RegisterType<TransactionAsyncInterceptor>();
+            interceptorServiceTypes.Add(typeof(TransactionInterceptor));
         }
 
-        protected override void Load(ContainerBuilder builder)
-        {
-            //事务拦截
-            var interceptorServiceTypes = new List<Type>();
-            if (_appConfig.Aop.Transaction)
-            {
-                builder.RegisterType<TransactionInterceptor>();
-                builder.RegisterType<TransactionAsyncInterceptor>();
-                interceptorServiceTypes.Add(typeof(TransactionInterceptor));
-            }
-
-            //服务
-            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => _appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+        //服务
+        Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => _appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
 
-            //服务接口实例
-            builder.RegisterAssemblyTypes(assemblies)
-            .Where(a => a.Name.EndsWith("Service"))
-            .AsImplementedInterfaces()
-            .InstancePerLifetimeScope()
-            .PropertiesAutowired()// 属性注入
-            .InterceptedBy(interceptorServiceTypes.ToArray())
-            .EnableInterfaceInterceptors();
+        //服务接口实例
+        builder.RegisterAssemblyTypes(assemblies)
+        .Where(a => a.Name.EndsWith("Service"))
+        .AsImplementedInterfaces()
+        .InstancePerLifetimeScope()
+        .PropertiesAutowired()// 属性注入
+        .InterceptedBy(interceptorServiceTypes.ToArray())
+        .EnableInterfaceInterceptors();
 
-            //服务实例
-            builder.RegisterAssemblyTypes(assemblies)
-            .Where(a => a.Name.EndsWith("Service"))
-            .InstancePerLifetimeScope()
-            .PropertiesAutowired()// 属性注入
-            .InterceptedBy(interceptorServiceTypes.ToArray())
-            .EnableClassInterceptors();
-        }
+        //服务实例
+        builder.RegisterAssemblyTypes(assemblies)
+        .Where(a => a.Name.EndsWith("Service"))
+        .InstancePerLifetimeScope()
+        .PropertiesAutowired()// 属性注入
+        .InterceptedBy(interceptorServiceTypes.ToArray())
+        .EnableClassInterceptors();
     }
 }

+ 29 - 30
src/platform/ZhonTai.Admin/Core/RegisterModules/SingleInstanceModule.cs

@@ -6,40 +6,39 @@ using ZhonTai.Admin.Core.Attributes;
 using ZhonTai.Admin.Core.Configs;
 using Module = Autofac.Module;
 
-namespace ZhonTai.Admin.Core.RegisterModules
+namespace ZhonTai.Admin.Core.RegisterModules;
+
+public class SingleInstanceModule : Module
 {
-    public class SingleInstanceModule : Module
-    {
-        private readonly AppConfig _appConfig;
+    private readonly AppConfig _appConfig;
 
-        /// <summary>
-        /// 单例注入
-        /// </summary>
-        /// <param name="appConfig">AppConfig</param>
-        public SingleInstanceModule(AppConfig appConfig)
-        {
-            _appConfig = appConfig;
-        }
+    /// <summary>
+    /// 单例注入
+    /// </summary>
+    /// <param name="appConfig">AppConfig</param>
+    public SingleInstanceModule(AppConfig appConfig)
+    {
+        _appConfig = appConfig;
+    }
 
-        protected override void Load(ContainerBuilder builder)
-        {
-            // 获得要注入的程序集
-            Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
-                .Where(a => _appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
-                .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
+    protected override void Load(ContainerBuilder builder)
+    {
+        // 获得要注入的程序集
+        Assembly[] assemblies = DependencyContext.Default.RuntimeLibraries
+            .Where(a => _appConfig.AssemblyNames.Contains(a.Name) || a.Name == "ZhonTai.Admin")
+            .Select(o => Assembly.Load(new AssemblyName(o.Name))).ToArray();
 
-            //无接口注入单例
-            builder.RegisterAssemblyTypes(assemblies)
-            .Where(t => t.GetCustomAttribute<SingleInstanceAttribute>() != null)
-            .SingleInstance()
-            .PropertiesAutowired();
+        //无接口注入单例
+        builder.RegisterAssemblyTypes(assemblies)
+        .Where(t => t.GetCustomAttribute<SingleInstanceAttribute>() != null)
+        .SingleInstance()
+        .PropertiesAutowired();
 
-            //有接口注入单例
-            builder.RegisterAssemblyTypes(assemblies)
-            .Where(t => t.GetCustomAttribute<SingleInstanceAttribute>() != null)
-            .AsImplementedInterfaces()
-            .SingleInstance()
-            .PropertiesAutowired();
-        }
+        //有接口注入单例
+        builder.RegisterAssemblyTypes(assemblies)
+        .Where(t => t.GetCustomAttribute<SingleInstanceAttribute>() != null)
+        .AsImplementedInterfaces()
+        .SingleInstance()
+        .PropertiesAutowired();
     }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Core/Repositories/DefaultRepositoryBase.cs

@@ -2,15 +2,14 @@
 using System.Linq.Expressions;
 using ZhonTai.Admin.Core.Db;
 
-namespace ZhonTai.Admin.Core.Repositories
+namespace ZhonTai.Admin.Core.Repositories;
+
+public class DefaultRepositoryBase<TEntity, TKey> : RepositoryBase<TEntity, TKey> where TEntity : class, new()
 {
-    public class DefaultRepositoryBase<TEntity, TKey> : RepositoryBase<TEntity, TKey> where TEntity : class, new()
+    public DefaultRepositoryBase(IFreeSql fsql) : base(fsql) { }
+    public DefaultRepositoryBase(IFreeSql fsql, Expression<Func<TEntity, bool>> filter) : base(fsql, filter, null) { }
+    public DefaultRepositoryBase(IFreeSql fsql, DbUnitOfWorkManager muowManger) : base(muowManger?.Orm ?? fsql, null, null)
     {
-        public DefaultRepositoryBase(IFreeSql fsql) : base(fsql) { }
-        public DefaultRepositoryBase(IFreeSql fsql, Expression<Func<TEntity, bool>> filter) : base(fsql, filter, null) { }
-        public DefaultRepositoryBase(IFreeSql fsql, DbUnitOfWorkManager muowManger) : base(muowManger?.Orm ?? fsql, null, null)
-        {
-            muowManger?.Binding(this);
-        }
+        muowManger?.Binding(this);
     }
 }

+ 61 - 59
src/platform/ZhonTai.Admin/Core/Repositories/IRepositoryBase.cs

@@ -2,73 +2,75 @@
 using System;
 using System.Linq.Expressions;
 using System.Threading.Tasks;
+using ZhonTai.Admin.Core.Auth;
 
-namespace ZhonTai.Admin.Core.Repositories
+namespace ZhonTai.Admin.Core.Repositories;
+
+public interface IRepositoryBase<TEntity, TKey> : IBaseRepository<TEntity, TKey> where TEntity : class
 {
-    public interface IRepositoryBase<TEntity, TKey> : IBaseRepository<TEntity, TKey> where TEntity : class
-    {
-        /// <summary>
-        /// 获得Dto
-        /// </summary>
-        /// <typeparam name="TDto"></typeparam>
-        /// <param name="id">主键</param>
-        /// <returns></returns>
-        Task<TDto> GetAsync<TDto>(TKey id);
+    IUser User { get; set; }
+
+    /// <summary>
+    /// 获得Dto
+    /// </summary>
+    /// <typeparam name="TDto"></typeparam>
+    /// <param name="id">主键</param>
+    /// <returns></returns>
+    Task<TDto> GetAsync<TDto>(TKey id);
 
-        /// <summary>
-        /// 根据条件获取Dto
-        /// </summary>
-        /// <param name="exp"></param>
-        /// <returns></returns>
-        Task<TDto> GetAsync<TDto>(Expression<Func<TEntity, bool>> exp);
+    /// <summary>
+    /// 根据条件获取Dto
+    /// </summary>
+    /// <param name="exp"></param>
+    /// <returns></returns>
+    Task<TDto> GetAsync<TDto>(Expression<Func<TEntity, bool>> exp);
 
-        /// <summary>
-        /// 根据条件获取实体
-        /// </summary>
-        /// <param name="exp"></param>
-        /// <returns></returns>
-        Task<TEntity> GetAsync(Expression<Func<TEntity, bool>> exp);
+    /// <summary>
+    /// 根据条件获取实体
+    /// </summary>
+    /// <param name="exp"></param>
+    /// <returns></returns>
+    Task<TEntity> GetAsync(Expression<Func<TEntity, bool>> exp);
 
-        /// <summary>
-        /// 软删除
-        /// </summary>
-        /// <param name="id">主键</param>
-        /// <returns></returns>
-        Task<bool> SoftDeleteAsync(TKey id);
+    /// <summary>
+    /// 软删除
+    /// </summary>
+    /// <param name="id">主键</param>
+    /// <returns></returns>
+    Task<bool> SoftDeleteAsync(TKey id);
 
-        /// <summary>
-        /// 批量软删除
-        /// </summary>
-        /// <param name="ids">主键数组</param>
-        /// <returns></returns>
-        Task<bool> SoftDeleteAsync(TKey[] ids);
+    /// <summary>
+    /// 批量软删除
+    /// </summary>
+    /// <param name="ids">主键数组</param>
+    /// <returns></returns>
+    Task<bool> SoftDeleteAsync(TKey[] ids);
 
-        /// <summary>
-        /// 软删除
-        /// </summary>
-        /// <param name="exp"></param>
-        /// <param name="disableGlobalFilterNames">禁用全局过滤器名</param>
-        /// <returns></returns>
-        Task<bool> SoftDeleteAsync(Expression<Func<TEntity, bool>> exp, params string[] disableGlobalFilterNames);
+    /// <summary>
+    /// 软删除
+    /// </summary>
+    /// <param name="exp"></param>
+    /// <param name="disableGlobalFilterNames">禁用全局过滤器名</param>
+    /// <returns></returns>
+    Task<bool> SoftDeleteAsync(Expression<Func<TEntity, bool>> exp, params string[] disableGlobalFilterNames);
 
-        /// <summary>
-        /// 递归删除
-        /// </summary>
-        /// <param name="exp"></param>
-        /// <param name="disableGlobalFilterNames">禁用全局过滤器名</param>
-        /// <returns></returns>
-        Task<bool> DeleteRecursiveAsync(Expression<Func<TEntity, bool>> exp, params string[] disableGlobalFilterNames);
+    /// <summary>
+    /// 递归删除
+    /// </summary>
+    /// <param name="exp"></param>
+    /// <param name="disableGlobalFilterNames">禁用全局过滤器名</param>
+    /// <returns></returns>
+    Task<bool> DeleteRecursiveAsync(Expression<Func<TEntity, bool>> exp, params string[] disableGlobalFilterNames);
 
-        /// <summary>
-        /// 递归软删除
-        /// </summary>
-        /// <param name="exp"></param>
-        /// <param name="disableGlobalFilterNames">禁用全局过滤器名</param>
-        /// <returns></returns>
-        Task<bool> SoftDeleteRecursiveAsync(Expression<Func<TEntity, bool>> exp, params string[] disableGlobalFilterNames);
-    }
+    /// <summary>
+    /// 递归软删除
+    /// </summary>
+    /// <param name="exp"></param>
+    /// <param name="disableGlobalFilterNames">禁用全局过滤器名</param>
+    /// <returns></returns>
+    Task<bool> SoftDeleteRecursiveAsync(Expression<Func<TEntity, bool>> exp, params string[] disableGlobalFilterNames);
+}
 
-    public interface IRepositoryBase<TEntity> : IRepositoryBase<TEntity, long> where TEntity : class
-    {
-    }
+public interface IRepositoryBase<TEntity> : IRepositoryBase<TEntity, long> where TEntity : class
+{
 }

+ 17 - 18
src/platform/ZhonTai.Admin/Core/Startup/HostAppContext.cs

@@ -2,27 +2,26 @@
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 
-namespace ZhonTai.Admin.Core.Startup
+namespace ZhonTai.Admin.Core.Startup;
+
+/// <summary>
+/// HostApp上下文
+/// </summary>
+public class HostAppContext
 {
     /// <summary>
-    /// HostApp上下文
+    /// 服务
     /// </summary>
-    public class HostAppContext
-    {
-        /// <summary>
-        /// 服务
-        /// </summary>
-        public IServiceCollection Services { get; set; }
-
-        /// <summary>
-        /// 环境
-        /// </summary>
-        public IHostEnvironment Environment { get; set; }
+    public IServiceCollection Services { get; set; }
 
-        /// <summary>
-        /// 配置
-        /// </summary>
-        public IConfiguration Configuration { get; set; }
-    }
+    /// <summary>
+    /// 环境
+    /// </summary>
+    public IHostEnvironment Environment { get; set; }
 
+    /// <summary>
+    /// 配置
+    /// </summary>
+    public IConfiguration Configuration { get; set; }
 }
+

+ 17 - 18
src/platform/ZhonTai.Admin/Core/Startup/HostAppMiddlewareContext.cs

@@ -2,27 +2,26 @@
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Hosting;
 
-namespace ZhonTai.Admin.Core.Startup
+namespace ZhonTai.Admin.Core.Startup;
+
+/// <summary>
+/// HostApp中间件上下文
+/// </summary>
+public class HostAppMiddlewareContext
 {
     /// <summary>
-    /// HostApp中间件上下文
+    /// 服务
     /// </summary>
-    public class HostAppMiddlewareContext
-    {
-        /// <summary>
-        /// 服务
-        /// </summary>
-        public WebApplication App { get; set; }
-
-        /// <summary>
-        /// 环境
-        /// </summary>
-        public IHostEnvironment Environment { get; set; }
+    public WebApplication App { get; set; }
 
-        /// <summary>
-        /// 配置
-        /// </summary>
-        public IConfiguration Configuration { get; set; }
-    }
+    /// <summary>
+    /// 环境
+    /// </summary>
+    public IHostEnvironment Environment { get; set; }
 
+    /// <summary>
+    /// 配置
+    /// </summary>
+    public IConfiguration Configuration { get; set; }
 }
+

+ 47 - 48
src/platform/ZhonTai.Admin/Domain/Api/ApiEntity.cs

@@ -5,64 +5,63 @@ using ZhonTai.Admin.Domain.PermissionApi;
 using ZhonTai.Admin.Domain.Permission;
 using ZhonTai.Admin.Core.Entities;
 
-namespace ZhonTai.Admin.Domain.Api
+namespace ZhonTai.Admin.Domain.Api;
+
+/// <summary>
+/// 接口管理
+/// </summary>
+[Table(Name = "ad_api")]
+[Index("idx_{tablename}_01", nameof(Path), true)]
+public partial class ApiEntity : EntityFull
 {
     /// <summary>
-    /// 接口管理
+    /// 所属模块
     /// </summary>
-	[Table(Name = "ad_api")]
-    [Index("idx_{tablename}_01", nameof(Path), true)]
-    public partial class ApiEntity : EntityFull
-    {
-        /// <summary>
-        /// 所属模块
-        /// </summary>
-		public long ParentId { get; set; }
+	public long ParentId { get; set; }
 
-        [Navigate(nameof(ParentId))]
-        public List<ApiEntity> Childs { get; set; }
+    [Navigate(nameof(ParentId))]
+    public List<ApiEntity> Childs { get; set; }
 
-        /// <summary>
-        /// 接口命名
-        /// </summary>
-        [Column(StringLength = 50)]
-        public string Name { get; set; }
+    /// <summary>
+    /// 接口命名
+    /// </summary>
+    [Column(StringLength = 50)]
+    public string Name { get; set; }
 
-        /// <summary>
-        /// 接口名称
-        /// </summary>
-        [Column(StringLength = 500)]
-        public string Label { get; set; }
+    /// <summary>
+    /// 接口名称
+    /// </summary>
+    [Column(StringLength = 500)]
+    public string Label { get; set; }
 
-        /// <summary>
-        /// 接口地址
-        /// </summary>
-        [Column(StringLength = 500)]
-        public string Path { get; set; }
+    /// <summary>
+    /// 接口地址
+    /// </summary>
+    [Column(StringLength = 500)]
+    public string Path { get; set; }
 
-        /// <summary>
-        /// 接口提交方法
-        /// </summary>
-        [Column(StringLength = 50)]
-        public string HttpMethods { get; set; }
+    /// <summary>
+    /// 接口提交方法
+    /// </summary>
+    [Column(StringLength = 50)]
+    public string HttpMethods { get; set; }
 
-        /// <summary>
-        /// 说明
-        /// </summary>
-        [Column(StringLength = 500)]
-        public string Description { get; set; }
+    /// <summary>
+    /// 说明
+    /// </summary>
+    [Column(StringLength = 500)]
+    public string Description { get; set; }
 
-        /// <summary>
-        /// 排序
-        /// </summary>
-        public int Sort { get; set; }
+    /// <summary>
+    /// 排序
+    /// </summary>
+    public int Sort { get; set; }
 
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enabled { get; set; } = true;
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enabled { get; set; } = true;
 
-        [Navigate(ManyToMany = typeof(PermissionApiEntity))]
-        public ICollection<PermissionEntity> Permissions { get; set; }
-    }
+    [Navigate(ManyToMany = typeof(PermissionApiEntity))]
+    public ICollection<PermissionEntity> Permissions { get; set; }
 }

+ 54 - 55
src/platform/ZhonTai.Admin/Domain/Api/Dto/ApiDataOutput.cs

@@ -1,59 +1,58 @@
 using System.Collections.Generic;
 
-namespace ZhonTai.Admin.Domain.Api.Dto
+namespace ZhonTai.Admin.Domain.Api.Dto;
+
+public class ApiDataOutput
 {
-    public class ApiDataOutput
-    {
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        public long? TenantId { get; set; }
-
-        /// <summary>
-        /// 接口Id
-        /// </summary>
-        public long Id { get; set; }
-
-        /// <summary>
-        /// 父级Id
-        /// </summary>
-        public long? ParentId { get; set; }
-
-        /// <summary>
-        /// 接口命名
-        /// </summary>
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 接口名称
-        /// </summary>
-        public string Label { get; set; }
-
-        /// <summary>
-        /// 接口地址
-        /// </summary>
-        public string Path { get; set; }
-
-        /// <summary>
-        /// 接口提交方法
-        /// </summary>
-        public string HttpMethods { get; set; }
-
-        /// <summary>
-        /// 说明
-        /// </summary>
-        public string Description { get; set; }
-
-        /// <summary>
-        /// 排序
-        /// </summary>
-        public int Sort { get; set; }
-
-        /// <summary>
-        /// 启用
-        /// </summary>
-        public bool Enabled { get; set; }
-
-        public List<ApiDataOutput> Childs { get; set; }
-    }
+    /// <summary>
+    /// 租户Id
+    /// </summary>
+    public long? TenantId { get; set; }
+
+    /// <summary>
+    /// 接口Id
+    /// </summary>
+    public long Id { get; set; }
+
+    /// <summary>
+    /// 父级Id
+    /// </summary>
+    public long? ParentId { get; set; }
+
+    /// <summary>
+    /// 接口命名
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 接口名称
+    /// </summary>
+    public string Label { get; set; }
+
+    /// <summary>
+    /// 接口地址
+    /// </summary>
+    public string Path { get; set; }
+
+    /// <summary>
+    /// 接口提交方法
+    /// </summary>
+    public string HttpMethods { get; set; }
+
+    /// <summary>
+    /// 说明
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// 排序
+    /// </summary>
+    public int Sort { get; set; }
+
+    /// <summary>
+    /// 启用
+    /// </summary>
+    public bool Enabled { get; set; }
+
+    public List<ApiDataOutput> Childs { get; set; }
 }

+ 7 - 8
src/platform/ZhonTai.Admin/Domain/Api/Dto/ApiGetPageDto.cs

@@ -1,11 +1,10 @@
 
-namespace ZhonTai.Admin.Domain.Api.Dto
+namespace ZhonTai.Admin.Domain.Api.Dto;
+
+public class ApiGetPageDto
 {
-    public class ApiGetPageDto
-    {
-        /// <summary>
-        /// 接口名称
-        /// </summary>
-        public string Label { get; set; }
-    }
+    /// <summary>
+    /// 接口名称
+    /// </summary>
+    public string Label { get; set; }
 }

+ 3 - 4
src/platform/ZhonTai.Admin/Domain/Api/IApiRepository.cs

@@ -1,8 +1,7 @@
 using ZhonTai.Admin.Core.Repositories;
 
-namespace ZhonTai.Admin.Domain.Api
+namespace ZhonTai.Admin.Domain.Api;
+
+public interface IApiRepository : IRepositoryBase<ApiEntity>
 {
-    public interface IApiRepository : IRepositoryBase<ApiEntity>
-    {
-    }
 }

+ 23 - 24
src/platform/ZhonTai.Admin/Domain/AppLog/AppLogEntity.cs

@@ -1,38 +1,37 @@
 using FreeSql.DataAnnotations;
 using System;
 
-namespace ZhonTai.Admin.Domain.AppLog
+namespace ZhonTai.Admin.Domain.AppLog;
+
+/// <summary>
+/// 应用程序日志
+/// </summary>
+[Table(Name = "ad_app_log")]
+public partial class AppLogEntity
 {
     /// <summary>
-    /// 应用程序日志
+    /// 主键Id
     /// </summary>
-    [Table(Name = "ad_app_log")]
-    public partial class AppLogEntity
-    {
-        /// <summary>
-        /// 主键Id
-        /// </summary>
-        [Column(Position = 1, IsPrimary = true, IsNullable = false)]
-        public long Id { get; set; }
+    [Column(Position = 1, IsPrimary = true, IsNullable = false)]
+    public long Id { get; set; }
 
-        public DateTime Logged { get; set; }
+    public DateTime Logged { get; set; }
 
-        [Column(StringLength = 5)]
-        public string Level { get; set; }
+    [Column(StringLength = 5)]
+    public string Level { get; set; }
 
-        [Column(StringLength = -1)]
-        public string Message { get; set; }
+    [Column(StringLength = -1)]
+    public string Message { get; set; }
 
-        [Column(StringLength = 300)]
-        public string Logger { get; set; }
+    [Column(StringLength = 300)]
+    public string Logger { get; set; }
 
-        [Column(StringLength = -1)]
-        public string Properties { get; set; }
+    [Column(StringLength = -1)]
+    public string Properties { get; set; }
 
-        [Column(StringLength = 300)]
-        public string Callsite { get; set; }
+    [Column(StringLength = 300)]
+    public string Callsite { get; set; }
 
-        [Column(StringLength = -1)]
-        public string Exception { get; set; }
-    }
+    [Column(StringLength = -1)]
+    public string Exception { get; set; }
 }

+ 47 - 48
src/platform/ZhonTai.Admin/Domain/Dictionary/DictionaryEntity.cs

@@ -2,63 +2,62 @@
 using FreeSql.DataAnnotations;
 using ZhonTai.Admin.Domain.DictionaryType;
 
-namespace ZhonTai.Admin.Domain.Dictionary
+namespace ZhonTai.Admin.Domain.Dictionary;
+
+/// <summary>
+/// 数据字典
+/// </summary>
+[Table(Name = "ad_dictionary")]
+[Index("idx_{tablename}_01", nameof(DictionaryTypeId) + "," + nameof(Name) + "," + nameof(TenantId), true)]
+public partial class DictionaryEntity : EntityFull, ITenant
 {
     /// <summary>
-    /// 数据字典
+    /// 租户Id
     /// </summary>
-	[Table(Name = "ad_dictionary")]
-    [Index("idx_{tablename}_01", nameof(DictionaryTypeId) + "," + nameof(Name) + "," + nameof(TenantId), true)]
-    public partial class DictionaryEntity : EntityFull, ITenant
-    {
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        [Column(Position = 2, CanUpdate = false)]
-        public long? TenantId { get; set; }
+    [Column(Position = 2, CanUpdate = false)]
+    public long? TenantId { get; set; }
 
-        /// <summary>
-        /// 字典类型Id
-        /// </summary>
-        public long DictionaryTypeId { get; set; }
+    /// <summary>
+    /// 字典类型Id
+    /// </summary>
+    public long DictionaryTypeId { get; set; }
 
-        /// <summary>
-        /// 字典类型
-        /// </summary>
-        public DictionaryTypeEntity DictionaryType { get; set; }
+    /// <summary>
+    /// 字典类型
+    /// </summary>
+    public DictionaryTypeEntity DictionaryType { get; set; }
 
-        /// <summary>
-        /// 字典名称
-        /// </summary>
-        [Column(StringLength = 50)]
-        public string Name { get; set; }
+    /// <summary>
+    /// 字典名称
+    /// </summary>
+    [Column(StringLength = 50)]
+    public string Name { get; set; }
 
-        /// <summary>
-        /// 字典编码
-        /// </summary>
-        [Column(StringLength = 50)]
-        public string Code { get; set; }
+    /// <summary>
+    /// 字典编码
+    /// </summary>
+    [Column(StringLength = 50)]
+    public string Code { get; set; }
 
-        /// <summary>
-        /// 字典值
-        /// </summary>
-        [Column(StringLength = 50)]
-        public string Value { get; set; }
+    /// <summary>
+    /// 字典值
+    /// </summary>
+    [Column(StringLength = 50)]
+    public string Value { get; set; }
 
-        /// <summary>
-        /// 描述
-        /// </summary>
-        [Column(StringLength = 500)]
-        public string Description { get; set; }
+    /// <summary>
+    /// 描述
+    /// </summary>
+    [Column(StringLength = 500)]
+    public string Description { get; set; }
 
-        /// <summary>
-        /// 启用
-        /// </summary>
-		public bool Enabled { get; set; } = true;
+    /// <summary>
+    /// 启用
+    /// </summary>
+	public bool Enabled { get; set; } = true;
 
-        /// <summary>
-        /// 排序
-        /// </summary>
-		public int Sort { get; set; }
-    }
+    /// <summary>
+    /// 排序
+    /// </summary>
+	public int Sort { get; set; }
 }

+ 46 - 47
src/platform/ZhonTai.Admin/Domain/Dictionary/Dto/DictionaryDataOutput.cs

@@ -1,54 +1,53 @@
 
-namespace ZhonTai.Admin.Domain.Dictionary.Dto
+namespace ZhonTai.Admin.Domain.Dictionary.Dto;
+
+/// <summary>
+/// 数据字典导出
+/// </summary>
+public partial class DictionaryDataOutput
 {
     /// <summary>
-    /// 数据字典导出
-    /// </summary>
-    public partial class DictionaryDataOutput
-    {
-        /// <summary>
-        /// 租户Id
-        /// </summary>
-        public long? TenantId { get; set; }
-
-        /// <summary>
-        /// 字典Id
-        /// </summary>
-        public long Id { get; set; }
-
-        /// <summary>
-        /// 字典类型Id
-        /// </summary>
-        public long DictionaryTypeId { get; set; }
-
-        /// <summary>
-        /// 字典名称
-        /// </summary>
-        public string Name { get; set; }
-
-        /// <summary>
-        /// 字典编码
-        /// </summary>
-        public string Code { get; set; }
-
-        /// <summary>
-        /// 字典值
-        /// </summary>
-        public string Value { get; set; }
-
-        /// <summary>
-        /// 描述
-        /// </summary>
-        public string Description { get; set; }
-
-        /// <summary>
-        /// 启用
-        /// </summary>
+    /// 租户Id
+    /// </summary>
+    public long? TenantId { get; set; }
+
+    /// <summary>
+    /// 字典Id
+    /// </summary>
+    public long Id { get; set; }
+
+    /// <summary>
+    /// 字典类型Id
+    /// </summary>
+    public long DictionaryTypeId { get; set; }
+
+    /// <summary>
+    /// 字典名称
+    /// </summary>
+    public string Name { get; set; }
+
+    /// <summary>
+    /// 字典编码
+    /// </summary>
+    public string Code { get; set; }
+
+    /// <summary>
+    /// 字典值
+    /// </summary>
+    public string Value { get; set; }
+
+    /// <summary>
+    /// 描述
+    /// </summary>
+    public string Description { get; set; }
+
+    /// <summary>
+    /// 启用
+    /// </summary>
 		public bool Enabled { get; set; } = true;
 
-        /// <summary>
-        /// 排序
-        /// </summary>
+    /// <summary>
+    /// 排序
+    /// </summary>
 		public int Sort { get; set; }
-    }
 }

+ 11 - 12
src/platform/ZhonTai.Admin/Domain/Dictionary/Dto/DictionaryGetPageDto.cs

@@ -1,16 +1,15 @@
 
-namespace ZhonTai.Admin.Domain.Dictionary.Dto
+namespace ZhonTai.Admin.Domain.Dictionary.Dto;
+
+public partial class DictionaryGetPageDto
 {
-    public partial class DictionaryGetPageDto
-    {
-        /// <summary>
-        /// 字典类型Id
-        /// </summary>
-        public long DictionaryTypeId { get; set; }
+    /// <summary>
+    /// 字典类型Id
+    /// </summary>
+    public long DictionaryTypeId { get; set; }
 
-        /// <summary>
-        /// 字典名称
-        /// </summary>
-        public string Name { get; set; }
-    }
+    /// <summary>
+    /// 字典名称
+    /// </summary>
+    public string Name { get; set; }
 }

+ 3 - 4
src/platform/ZhonTai.Admin/Domain/Dictionary/IDictionaryRepository.cs

@@ -1,8 +1,7 @@
 using ZhonTai.Admin.Core.Repositories;
 
-namespace ZhonTai.Admin.Domain.Dictionary
+namespace ZhonTai.Admin.Domain.Dictionary;
+
+public partial interface IDictionaryRepository : IRepositoryBase<DictionaryEntity>
 {
-    public partial interface IDictionaryRepository : IRepositoryBase<DictionaryEntity>
-    {
-    }
 }

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels