From c5a87e92926edac704c4fd86ec1e6d4cc895c539 Mon Sep 17 00:00:00 2001 From: zuohuaijun Date: Sun, 14 Sep 2025 16:30:13 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=8E=E5=90=8C=E6=AD=A5=E6=96=B0?= =?UTF-8?q?=E7=89=88=E7=9A=84=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...tribute.cs => CodeGenStrategyAttribute.cs} | 12 +- .../Attribute/CommonValidationAttribute.cs | 92 - .../Admin.NET.Core/Attribute/DictAttribute.cs | 2 +- .../Attribute/ThemeAttribute.cs | 40 +- .../CodeGen/CodeGenStrategyFactory.cs | 26 + .../CodeGen/Engines/CustomTemplateEngine.cs | 240 +++ .../CodeGen/Engines/TableEntityEngine.cs | 55 + .../Engines/TableSeedDataEngine.cs} | 36 +- .../CodeGen/Models/CodeGenColumnConfig.cs | 263 +++ .../Models/TemplateContextOutput.cs} | 26 +- .../Base/CodeGenEntityStrategyBase.cs} | 15 +- .../Strategies/Base/CodeGenStrategy.cs | 59 + .../Base/CodeGenTableStrategyBase.cs | 153 ++ .../Entity/TableEntityCodeGenStrategy.cs | 60 + .../Entity/TableSeedDataCodeGenStrategy.cs | 176 ++ .../MasterSlaveTablesCodeGenStrategy.cs | 81 + .../Strategies/SingleTableCodeGenStrategy.cs | 44 + .../TableRelationshipCodeGenStrategy.cs | 19 + .../TreeMasterSlaveTablesCodeGenStrategy.cs | 19 + .../TreeSingleTableCodeGenTableStrategy.cs | 19 + .../TreeTableRelationshipCodeGenStrategy.cs | 20 + Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs | 355 ++-- .../Admin.NET.Core/Entity/SysCodeGenColumn.cs | 162 ++ .../Admin.NET.Core/Entity/SysCodeGenConfig.cs | 234 --- .../Admin.NET.Core/Entity/SysCodeGenTable.cs | 77 + .../Entity/SysCodeGenTemplate.cs | 60 - .../Enum/CodeGenEffectTypeEnum.cs | 47 + .../Enum/CodeGenFromRuleValidEnum.cs | 152 ++ .../Admin.NET.Core/Enum/CodeGenMethodEnum.cs | 32 + .../CodeGenPrintTypeEnum.cs} | 21 +- .../Enum/CodeGenQueryTypeEnum.cs | 68 + .../Admin.NET.Core/Enum/CodeGenSceneEnum.cs | 62 + .../Admin.NET.Core/Enum/ErrorCodeEnum.cs | 40 +- .../SeedData/SysCodeGenTemplateSeedData.cs | 266 --- .../Service/CodeGen/CustomViewEngine.cs | 129 -- .../Service/CodeGen/Dto/CodeGenConfig.cs | 239 --- .../Service/CodeGen/Dto/CodeGenInput.cs | 291 ++- .../Service/CodeGen/Dto/CodeGenOutput.cs | 103 -- .../Dto/{ColumnOuput.cs => ColumnOutput.cs} | 56 +- .../Service/CodeGen/Dto/DatabaseOutput.cs | 2 +- .../Service/CodeGen/Dto/EffectConfigInput.cs | 188 ++ .../Service/CodeGen/Dto/TableOutput.cs | 6 +- .../CodeGen/Dto/TemplateConfigInput.cs | 60 + .../CodeGen/SysCodeGenColumnService.cs | 473 +++++ .../CodeGen/SysCodeGenConfigService.cs | 365 ---- .../Service/CodeGen/SysCodeGenService.cs | 1592 ++++++++--------- .../CodeGen/SysCodeGenTemplateService.cs | 31 - .../Utils/System/CodeGenHelper.cs | 68 +- .../Service/GoViewSys/GoViewSysService.cs | 6 +- Web/src/api-services/system/api.ts | 4 +- .../api-services/system/apis/sys-auth-api.ts | 8 +- .../system/apis/sys-code-gen-api.ts | 430 ++++- .../system/apis/sys-code-gen-column-api.ts | 1077 +++++++++++ .../system/apis/sys-code-gen-config-api.ts | 1588 ---------------- .../system/apis/sys-code-gen-template-api.ts | 130 -- .../system/apis/sys-common-api.ts | 166 +- .../system/apis/sys-config-tenant-api.ts | 891 --------- .../api-services/system/apis/sys-role-api.ts | 67 +- .../system/models/add-code-gen-input.ts | 365 ++-- .../system/models/add-config-tenant-input.ts | 149 -- .../system/models/add-dict-type-input.ts | 6 - .../system/models/add-sys-code-gen-column.ts | 268 +++ ...ant-input.ts => add-sys-code-gen-table.ts} | 102 +- ...-netresult-list-code-gen-column-config.ts} | 22 +- .../admin-netresult-list-code-gen-config.ts | 71 - ... => admin-netresult-list-column-output.ts} | 22 +- ...min-netresult-list-sys-code-gen-column.ts} | 22 +- ...-sql-sugar-paged-list-sys-config-tenant.ts | 69 - ...=> admin-netresult-sys-code-gen-column.ts} | 22 +- ... => admin-netresult-sys-code-gen-table.ts} | 22 +- .../api-services/system/models/api-output.ts | 20 +- .../system/models/code-gen-column-config.ts | 480 +++++ .../system/models/code-gen-config.ts | 351 ---- .../models/code-gen-effect-type-enum.ts | 33 + .../models/code-gen-from-rule-valid-enum.ts | 45 + ...enant-input.ts => code-gen-method-enum.ts} | 24 +- ...pe-enum.ts => code-gen-print-type-enum.ts} | 7 +- .../system/models/code-gen-scene-enum.ts | 30 + .../{column-ouput.ts => column-output.ts} | 66 +- ...nput.ts => default-column-config-input.ts} | 22 +- ....ts => effect-date-picker-config-input.ts} | 18 +- ...ig-item.ts => effect-dict-config-input.ts} | 28 +- ...elation.ts => effect-file-config-input.ts} | 30 +- .../system/models/effect-tree-config-input.ts | 134 ++ Web/src/api-services/system/models/index.ts | 45 +- .../system/models/page-code-gen-input.ts | 166 +- .../system/models/page-config-tenant-input.ts | 108 -- .../sql-sugar-paged-list-sys-config-tenant.ts | 87 - .../system/models/sys-code-gen-column.ts | 268 +++ .../system/models/sys-code-gen-config.ts | 342 ---- ...config-tenant.ts => sys-code-gen-table.ts} | 130 +- .../system/models/sys-code-gen-template.ts | 140 -- .../system/models/sys-code-gen.ts | 172 +- .../system/models/sys-dict-type.ts | 6 - .../api-services/system/models/sys-file.ts | 4 +- .../system/models/sys-wechat-refund.ts | 2 +- .../system/models/table-output.ts | 4 +- .../models/tree-with-table-config-input.ts | 134 ++ .../system/models/update-code-gen-input.ts | 293 +-- .../system/models/update-dict-type-input.ts | 6 - .../models/upload-file-from-base64-input.ts | 8 + .../system/models/verify-rule-item.ts | 78 - 102 files changed, 7322 insertions(+), 8102 deletions(-) rename Admin.NET/Admin.NET.Core/Attribute/{CustomUnifyResultAttribute.cs => CodeGenStrategyAttribute.cs} (70%) delete mode 100644 Admin.NET/Admin.NET.Core/Attribute/CommonValidationAttribute.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/CodeGenStrategyFactory.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Engines/CustomTemplateEngine.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Engines/TableEntityEngine.cs rename Admin.NET/Admin.NET.Core/{Service/CodeGen/Dto/VerifyRuleItem.cs => CodeGen/Engines/TableSeedDataEngine.cs} (59%) create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Models/CodeGenColumnConfig.cs rename Admin.NET/Admin.NET.Core/{Service/CodeGen/Dto/TableUniqueConfigItem.cs => CodeGen/Models/TemplateContextOutput.cs} (58%) rename Admin.NET/Admin.NET.Core/{Enum/SerialTypeEnum.cs => CodeGen/Strategies/Base/CodeGenEntityStrategyBase.cs} (53%) create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenTableStrategyBase.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableEntityCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableSeedDataCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/MasterSlaveTablesCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/SingleTableCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/TableRelationshipCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeMasterSlaveTablesCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeSingleTableCodeGenTableStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeTableRelationshipCodeGenStrategy.cs create mode 100644 Admin.NET/Admin.NET.Core/Entity/SysCodeGenColumn.cs delete mode 100644 Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs create mode 100644 Admin.NET/Admin.NET.Core/Entity/SysCodeGenTable.cs delete mode 100644 Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplate.cs create mode 100644 Admin.NET/Admin.NET.Core/Enum/CodeGenEffectTypeEnum.cs create mode 100644 Admin.NET/Admin.NET.Core/Enum/CodeGenFromRuleValidEnum.cs create mode 100644 Admin.NET/Admin.NET.Core/Enum/CodeGenMethodEnum.cs rename Admin.NET/Admin.NET.Core/{Entity/SysCodeGenTemplateRelation.cs => Enum/CodeGenPrintTypeEnum.cs} (63%) create mode 100644 Admin.NET/Admin.NET.Core/Enum/CodeGenQueryTypeEnum.cs create mode 100644 Admin.NET/Admin.NET.Core/Enum/CodeGenSceneEnum.cs delete mode 100644 Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs delete mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/CustomViewEngine.cs delete mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs delete mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenOutput.cs rename Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/{ColumnOuput.cs => ColumnOutput.cs} (64%) create mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/EffectConfigInput.cs create mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TemplateConfigInput.cs create mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenColumnService.cs delete mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs delete mode 100644 Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs create mode 100644 Web/src/api-services/system/apis/sys-code-gen-column-api.ts delete mode 100644 Web/src/api-services/system/apis/sys-code-gen-config-api.ts delete mode 100644 Web/src/api-services/system/apis/sys-code-gen-template-api.ts delete mode 100644 Web/src/api-services/system/apis/sys-config-tenant-api.ts delete mode 100644 Web/src/api-services/system/models/add-config-tenant-input.ts create mode 100644 Web/src/api-services/system/models/add-sys-code-gen-column.ts rename Web/src/api-services/system/models/{update-config-tenant-input.ts => add-sys-code-gen-table.ts} (57%) rename Web/src/api-services/system/models/{admin-netresult-list-sys-code-gen-template.ts => admin-netresult-list-code-gen-column-config.ts} (67%) delete mode 100644 Web/src/api-services/system/models/admin-netresult-list-code-gen-config.ts rename Web/src/api-services/system/models/{admin-netresult-list-column-ouput.ts => admin-netresult-list-column-output.ts} (71%) rename Web/src/api-services/system/models/{admin-netresult-list-sys-config-tenant.ts => admin-netresult-list-sys-code-gen-column.ts} (69%) delete mode 100644 Web/src/api-services/system/models/admin-netresult-sql-sugar-paged-list-sys-config-tenant.ts rename Web/src/api-services/system/models/{admin-netresult-sys-code-gen-config.ts => admin-netresult-sys-code-gen-column.ts} (70%) rename Web/src/api-services/system/models/{admin-netresult-sys-config-tenant.ts => admin-netresult-sys-code-gen-table.ts} (71%) create mode 100644 Web/src/api-services/system/models/code-gen-column-config.ts delete mode 100644 Web/src/api-services/system/models/code-gen-config.ts create mode 100644 Web/src/api-services/system/models/code-gen-effect-type-enum.ts create mode 100644 Web/src/api-services/system/models/code-gen-from-rule-valid-enum.ts rename Web/src/api-services/system/models/{delete-config-tenant-input.ts => code-gen-method-enum.ts} (55%) rename Web/src/api-services/system/models/{code-gen-type-enum.ts => code-gen-print-type-enum.ts} (79%) create mode 100644 Web/src/api-services/system/models/code-gen-scene-enum.ts rename Web/src/api-services/system/models/{column-ouput.ts => column-output.ts} (79%) rename Web/src/api-services/system/models/{delete-code-gen-input.ts => default-column-config-input.ts} (67%) rename Web/src/api-services/system/models/{batch-config-tenant-input.ts => effect-date-picker-config-input.ts} (74%) rename Web/src/api-services/system/models/{table-unique-config-item.ts => effect-dict-config-input.ts} (72%) rename Web/src/api-services/system/models/{sys-code-gen-template-relation.ts => effect-file-config-input.ts} (64%) create mode 100644 Web/src/api-services/system/models/effect-tree-config-input.ts delete mode 100644 Web/src/api-services/system/models/page-config-tenant-input.ts delete mode 100644 Web/src/api-services/system/models/sql-sugar-paged-list-sys-config-tenant.ts create mode 100644 Web/src/api-services/system/models/sys-code-gen-column.ts delete mode 100644 Web/src/api-services/system/models/sys-code-gen-config.ts rename Web/src/api-services/system/models/{sys-config-tenant.ts => sys-code-gen-table.ts} (57%) delete mode 100644 Web/src/api-services/system/models/sys-code-gen-template.ts create mode 100644 Web/src/api-services/system/models/tree-with-table-config-input.ts delete mode 100644 Web/src/api-services/system/models/verify-rule-item.ts diff --git a/Admin.NET/Admin.NET.Core/Attribute/CustomUnifyResultAttribute.cs b/Admin.NET/Admin.NET.Core/Attribute/CodeGenStrategyAttribute.cs similarity index 70% rename from Admin.NET/Admin.NET.Core/Attribute/CustomUnifyResultAttribute.cs rename to Admin.NET/Admin.NET.Core/Attribute/CodeGenStrategyAttribute.cs index e09f8e72..62ca4e77 100644 --- a/Admin.NET/Admin.NET.Core/Attribute/CustomUnifyResultAttribute.cs +++ b/Admin.NET/Admin.NET.Core/Attribute/CodeGenStrategyAttribute.cs @@ -7,15 +7,15 @@ namespace Admin.NET.Core; /// -/// 自定义规范化结果特性 +/// 代码生成策略特性 /// -[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)] -public class CustomUnifyResultAttribute : Attribute +[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] +public class CodeGenStrategyAttribute : Attribute { - public string Name { get; set; } + public CodeGenSceneEnum Scene { get; } - public CustomUnifyResultAttribute(string name) + public CodeGenStrategyAttribute(CodeGenSceneEnum scene) { - Name = name; + Scene = scene; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Attribute/CommonValidationAttribute.cs b/Admin.NET/Admin.NET.Core/Attribute/CommonValidationAttribute.cs deleted file mode 100644 index 5e1b861f..00000000 --- a/Admin.NET/Admin.NET.Core/Attribute/CommonValidationAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -/// -/// 通用接口参数验证特性类 -/// -[AttributeUsage(AttributeTargets.Property)] -public class CommonValidationAttribute : ValidationAttribute -{ - private readonly Dictionary _conditions; - private static readonly Dictionary CompiledConditions = []; - - /// - /// - /// 条件对参数,长度必须为偶数
- /// 奇数字符串参数:动态条件
- /// 偶数字符串参数:提示消息 - /// - /// - /// - /// public class ModelInput { - /// - /// - /// public string A { get; set; } - /// - /// - /// [CommonValidation( - /// "A == 1 && B == null", "当 A == 1时,B不能为空", - /// "C == 2 && B == null", "当 C == 2时,B不能为空" - /// )] - /// public string B { get; set; } - /// } - /// - /// - public CommonValidationAttribute(params string[] conditionPairs) - { - if (conditionPairs.Length % 2 != 0) throw new ArgumentException("条件对必须以偶数个字符串的形式提供。"); - - var conditions = new Dictionary(); - for (int i = 0; i < conditionPairs.Length; i += 2) - conditions.Add(conditionPairs[i], conditionPairs[i + 1]); - - _conditions = conditions; - } - - protected override ValidationResult IsValid(object value, ValidationContext validationContext) - { - foreach (var (expr, errorMessage) in _conditions) - { - var conditionKey = $"{validationContext.ObjectType.FullName}.{expr}"; - if (!CompiledConditions.TryGetValue(conditionKey, out var condition)) - { - condition = CreateCondition(validationContext.ObjectType, expr); - CompiledConditions[conditionKey] = condition; - } - - if ((bool)condition.DynamicInvoke(validationContext.ObjectInstance)!) - { - return new ValidationResult(errorMessage ?? $"[{validationContext.MemberName}]校验失败"); - } - } - - return ValidationResult.Success; - } - - private Delegate CreateCondition(Type modelType, string expression) - { - try - { - // 创建参数表达式 - var parameter = Expression.Parameter(typeof(object), "x"); - - // 构建 Lambda 表达式 - var lambda = DynamicExpressionParser.ParseLambda([Expression.Parameter(modelType, "x")], typeof(bool), expression); - - // 创建新的 Lambda 表达式,接受 object 参数并调用编译后的表达式 - var invokeExpression = Expression.Invoke(lambda, Expression.Convert(parameter, modelType)); - var finalLambda = Expression.Lambda>(invokeExpression, parameter); - - return finalLambda.Compile(); - } - catch (Exception ex) - { - throw new ArgumentException($"无法解析表达式 '{expression}': {ex.Message}", ex); - } - } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Attribute/DictAttribute.cs b/Admin.NET/Admin.NET.Core/Attribute/DictAttribute.cs index 42658f21..9902fc9c 100644 --- a/Admin.NET/Admin.NET.Core/Attribute/DictAttribute.cs +++ b/Admin.NET/Admin.NET.Core/Attribute/DictAttribute.cs @@ -125,7 +125,7 @@ public class DictAttribute : ValidationAttribute, ITransient /// protected override ValidationResult IsValid(object? value, ValidationContext validationContext) { - return IsValidAsync(value, validationContext, CancellationToken.None).GetAwaiter().GetResult(); + return IsValidAsync(value, validationContext, CancellationToken.None).ConfigureAwait(false).GetAwaiter().GetResult(); } /// diff --git a/Admin.NET/Admin.NET.Core/Attribute/ThemeAttribute.cs b/Admin.NET/Admin.NET.Core/Attribute/ThemeAttribute.cs index 85e1cc6d..e38301e7 100644 --- a/Admin.NET/Admin.NET.Core/Attribute/ThemeAttribute.cs +++ b/Admin.NET/Admin.NET.Core/Attribute/ThemeAttribute.cs @@ -1,21 +1,21 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -/// -/// 枚举拓展主题样式 -/// -[AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field)] -public class ThemeAttribute : Attribute -{ - public string Theme { get; private set; } - - public ThemeAttribute(string theme) - { - this.Theme = theme; - } +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 枚举拓展主题样式 +/// +[AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field)] +public class ThemeAttribute : Attribute +{ + public string Theme { get; private set; } + + public ThemeAttribute(string theme) + { + this.Theme = theme; + } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/CodeGenStrategyFactory.cs b/Admin.NET/Admin.NET.Core/CodeGen/CodeGenStrategyFactory.cs new file mode 100644 index 00000000..65ed8fb7 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/CodeGenStrategyFactory.cs @@ -0,0 +1,26 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 代码生成策略工厂 +/// +public class CodeGenStrategyFactory : IScoped +{ + private readonly Dictionary<(Type, CodeGenSceneEnum), ICodeGenStrategy> _strategyMap; + + public CodeGenStrategyFactory(IEnumerable strategies) + { + _strategyMap = strategies.ToDictionary(s => (s.GetType().BaseType!.GenericTypeArguments.First(), s.GetType().GetCustomAttribute()!.Scene), s => s); + } + + public CodeGenStrategy GetStrategy(CodeGenSceneEnum scene) + { + if (_strategyMap.TryGetValue((typeof(T), scene), out var strategy)) return (CodeGenStrategy)strategy; + throw Oops.Oh(ErrorCodeEnum.D1400, scene.GetDescription()); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Engines/CustomTemplateEngine.cs b/Admin.NET/Admin.NET.Core/CodeGen/Engines/CustomTemplateEngine.cs new file mode 100644 index 00000000..48db5539 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Engines/CustomTemplateEngine.cs @@ -0,0 +1,240 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 自定义模板引擎 +/// +public class CustomTemplateEngine : ViewEngineModel +{ + /// + /// 场景 + /// + public int Scene { get; set; } + + /// + /// 作者 + /// + public string AuthorName { get; set; } + + /// + /// 邮箱 + /// + public string Email { get; set; } + + /// + /// 模块名称 + /// + public string ModuleName { get; set; } + + /// + /// 命名空间 + /// + public string NameSpace { get; set; } + + /// + /// 项目最后名称 + /// + public string ProjectLastName { get; set; } + + /// + /// 前端页面目录名 + /// + public string PagePath { get; set; } = "main"; + + /// + /// 打印模板类型 + /// + public string PrintType { get; set; } + + /// + /// 自定义打印模板名 + /// + public string PrintName { get; set; } + + /// + /// 是否使用Swagger接口 + /// + public bool IsApiService { get; set; } + + /// + /// 库定位器 + /// + public string ConfigId { get; set; } + + /// + /// 主表类名 + /// + public string ClassName { get; set; } + + /// + /// 首字母小写主表类名 + /// + public string LowerClassName { get; set; } + + /// + /// 业务名 + /// + public string BusName { get; set; } + + /// + /// 是否有状态字段 + /// + public bool HasStatus { get; set; } + + /// + /// 是否有上传字段 + /// + public bool HasUpload { get; set; } + + /// + /// 是否有关联表 + /// + public bool HasJoinTable { get; set; } + + /// + /// 是否只有Id单主键 + /// + public bool IsOnlyIdPrimary { get; set; } + + /// + /// 上级联表字段 + /// + public string? LastLinkPropertyName { get; set; } + + /// + /// 下级联表字段 + /// + public string? NextLinkPropertyName { get; set; } + + /// + /// 树组件配置 + /// + public TreeWithTableConfigInput TreeConfig { get; set; } + + /// + /// 是否是横向布局 + /// + public bool IsHorizontal { get; set; } + + /// + /// 对照目标表配置 + /// + public TableRelationshipConfigInput RelationshipTable { get; set; } + + /// + /// 从表配置 + /// + public CustomTemplateEngine SlaveTable { get; set; } + + /// + /// 所有字段集 + /// + public List AllFields { get; set; } + + /// + /// 查询字段集 + /// + public List QueryFields { get; set; } + + /// + /// 表格字段集 + /// + public List TableFields { get; set; } + + /// + /// 导入导出字段集 + /// + public List ImportFields { get; set; } + + /// + /// 主键字段集 + /// + public List PrimaryFields { get; set; } + + /// + /// 增改字段集 + /// + public List AddUpdateFields { get; set; } + + /// + /// 上传字段集 + /// + public List UploadFields { get; set; } + + /// + /// 下拉框字段集 + /// + public List DropdownFields { get; set; } + + /// + /// 接口字段集 + /// + public List ApiFields { get; set; } + + /// + /// 数据库字段集 + /// + public List ColumnList { get; set; } + + /// + /// 获取首字母小写文本 + /// + /// + /// + public string GetFirstLower(string text) => text?.ToFirstLetterLowerCase(); + + /// + /// 根据.NET类型获取TypeScript类型 + /// + /// + /// + public string GetTypeScriptType(string type) => CodeGenHelper.GetTypeScriptType(type); + + /// + /// 格式化主键查询条件 + /// 例: PrimaryKeysFormat(" || ", "u.{0} == input.{0}") + /// 单主键返回 u.Id == input.Id + /// 组合主键返回 u.Id == input.Id || u.FkId == input.FkId + /// + /// 分隔符 + /// 模板字符串 + /// 字段首字母小写 + /// + public string PrimaryKeysFormat(string separator, string format, bool lowerFirstLetter = false) => string.Join(separator, PrimaryFields.Select(u => string.Format(format, lowerFirstLetter ? u.LowerPropertyName : u.PropertyName))); + + /// + /// 根据配置获取前端HttpApi方法名 + /// + /// + /// + /// + /// + public string GetHttpApiMethodName(CodeGenColumnConfig column, string type, CustomTemplateEngine engine = null) + { + engine ??= this; + var entityName = SlaveTable != null && SlaveTable.ApiFields.Any(u => u == column) ? SlaveTable.ClassName : engine.ClassName; + var suffixName = type switch + { + "page" => IsApiService ? "PagePost" : type, // 分页查询 + "update" => IsApiService ? "UpdatePost" : type, // 更新记录 + "add" => IsApiService ? "AddPost" : type, // 新增记录 + "detail" => IsApiService ? "DetailGet" : type, // 详情 + "delete" => IsApiService ? "DeletePost" : type, // 删除 + "batchDelete" => IsApiService ? "BatchDeletePost" : type, // 批量删除 + "setStatus" => IsApiService ? "SetStatusPost" : type, // 设置状态 + "exportData" => IsApiService ? "ExportPost" : type, // 数据导出 + "importData" => IsApiService ? "ImportPostForm" : type, // 数据导入 + "downloadTemplate" => IsApiService ? "ImportGet" : type, // 下载模板 + "fkTable" => IsApiService ? $"{column.JoinConfig.EntityName}PagePost" : "page", // 外键 + "fkTree" => IsApiService ? $"{column.JoinConfig.EntityName}TreePost" : $"get{column.JoinConfig.EntityName}Tree", // 树 + "upload" => IsApiService ? $"Upload{column?.PropertyName}PostForm" : $"upload{column?.PropertyName}", // 上传 + _ => throw new Exception("未知接口类型") + }; + return IsApiService ? $"getAPI({entityName}Api).api{entityName}{suffixName}" : $"{GetFirstLower(entityName)}Api.{suffixName}"; + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Engines/TableEntityEngine.cs b/Admin.NET/Admin.NET.Core/CodeGen/Engines/TableEntityEngine.cs new file mode 100644 index 00000000..b5f2e083 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Engines/TableEntityEngine.cs @@ -0,0 +1,55 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +public class TableEntityEngine : ViewEngineModel +{ + /// + /// 作者 + /// + public string AuthorName { get; set; } = "喵你个汪呀"; + + /// + /// 邮箱 + /// + public string Email { get; set; } = "jason-dom@qq.com"; + + /// + /// 命名空间 + /// + public string NameSpace { get; set; } + + /// + /// 库配置Id + /// + public string ConfigId { get; set; } + + /// + /// 表名 + /// + public string TableName { get; set; } + + /// + /// 实体名 + /// + public string EntityName { get; set; } + + /// + /// 表描述 + /// + public string Description { get; set; } + + /// + /// 基类名 + /// + public string BaseClassName { get; set; } + + /// + /// 字段集合 + /// + public List TableFields { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/VerifyRuleItem.cs b/Admin.NET/Admin.NET.Core/CodeGen/Engines/TableSeedDataEngine.cs similarity index 59% rename from Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/VerifyRuleItem.cs rename to Admin.NET/Admin.NET.Core/CodeGen/Engines/TableSeedDataEngine.cs index a40c8a0f..662edc2b 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/VerifyRuleItem.cs +++ b/Admin.NET/Admin.NET.Core/CodeGen/Engines/TableSeedDataEngine.cs @@ -4,45 +4,37 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core.Service; +namespace Admin.NET.Core.CodeGen; -/// -/// 验证规则选项 -/// -public class VerifyRuleItem +public class TableSeedDataEngine : ViewEngineModel { /// - /// 编码 + /// 作者 /// - public long Key { get; set; } + public string AuthorName { get; set; } = "喵你个汪呀"; /// - /// 验证类型 + /// 邮箱 /// - public string Type { get; set; } + public string Email { get; set; } = "jason-dom@qq.com"; /// - /// 验证错误消息 + /// 命名空间 /// - public string Message { get; set; } + public string NameSpace { get; set; } /// - /// 最小值 + /// 实体名 /// - public string Min { get; set; } + public string EntityName { get; set; } /// - /// 最大值 + /// 描述 /// - public string Max { get; set; } + public string Description { get; set; } /// - /// 正则表达式 + /// 记录列表 /// - public string Pattern { get; set; } - - /// - /// 数据类型(搭配正则) - /// - public string DataType { get; set; } + public List RecordList { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Models/CodeGenColumnConfig.cs b/Admin.NET/Admin.NET.Core/CodeGen/Models/CodeGenColumnConfig.cs new file mode 100644 index 00000000..23e23016 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Models/CodeGenColumnConfig.cs @@ -0,0 +1,263 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 代码生成详细配置参数 +/// +public class CodeGenColumnConfig : SysCodeGenColumn +{ + /// + /// 首字母小写的属性名 + /// + public string LowerPropertyName => PropertyName[..1].ToLower() + PropertyName[1..]; + + /// + /// 是否字典字段 + /// + public bool IsDict => EffectType is CodeGenEffectTypeEnum.DictSelector; + + /// + /// 是否枚举字段 + /// + public bool IsEnum => EffectType is CodeGenEffectTypeEnum.EnumSelector; + + /// + /// 是否常量字段 + /// + public bool IsConst => EffectType is CodeGenEffectTypeEnum.ConstSelector; + + /// + /// 是否上传字段 + /// + public bool IsUpload => EffectType is CodeGenEffectTypeEnum.Upload; + + /// + /// 是否开关字段 + /// + public bool IsSwitch => EffectType is CodeGenEffectTypeEnum.Switch; + + /// + /// 是否输入框字段 + /// + public bool IsInput => EffectType is CodeGenEffectTypeEnum.Input; + + /// + /// 是否数字输入框字段 + /// + public bool IsInputNumber => EffectType is CodeGenEffectTypeEnum.InputNumber; + + /// + /// 是否文本域字段 + /// + public bool IsInputTextArea => EffectType is CodeGenEffectTypeEnum.InputTextArea; + + /// + /// 是否时间选择器字段 + /// + public bool IsDatePicker => EffectType is CodeGenEffectTypeEnum.DatePicker; + + /// + /// 是否外键字段 + /// + public bool IsForeignKey => EffectType is CodeGenEffectTypeEnum.ForeignKey; + + /// + /// 是否树字段 + /// + public bool IsTree => EffectType is CodeGenEffectTypeEnum.ApiTreeSelector; + + /// + /// 是否多选字段 + /// + public bool Multiple => JoinConfig?.Multiple ?? false; + + /// + /// 是否唯一字段 + /// + public bool IsUnique => FromValid == CodeGenFromRuleValidEnum.Unique; + + /// + /// 状态字段 + /// + public bool IsStatus => PropertyName == nameof(BaseStatusInput.Status) && DictConfig.Code.Trim('?') == nameof(StatusEnum); + + /// + /// 是否要联表 + /// + public bool HasJoinTable => EffectType is CodeGenEffectTypeEnum.Upload or CodeGenEffectTypeEnum.ForeignKey or CodeGenEffectTypeEnum.ApiTreeSelector; + + /// + /// 是否要插槽 + /// + public bool HasSlots => !(IsConst || IsInput || IsInputNumber || IsInputTextArea) || IsCopy; + + /// + /// 连表别名 + /// + public string LeftJoinAliasName => Regex.Replace(LowerPropertyName, "Id$", ""); + + /// + /// 字典配置 + /// + public EffectFileConfigInput FileConfig => !string.IsNullOrWhiteSpace(Config) ? JSON.Deserialize(Config) : null; + + /// + /// 字典配置 + /// + public EffectDictConfigInput DictConfig => !string.IsNullOrWhiteSpace(Config) ? JSON.Deserialize(Config) : null; + + /// + /// 联表配置 + /// + public EffectTreeConfigInput JoinConfig => !string.IsNullOrWhiteSpace(Config) ? JSON.Deserialize(Config) : null; + + /// + /// 时间控件配置 + /// + public EffectDatePickerConfigInput DateConfig => !string.IsNullOrWhiteSpace(Config) ? JSON.Deserialize(Config) : null; + + /// + /// 获取可空类型 + /// + public string NullableNetType + { + get + { + if (IsEnum) return DictConfig.Multiple || NetType.StartsWith("string") ? "string" : $"{DictConfig.Code}?"; + if (NetType.StartsWith("string")) return "string"; + if (NetType.StartsWith("Guid")) return "Guid"; + return NetType.EndsWith("?") ? NetType : NetType + "?"; + } + } + + /// + /// 获取字段验证特性 + /// + /// + public string GetFromValidAttribute() + { + bool isCustomValid = FromValid is CodeGenFromRuleValidEnum.IDCard or CodeGenFromRuleValidEnum.Range or CodeGenFromRuleValidEnum.MaxLength or CodeGenFromRuleValidEnum.Unique; + if (isCustomValid) + { + switch (FromValid) + { + case CodeGenFromRuleValidEnum.Unique: return null; + case CodeGenFromRuleValidEnum.IDCard: + if (!NetType.StartsWith("string")) return null; + return "[IdCardNo]"; + + case CodeGenFromRuleValidEnum.MaxLength: + if (!NetType.StartsWith("string") || ColumnLength <= 0) return null; + return $"[MaxLength({ColumnLength}, ErrorMessage = \"{ColumnComment}不能超过{ColumnLength}个字符\")]"; + + case CodeGenFromRuleValidEnum.Range: + return $"[Range(0, 100, ErrorMessage = \"{ColumnComment}范围不正确\")]"; + + default: + return null; + } + } + return $"[DataValidation(ValidationTypes.{FromValid.ToString()}, ErrorMessage = \"{ColumnComment}不正确\")]"; + } + + /// + /// 显示字段 + /// + public string DisplayPropertyNames + { + get + { + var expList = JoinConfig?.DisplayPropertyNames?.Split(",").Select(u => $"{LeftJoinAliasName}.{u}"); + if (expList?.Count() == 1) return expList.FirstOrDefault(); + if (expList == null) return null; + return $"$\"{{{expList.Join("}-{")}}}\""; + } + } + + /// + /// 连表属性名称 + /// + public string LeftJoinPropertyName + { + get + { + if (!HasJoinTable) throw Oops.Bah("不是连表字段"); + return EffectType switch + { + CodeGenEffectTypeEnum.ForeignKey or CodeGenEffectTypeEnum.ApiTreeSelector => Regex.Replace(PropertyName, "Id([s]?)$", "$1") + JoinConfig?.DisplayPropertyNames?.Split(",").FirstOrDefault(), + CodeGenEffectTypeEnum.Upload => Regex.Replace(PropertyName, "Id([s]?)$", "$1") + "Attachment", + _ => null + }; + } + } + + /// + /// 获取列格式化配置方法 + /// + public string GetVxeColumnExtraConfig + { + get + { + if (!HasSlots) return ""; + if (IsCopy) return ", slots: { default: '$row_copy' }"; // 复制字段 + if (IsStatistical) return ", slots: { default: '$row_statistical' }"; // 统计字段 + switch (EffectType) + { + case CodeGenEffectTypeEnum.Switch: // 开关 + return ", slots: { default: '$row_switch' }"; + + case CodeGenEffectTypeEnum.ApiTreeSelector: // 树组件 + case CodeGenEffectTypeEnum.ForeignKey: // 外键 + return $", formatter: ({{ row }}) => row.{LeftJoinPropertyName.ToFirstLetterLowerCase()}"; + + case CodeGenEffectTypeEnum.DatePicker: // 时间选择器 + return $", formatter: ({{ cellValue, row }}) => commonFun.dateFormat{GetDateReaderName(DateConfig.Format)}([], 0, cellValue)"; + + case CodeGenEffectTypeEnum.Upload: // 上传 + return $", params: {{ attachmentName: '{LeftJoinAliasName.ToFirstLetterLowerCase()}', isImage: {FileConfig.IsImage.ToString().ToLower()}, useDownload: {FileConfig.UseDownload.ToString().ToLower()}, downloadText: '{FileConfig.DownloadText}' }}" + + ", slots: { default: '$row_upload' }"; + + case CodeGenEffectTypeEnum.ConstSelector: // 常量选择器 + case CodeGenEffectTypeEnum.DictSelector: // 字典选择器 + case CodeGenEffectTypeEnum.EnumSelector: // 枚举选择器 + if (IsStatus) return ", slots: { default: '$row_status' }"; // 状态字段 + return $", params: {{ code: '{DictConfig.Code}', multiple: {DictConfig.Multiple.ToString().ToLower()}, isConst: {IsConst.ToString().ToLower()} }}" + + ", slots: { default: '$row_sysDict' }"; + } + return ""; + string GetDateReaderName(string format) => format switch + { + "date" => "YMD", + "time" => "HMS", + _ => "YMDHMS" + }; + } + } + + /// + /// 获取表单验证规则 + /// + public string GetFormRules + { + get + { + var result = ""; + var trigger = IsDatePicker || IsDict || IsEnum || IsTree ? "change" : "blur"; + if (IsRequired) result += $" :rules=\"[{{required: true, message: '请选择{ColumnComment}', trigger: '{trigger}'}}]\""; + return result; + } + } + + /// + /// 获取外键显示值语句 + /// + /// 表别名 + /// 多字段时的连接符 + /// + public string GetDisplayColumn(string tableAlias, string separator = "-") => "$\"" + string.Join(separator, DisplayPropertyNames?.Split(",").Select(name => $"{{{tableAlias}.{name}}}") ?? new List()) + "\""; +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableUniqueConfigItem.cs b/Admin.NET/Admin.NET.Core/CodeGen/Models/TemplateContextOutput.cs similarity index 58% rename from Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableUniqueConfigItem.cs rename to Admin.NET/Admin.NET.Core/CodeGen/Models/TemplateContextOutput.cs index 0cac927b..2f5dd52a 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableUniqueConfigItem.cs +++ b/Admin.NET/Admin.NET.Core/CodeGen/Models/TemplateContextOutput.cs @@ -4,28 +4,30 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core.Service; +namespace Admin.NET.Core.CodeGen; /// -/// 表唯一配置项 +/// 模板输出上下文 /// -public class TableUniqueConfigItem +public class TemplateContextOutput { /// - /// 字段列表 + /// 文件名 /// - public List Columns { get; set; } + public string Name { get; set; } /// - /// 描述信息 + /// 模板类型 /// - public string Message { get; set; } + public int Type { get; set; } /// - /// 格式化查询条件 + /// 输出路径 /// - /// 分隔符 - /// 模板字符串 - /// - public string Format(string separator, string format) => string.Join(separator, Columns.Select(name => string.Format(format, name))); + public string OutPath { get; set; } + + /// + /// 内容 + /// + public string Context { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/SerialTypeEnum.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenEntityStrategyBase.cs similarity index 53% rename from Admin.NET/Admin.NET.Core/Enum/SerialTypeEnum.cs rename to Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenEntityStrategyBase.cs index a307c199..6859fd81 100644 --- a/Admin.NET/Admin.NET.Core/Enum/SerialTypeEnum.cs +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenEntityStrategyBase.cs @@ -1,20 +1,15 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 // // 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core; +namespace Admin.NET.Core.CodeGen; /// -/// 系统流水号类型枚举 +/// 种子数据策略基类(处理TableSeedDataEngine类型) /// -[Description("系统流水号类型枚举")] -public enum SerialTypeEnum +/// +public abstract class CodeGenEntityStrategyBase : CodeGenStrategy { - /// - /// 其他 - /// - [Description("其他")] - Other = 999, } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenStrategy.cs new file mode 100644 index 00000000..fc159d04 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenStrategy.cs @@ -0,0 +1,59 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 基础策略接口 +/// +public interface ICodeGenStrategy +{ +} + +/// +/// 泛型策略接口 +/// +/// +public abstract class CodeGenStrategy : ICodeGenStrategy +{ + protected DbConnectionOptions _dbConnectionOption => App.GetOptions(); + protected CodeGenOptions _codeGenOption => App.GetOptions(); + protected ISqlSugarClient _db => App.GetRequiredService(); + protected IViewEngine _viewEngine => App.GetRequiredService(); + + public abstract Task> GenerateCode(T input); + + /// + /// 渲染模板 + /// + /// 模板上下文 + /// 渲染动作 + /// + protected async Task RenderAsync(TemplateContextOutput template, Func, string> action) + { + try + { + var nameSpace = this.GetType().Namespace; + string content = await File.ReadAllTextAsync(Path.Combine(Path.Combine(App.WebHostEnvironment.WebRootPath, "template"), template.Name)); + template.Context = action.Invoke(content, builder => + { + builder.AddAssemblyReferenceByName("System.Text.RegularExpressions"); + builder.AddAssemblyReferenceByName("System.Collections"); + builder.AddAssemblyReferenceByName("System.Linq"); + builder.AddUsing("System.Text.RegularExpressions"); + builder.AddUsing("System.Collections.Generic"); + builder.AddUsing("System.Linq"); + builder.AddUsing(nameSpace); + }); + template.Name = template.Name.Replace(".vm", ""); + return template; + } + catch (Exception ex) + { + throw new Exception($"模板渲染失败:{template.Name}", ex); + } + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenTableStrategyBase.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenTableStrategyBase.cs new file mode 100644 index 00000000..699e2a67 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Base/CodeGenTableStrategyBase.cs @@ -0,0 +1,153 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 表策略基类(处理SysCodeGen类型) +/// +/// +public abstract class CodeGenTableStrategyBase : CodeGenStrategy where T : SysCodeGen +{ + protected IViewEngine ViewEngine => App.GetRequiredService(); + protected CodeGenOptions CodeGenOption => App.GetOptions(); + + /// + /// 模板上下文列表 + /// + protected static List TemplateList => new() + { + new() { Type = 900, Name = "web_api.ts.vm", OutPath = "api/{PagePath}/{ModuleNameLower}.ts" }, + new() { Type = 1000, Name = "web_views_index.vue.vm", OutPath = "views/{PagePath}/{ModuleNameLower}/index.vue" }, + new() { Type = 1010, Name = "web_views_editDialog.vue.vm", OutPath = "views/{PagePath}/{ModuleNameLower}/component/edit{ModuleName}Dialog.vue" }, + new() { Type = 1020, Name = "web_views_Tree.vue.vm", OutPath = "views/{PagePath}/{ModuleNameLower}/component/{LowerTreeEntityName}Tree.vue" }, + + new() { Type = 2000, Name = "service_Service.cs.vm", OutPath = "Service/{ModuleName}/{ModuleName}Service.cs" }, + new() { Type = 2010, Name = "service_OutputDto.cs.vm", OutPath = "Service/{ModuleName}/Dto/{ModuleName}Output.cs" }, + new() { Type = 2020, Name = "service_InputDto.cs.vm", OutPath = "Service/{ModuleName}/Dto/{ModuleName}Input.cs" }, + }; + + /// + /// 根据生成方式获取模板路径列表 + /// + /// + protected List GetTemplateList(SysCodeGen codeGen) + { + var templateList = codeGen.GenerateMethod switch + { + CodeGenMethodEnum.DownloadZipFrontend or CodeGenMethodEnum.GenerateToProjectFrontend => TemplateList.Where(u => u.Type < 2000).ToList(), + CodeGenMethodEnum.DownloadZipBackend or CodeGenMethodEnum.GenerateToProjectBackend => TemplateList.Where(u => u.Type >= 2000).ToList(), + _ => TemplateList + }; + // 传统接口模式去掉 web_api 模板 + if (codeGen.IsApiService) templateList = templateList.Where(e => e.Type != 900).ToList(); + // 非树组件场景去掉树组件模板 + if (codeGen.Scene.ToInt() % 100 != 10) templateList = templateList.Where(e => e.Type != 1020).ToList(); + return templateList; + } + + /// + /// 处理模板输出路径 + /// + /// + /// + protected void ReplaceTemplateOutput(TemplateContextOutput template, SysCodeGen codeGen) + { + // 处理模板输出路径 + string outputPath = Path.Combine(App.WebHostEnvironment.WebRootPath, "codeGen", codeGen.ModuleName); + template.OutPath = template.OutPath.Replace("{PagePath}", codeGen.PagePath) + .Replace("{ModuleName}", codeGen.ModuleName) + .Replace("{ModuleNameLower}", codeGen.ModuleName.ToFirstLetterLowerCase()) + .Replace("{LowerTreeEntityName}", codeGen.TreeConfig?.EntityName.ToFirstLetterLowerCase()); + + // 替换从表模板输出路径占位符 + if (codeGen.TableList.Count > 1) template.OutPath = template.OutPath.Replace("{SlaveModuleName}", codeGen.TableList.Skip(1).First().ModuleName); + + string tempPath; + if ((int)codeGen.GenerateMethod < 200) + { + // 下载模式下的路径处理 + tempPath = !template.OutPath.EndsWith(".cs") + ? Path.Combine(outputPath, CodeGenOption.FrontRootPath, "src") + : Path.Combine(outputPath, codeGen.NameSpace); + } + else + { + // 生成到本项目下的路径处理 + tempPath = !template.OutPath.EndsWith(".cs") + ? Path.Combine(new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent!.Parent!.FullName, CodeGenOption.FrontRootPath, "src") + : Path.Combine(new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent!.FullName, codeGen.NameSpace!); + } + template.OutPath = Path.Combine(tempPath, template.OutPath); + } + + /// + /// 批量渲染模板 + /// + /// + /// + /// + /// + protected async Task> RenderList(SysCodeGen codeGen, List templateList, CustomTemplateEngine engine) + { + void SetEnginePropertyValue(CustomTemplateEngine input) + { + input.ModuleName ??= codeGen.ModuleName; // 模块名称 + input.BusName ??= codeGen.BusName; // 业务名 + input.AuthorName ??= codeGen.AuthorName; // 作者 + input.Email ??= codeGen.Email; // 作者邮箱 + input.NameSpace = codeGen.NameSpace; // 命名空间 + input.PagePath = codeGen.PagePath; // 页面目录 + input.Scene = codeGen.Scene.ToInt(); // 场景 + input.ProjectLastName = codeGen.NameSpace!.Split('.').Last(); // 项目最后个名称,生成的时候赋值 + input.IsApiService = codeGen.IsApiService; // 是否使用 Api Service + input.PrintType = codeGen.PrintType.ToString(); // 支持打印类型 + input.PrintName = codeGen.PrintName; // 打印模板名称 + input.LastLinkPropertyName ??= input.LastLinkPropertyName; // 上级关联字段 + input.NextLinkPropertyName ??= input.NextLinkPropertyName; // 下级关联字段 + input.IsHorizontal = codeGen.IsHorizontal; + + input.QueryFields = input.AllFields.Where(e => e.IsQuery).ToList(); // 查询字段列表 + input.TableFields = input.AllFields.Where(e => e.IsTable).ToList(); // 表格字段列表 + input.ImportFields = input.AllFields.Where(e => e.IsImport).ToList(); // 导入导出字段列表 + input.PrimaryFields = input.AllFields.Where(e => e.IsPrimarykey).ToList(); // 主键字段列表 + input.AddUpdateFields = input.AllFields.Where(e => e.IsAddUpdate).ToList(); // 增改字段列表 + input.UploadFields = input.AllFields.Where(e => e.EffectType == CodeGenEffectTypeEnum.Upload).ToList(); // 上传文件字段列表 + input.DropdownFields = input.AllFields.Where(e => e.EffectType is CodeGenEffectTypeEnum.ApiTreeSelector or CodeGenEffectTypeEnum.ForeignKey or CodeGenEffectTypeEnum.DictSelector or CodeGenEffectTypeEnum.EnumSelector).ToList(); // 选择类字段列表 + var map = new Dictionary(); + input.ApiFields = input.AllFields.Where(e => e.IsTree || e.IsForeignKey).Where(e => map.TryAdd(e.JoinConfig.EntityName + e.IsTree, 1)).ToList(); + + // input.ColumnList = await CodeGenColumnService.GetColumnList(new BaseIdInput{ Id = codeGen.TableList.First().Id }); // 数据库字段列表, + input.IsOnlyIdPrimary = input.AllFields.Where(u => u.IsPrimarykey).All(u => u.PropertyName == "Id"); // 是否主键只有Id + input.HasStatus = input.AllFields.Any(u => u.PropertyName == nameof(BaseStatusInput.Status) && u.DictConfig.Code.Trim('?') == nameof(StatusEnum)); // 是否有启用禁用字段 + input.HasJoinTable = input.AllFields.Any(e => e.EffectType is CodeGenEffectTypeEnum.ForeignKey or CodeGenEffectTypeEnum.ApiTreeSelector); // 是否有联表 + input.HasUpload = input.UploadFields.Count != 0; // 是否有上传 + + // 校验模板参数 + input.Validate(); + + // 必须有主键 + if (!input.PrimaryFields.Any()) throw Oops.Oh(ErrorCodeEnum.D1405); + } + + // 设置主表参数 + SetEnginePropertyValue(engine); + + // 设置从表参数 + if (engine.SlaveTable != null) SetEnginePropertyValue(engine.SlaveTable); + + // 异步渲染模板 + var tasks = templateList.Select(template => Task.Run(() => RenderAsync(template, (context, builder) => _viewEngine.RunCompile(context, engine, builder)))).ToList(); + await Task.WhenAll(tasks); + + // 获取结果集 + var result = new List(); + foreach (var task in tasks) result.Add(await task); + + // 处理输出路径 + return result; + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableEntityCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableEntityCodeGenStrategy.cs new file mode 100644 index 00000000..84053397 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableEntityCodeGenStrategy.cs @@ -0,0 +1,60 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 表实体代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.TableEntity)] +public class TableEntityCodeGenStrategy : CodeGenEntityStrategyBase, ISingleton +{ + private readonly TemplateContextOutput _template = new() { Name = "Entity.cs.vm", OutPath = "Entity/{ModuleName}.cs" }; + + public override async Task> GenerateCode(CreateEntityInput input) + { + var config = _dbConnectionOption.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == input.ConfigId) ?? throw Oops.Oh(ErrorCodeEnum.db1004); + input.EntityName = string.IsNullOrWhiteSpace(input.EntityName) ? (config.DbSettings.EnableUnderLine ? CodeGenHelper.CamelColumnName(input.TableName, null) : input.TableName) : input.EntityName; + input.Position = string.IsNullOrWhiteSpace(input.Position) ? "X.Application" : input.Position; + + // Entity.cs.vm中是允许创建没有基类的实体的,所以这里也要做出相同的判断 + string[] dbColumnNames = []; + if (!string.IsNullOrWhiteSpace(input.BaseClassName)) + { + _codeGenOption.EntityBaseColumn.TryGetValue(input.BaseClassName, out dbColumnNames); + if (dbColumnNames is null or { Length: 0 }) throw Oops.Oh("基类配置文件不存在此类型"); + } + + var db = _db.AsTenant().GetConnectionScope(input.ConfigId); + var dbColumnInfos = db.DbMaintenance.GetColumnInfosByTableName(input.TableName, false); + dbColumnInfos.ForEach(u => + { + u.PropertyName = config.DbSettings.EnableUnderLine ? CodeGenHelper.CamelColumnName(u.DbColumnName, dbColumnNames) : u.DbColumnName; // 转下划线后的列名需要再转回来 + u.DataType = CodeGenHelper.ConvertDataType(u, config.DbType); + }); + if (_codeGenOption.BaseEntityNames.Contains(input.BaseClassName, StringComparer.OrdinalIgnoreCase)) + dbColumnInfos = dbColumnInfos.Where(u => !dbColumnNames.Contains(u.PropertyName, StringComparer.OrdinalIgnoreCase)).ToList(); + + var dbTableInfo = db.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == input.TableName || u.Name == input.TableName.ToLower()) ?? throw Oops.Oh(ErrorCodeEnum.db1001); + + var engine = new TableEntityEngine + { + NameSpace = $"{input.Position}.Entity", + TableName = input.TableName, + EntityName = input.EntityName, + BaseClassName = string.IsNullOrWhiteSpace(input.BaseClassName) ? "" : $": {input.BaseClassName}", + ConfigId = input.ConfigId, + Description = string.IsNullOrWhiteSpace(dbTableInfo.Description) + ? input.EntityName + "业务表" + : dbTableInfo.Description, + TableFields = dbColumnInfos + }; + + var result = await RenderAsync(_template, (context, builder) => _viewEngine.RunCompile(context, engine, builder)); + result.OutPath = Path.Combine(Path.Combine(new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent!.FullName, input.Position), result.OutPath.Replace("{ModuleName}", input.EntityName)); + return [result]; + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableSeedDataCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableSeedDataCodeGenStrategy.cs new file mode 100644 index 00000000..776f91f7 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/Entity/TableSeedDataCodeGenStrategy.cs @@ -0,0 +1,176 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 表种子数据代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.TableSeedData)] +public class TableSeedDataCodeGenStrategy : CodeGenEntityStrategyBase, ISingleton +{ + private readonly TemplateContextOutput _template = new() { Name = "SeedData.cs.vm", OutPath = "SeedData/{ModuleName}SeedData.cs" }; + + public override async Task> GenerateCode(CreateSeedDataInput input) + { + var config = _dbConnectionOption.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == input.ConfigId) ?? throw Oops.Oh(ErrorCodeEnum.db1004); + input.Position = string.IsNullOrWhiteSpace(input.Position) ? "X.Core" : input.Position; + + var db = _db.AsTenant().GetConnectionScope(input.ConfigId); + var tableInfo = db.DbMaintenance.GetTableInfoList(false).First(u => u.Name == input.TableName); // 表名 + List dbColumnInfos = db.DbMaintenance.GetColumnInfosByTableName(input.TableName, false); // 所有字段 + IEnumerable entityInfos = await GetEntityInfos(); + Type entityType = null; + foreach (var item in entityInfos) + { + if (tableInfo.Name.ToLower() != (config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(item.DbTableName) : item.DbTableName).ToLower()) continue; + entityType = item.Type; + break; + } + if (entityType == null) throw Oops.Oh(ErrorCodeEnum.db1003); + + input.EntityName = entityType.Name; + input.SeedDataName = entityType.Name + "SeedData"; + if (!string.IsNullOrWhiteSpace(input.Suffix)) input.SeedDataName += input.Suffix; + + // 查询所有数据 + var query = db.QueryableByObject(entityType); + + // 优先用创建时间排序 + DbColumnInfo orderField = dbColumnInfos.FirstOrDefault(u => u.DbColumnName.ToLower() is "create_time" or "createtime"); + if (orderField != null) query = query.OrderBy(orderField.DbColumnName); + + // 优先用创建时间排序,再使用第一个主键排序 + if (dbColumnInfos.Any(u => u.IsPrimarykey)) + query = query.OrderBy(dbColumnInfos.First(u => u.IsPrimarykey).DbColumnName); + var records = ((IEnumerable)await query.ToListAsync()).ToDynamicList(); + + // 过滤已存在的数据 + if (input.FilterExistingData && records.Any()) + { + // 获取实体类型-所有种数据数据类型 + var entityTypes = App.EffectiveTypes.Where(u => u.FullName != null && !u.IsInterface && !u.IsAbstract && u.IsClass && u.IsDefined(typeof(SugarTable), false) && u.FullName.EndsWith("." + input.EntityName)) + .Where(u => !u.GetCustomAttributes().Any()) + .ToList(); + if (entityTypes.Count == 1) // 只有一个实体匹配才能过滤 + { + // 获取实体的主键对应的属性名称 + var pkInfo = entityTypes[0].GetProperties().FirstOrDefault(u => u.GetCustomAttribute()?.IsPrimaryKey == true); + if (pkInfo != null) + { + var seedDataTypes = App.EffectiveTypes.Where(u => !u.IsInterface && !u.IsAbstract && u.IsClass && u.GetInterfaces() + .Any(i => i.HasImplementedRawGeneric(typeof(ISqlSugarEntitySeedData<>)) && i.GenericTypeArguments[0] == entityTypes[0])).ToList(); + // 可能会重名的种子数据不作为过滤项 + string doNotFilterFullName1 = $"{input.Position}.SeedData.{input.SeedDataName}"; + string doNotFilterFullName2 = $"{input.Position}.{input.SeedDataName}"; // Core中的命名空间没有SeedData + + PropertyInfo idPropertySeedData = records[0].GetType().GetProperty("Id"); + for (int i = seedDataTypes.Count - 1; i >= 0; i--) + { + string fullName = seedDataTypes[i].FullName; + if ((fullName == doNotFilterFullName1) || (fullName == doNotFilterFullName2)) continue; + + // 删除重复数据 + var instance = Activator.CreateInstance(seedDataTypes[i]); + var hasDataMethod = seedDataTypes[i].GetMethod("HasData"); + var seedData = ((IEnumerable)hasDataMethod?.Invoke(instance, null))?.Cast(); + if (seedData == null) continue; + + List recordsToRemove = new(); + foreach (var record in records) + { + object recordId = pkInfo.GetValue(record); + if (seedData.Select(d1 => idPropertySeedData.GetValue(d1)).Any(dataId => recordId != null && dataId != null && recordId.Equals(dataId))) recordsToRemove.Add(record); + } + foreach (var itemToRemove in recordsToRemove) records.Remove(itemToRemove); + } + } + } + } + + // 获取所有字段信息 + var propertyList = entityType.GetProperties().Where(x => false == (x.GetCustomAttribute()?.IsIgnore ?? false)).ToList(); + for (var i = 0; i < propertyList.Count; i++) + { + if (propertyList[i].Name != nameof(EntityBaseId.Id) || !(propertyList[i].GetCustomAttribute()?.IsPrimaryKey ?? true)) continue; + var temp = propertyList[i]; + for (var j = i; j > 0; j--) propertyList[j] = propertyList[j - 1]; + propertyList[0] = temp; + } + + // 拼接种子数据 + var recordList = records.Select(obj => string.Join(", ", propertyList.Select(prop => + { + var propType = Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType; + object value = prop.GetValue(obj); + if (value == null) value = "null"; + else if (propType == typeof(string)) + { + value = (value as string)?.Replace("\"", "\"\""); + value = $"@\"{value}\""; + } + else if (propType.IsEnum) + { + value = $"{propType.Name}.{value}"; + } + else if (propType == typeof(bool)) + { + value = (bool)value ? "true" : "false"; + } + else if (propType == typeof(DateTime)) + { + value = $"DateTime.Parse(\"{((DateTime)value):yyyy-MM-dd HH:mm:ss.fff}\")"; + } + return $"{prop.Name}={value}"; + }))).ToList(); + + var engine = new TableSeedDataEngine + { + NameSpace = $"{input.Position}.SeedData", + EntityName = input.EntityName, + Description = tableInfo.Description, + RecordList = recordList + }; + var result = await RenderAsync(_template.DeepCopy(), (context, builder) => _viewEngine.RunCompile(context, engine, builder)); + result.OutPath = Path.Combine(Path.Combine(new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent!.FullName, input.Position), result.OutPath.Replace("{ModuleName}", input.EntityName)); + return [result]; + } + + /// + /// 获取库表信息 + /// + /// + private async Task> GetEntityInfos() + { + var type = typeof(SugarTable); + var types = new List(); + var entityInfos = new List(); + if (_codeGenOption.EntityAssemblyNames != null) + foreach (var asm in _codeGenOption.EntityAssemblyNames.Select(Assembly.Load)) + types.AddRange(asm.GetExportedTypes().ToList()); + + Type[] cosType = types.Where(u => IsMyAttribute(Attribute.GetCustomAttributes(u, true))).ToArray(); + foreach (var c in cosType) + { + var sugarAttribute = c.GetCustomAttributes(type, true).FirstOrDefault(); + var des = c.GetCustomAttributes(typeof(DescriptionAttribute), true); + var description = des.Length > 0 ? ((DescriptionAttribute)des[0]).Description : ""; + entityInfos.Add(new EntityInfo + { + EntityName = c.Name, + DbTableName = sugarAttribute == null ? c.Name : ((SugarTable)sugarAttribute).TableName, + TableDescription = description, + Type = c + }); + } + return await Task.FromResult(entityInfos); + + bool IsMyAttribute(Attribute[] o) + { + return o.Any(a => a.GetType() == type); + } + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/MasterSlaveTablesCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/MasterSlaveTablesCodeGenStrategy.cs new file mode 100644 index 00000000..b4462957 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/MasterSlaveTablesCodeGenStrategy.cs @@ -0,0 +1,81 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 主从表代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.MasterSlaveTables)] +public class MasterSlaveTablesCodeGenStrategy : CodeGenTableStrategyBase, ISingleton +{ + public override async Task> GenerateCode(SysCodeGen input) + { + var mainTableInfo = input.TableList.FirstOrDefault() ?? throw Oops.Oh(ErrorCodeEnum.D1401); + var columnList = mainTableInfo.ColumnList.Adapt>(); + + var slaveTableInfo = input.TableList.Skip(1).FirstOrDefault() ?? throw Oops.Oh(ErrorCodeEnum.D1401); + var slaveColumnList = slaveTableInfo.ColumnList.Adapt>(); + + // 创建视图引擎数据 + var engine = new CustomTemplateEngine + { + PagePath = input.PagePath, // 前端目录 + NameSpace = input.NameSpace, // 命名空间 + ClassName = mainTableInfo.EntityName, // 类名称 + ModuleName = mainTableInfo.EntityName, // 模块名称 + TreeConfig = input.TreeConfig, // 树组件配置 + LastLinkPropertyName = mainTableInfo.LastLinkPropertyName, // 上级联表字段 + NextLinkPropertyName = mainTableInfo.NextLinkPropertyName, // 下级联表字段 + LowerClassName = mainTableInfo.EntityName[..1].ToLower() + mainTableInfo.EntityName[1..], // 首字母小写的类名称 + ConfigId = mainTableInfo.ConfigId, // 库定位器名 + AllFields = columnList, // 所有字段集 + + SlaveTable = new CustomTemplateEngine + { + PagePath = input.PagePath, // 前端目录 + NameSpace = input.NameSpace, // 命名空间 + BusName = slaveTableInfo.BusName, + ClassName = slaveTableInfo.EntityName, // 类名称 + ModuleName = slaveTableInfo.EntityName, // 模块名称 + LastLinkPropertyName = slaveTableInfo.LastLinkPropertyName, // 上级联表字段 + NextLinkPropertyName = slaveTableInfo.NextLinkPropertyName, // 下级联表字段 + LowerClassName = slaveTableInfo.EntityName[..1].ToLower() + slaveTableInfo.EntityName[1..], // 首字母小写的类名称 + ConfigId = slaveTableInfo.ConfigId, // 库定位器名 + AllFields = slaveColumnList, // 所有字段集 + }, + }; + + // 获取模板列表 + var templateList = GetTemplateList(input); + + // 处理模板输出路径 + templateList.ForEach(e => ReplaceTemplateOutput(e, input)); + + // 渲染模板 + var result = await RenderList(input, templateList, engine); + + // 渲染从表编辑组件 + var slaveTemplate = GetTemplateList(input).First(u => u.Type == 1010); + result.AddRange(await RenderList(input, [slaveTemplate], engine.SlaveTable)); + slaveTemplate.Name = slaveTemplate.Name.Replace("editDialog", "slave_editDialog"); + slaveTemplate.OutPath = slaveTemplate.OutPath.Replace("{ModuleName}", "{SlaveModuleName}"); + ReplaceTemplateOutput(slaveTemplate, input); + + // 如果需要生成从表接口服务 + templateList = GetTemplateList(input).Where(u => u.Type >= 2000).ToList(); + templateList.ForEach(e => + { + e.OutPath = e.OutPath.Replace("{ModuleName}", "{SlaveModuleName}"); + ReplaceTemplateOutput(e, input); + }); + var slaveResult = await RenderList(input, templateList, engine.SlaveTable); + slaveResult.ForEach(u => u.Name = u.Name.Replace("service_", "service_slave_")); + result.AddRange(slaveResult); + + return result; + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/SingleTableCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/SingleTableCodeGenStrategy.cs new file mode 100644 index 00000000..7ca7947a --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/SingleTableCodeGenStrategy.cs @@ -0,0 +1,44 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 单表代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.SingleTable)] +public class SingleTableCodeGenStrategy : CodeGenTableStrategyBase, ISingleton +{ + public override async Task> GenerateCode(SysCodeGen input) + { + var tableInfo = input.TableList.FirstOrDefault() ?? throw Oops.Oh(ErrorCodeEnum.D1401); + var columnList = tableInfo.ColumnList.Adapt>(); + + // 创建视图引擎数据 + var engine = new CustomTemplateEngine + { + PagePath = input.PagePath, // 前端目录 + NameSpace = input.NameSpace, // 命名空间 + ClassName = tableInfo.EntityName, // 类名称 + ModuleName = tableInfo.EntityName, // 模块名称 + LowerClassName = tableInfo.EntityName[..1].ToLower() + tableInfo.EntityName[1..], // 首字母小写的类名称 + TreeConfig = input.TreeConfig, // 树组件配置 + ConfigId = tableInfo.ConfigId, // 库定位器名 + AllFields = columnList, // 所有字段集 + LastLinkPropertyName = tableInfo.LastLinkPropertyName, // 上级关联字段名 + NextLinkPropertyName = tableInfo.NextLinkPropertyName, // 下级关联字段名 + }; + + // 获取模板列表 + var templateList = GetTemplateList(input); + + // 处理模板输出路径 + templateList.ForEach(e => ReplaceTemplateOutput(e, input)); + + // 渲染 + return await RenderList(input, templateList, engine); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TableRelationshipCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TableRelationshipCodeGenStrategy.cs new file mode 100644 index 00000000..b115a8ee --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TableRelationshipCodeGenStrategy.cs @@ -0,0 +1,19 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 关系对照代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.TableRelationship)] +public class TableRelationshipCodeGenStrategy : CodeGenTableStrategyBase, ISingleton +{ + public override Task> GenerateCode(SysCodeGen input) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeMasterSlaveTablesCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeMasterSlaveTablesCodeGenStrategy.cs new file mode 100644 index 00000000..28e02f26 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeMasterSlaveTablesCodeGenStrategy.cs @@ -0,0 +1,19 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 主从明细带树组件代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.TreeMasterSlaveTables)] +public class TreeMasterSlaveTablesCodeGenStrategy : CodeGenTableStrategyBase, ISingleton +{ + public override async Task> GenerateCode(SysCodeGen input) + { + return await App.GetService().GenerateCode(input); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeSingleTableCodeGenTableStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeSingleTableCodeGenTableStrategy.cs new file mode 100644 index 00000000..812f06e8 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeSingleTableCodeGenTableStrategy.cs @@ -0,0 +1,19 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 单表带树组件代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.TreeSingleTable)] +public class TreeSingleTableCodeGenStrategy : CodeGenTableStrategyBase, ISingleton +{ + public override async Task> GenerateCode(SysCodeGen input) + { + return await App.GetService().GenerateCode(input); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeTableRelationshipCodeGenStrategy.cs b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeTableRelationshipCodeGenStrategy.cs new file mode 100644 index 00000000..6d895594 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/CodeGen/Strategies/TreeTableRelationshipCodeGenStrategy.cs @@ -0,0 +1,20 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core.CodeGen; + +/// +/// 关系对照带树组件代码生成策略类 +/// +[CodeGenStrategy(CodeGenSceneEnum.TreeTableRelationship)] +public class TreeTableRelationshipCodeGenStrategy : CodeGenTableStrategyBase, ISingleton +{ + public override async Task> GenerateCode(SysCodeGen input) + { + // TODO 关系对照带树组件生成逻辑 + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs b/Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs index 11d02308..0723e181 100644 --- a/Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs +++ b/Admin.NET/Admin.NET.Core/Entity/SysCodeGen.cs @@ -1,225 +1,132 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -/// -/// 代码生成表 -/// -[SugarTable(null, "代码生成表")] -[SysTable] -[SugarIndex("i_{table}_b", nameof(BusName), OrderByType.Asc)] -[SugarIndex("i_{table}_t", nameof(TableName), OrderByType.Asc)] -public partial class SysCodeGen : EntityBase -{ - /// - /// 作者姓名 - /// - [SugarColumn(ColumnDescription = "作者姓名", Length = 32)] - [MaxLength(32)] - public string? AuthorName { get; set; } - - /// - /// 是否移除表前缀 - /// - [SugarColumn(ColumnDescription = "是否移除表前缀", Length = 8)] - [MaxLength(8)] - public string? TablePrefix { get; set; } - - /// - /// 生成方式 - /// - [SugarColumn(ColumnDescription = "生成方式", Length = 32)] - [MaxLength(32)] - public string? GenerateType { get; set; } - - /// - /// 库定位器名 - /// - [SugarColumn(ColumnDescription = "库定位器名", Length = 64)] - [MaxLength(64)] - public string? ConfigId { get; set; } - - /// - /// 数据库名(保留字段) - /// - [SugarColumn(ColumnDescription = "数据库库名", Length = 64)] - [MaxLength(64)] - public string? DbName { get; set; } - - /// - /// 数据库类型 - /// - [SugarColumn(ColumnDescription = "数据库类型", DefaultValue = "4")] - public SqlSugar.DbType DbType { get; set; } = SqlSugar.DbType.PostgreSQL; - - /// - /// 数据库链接 - /// - [SugarColumn(ColumnDescription = "数据库链接", Length = 512)] - [MaxLength(512)] - public string? ConnectionString { get; set; } - - /// - /// 数据库表名 - /// - [SugarColumn(ColumnDescription = "数据库表名", Length = 128)] - [MaxLength(128)] - public string? TableName { get; set; } - - /// - /// 树控件名称 - /// - [SugarColumn(ColumnDescription = "树控件名称", Length = 64)] - [MaxLength(64)] - public string? TreeName { get; set; } - - /// - /// 命名空间 - /// - [SugarColumn(ColumnDescription = "命名空间", Length = 128)] - [MaxLength(128)] - public string? NameSpace { get; set; } - - /// - /// 业务名 - /// - [SugarColumn(ColumnDescription = "业务名", Length = 128)] - [MaxLength(128)] - public string? BusName { get; set; } - - /// - /// 表唯一字段配置 - /// - [SugarColumn(ColumnDescription = "表唯一字段配置", Length = 128)] - [MaxLength(128)] - public string? TableUniqueConfig { get; set; } - - /// - /// 是否生成菜单 - /// - [SugarColumn(ColumnDescription = "是否生成菜单")] - public bool GenerateMenu { get; set; } = true; - - /// - /// 菜单图标 - /// - [SugarColumn(ColumnDescription = "菜单图标", Length = 32)] - public string? MenuIcon { get; set; } = "ele-Menu"; - - /// - /// 菜单编码 - /// - [SugarColumn(ColumnDescription = "菜单编码")] - public long? MenuPid { get; set; } - - /// - /// 页面目录 - /// - [SugarColumn(ColumnDescription = "页面目录", Length = 32)] - public string? PagePath { get; set; } - - /// - /// 支持打印类型 - /// - [SugarColumn(ColumnDescription = "支持打印类型", Length = 32)] - [MaxLength(32)] - public string? PrintType { get; set; } - - /// - /// 打印模版名称 - /// - [SugarColumn(ColumnDescription = "打印模版名称", Length = 32)] - [MaxLength(32)] - public string? PrintName { get; set; } - - /// - /// 左边树形结构表 - /// - [SugarColumn(ColumnDescription = "左边树形结构表", Length = 64)] - [MaxLength(64)] - public string? LeftTab { get; set; } - - /// - /// 左边关联字段 - /// - [SugarColumn(ColumnDescription = "左边关联字段", Length = 64)] - [MaxLength(64)] - public string? LeftKey { get; set; } - - /// - /// 左边关联主表字段 - /// - [SugarColumn(ColumnDescription = "左边关联主表字段", Length = 64)] - [MaxLength(64)] - public string? LeftPrimaryKey { get; set; } - - /// - /// 左边树名称 - /// - [SugarColumn(ColumnDescription = "左边树名称", Length = 64)] - [MaxLength(64)] - public string? LeftName { get; set; } - - /// - /// 下表名称 - /// - [SugarColumn(ColumnDescription = "右区域下框表名称", Length = 64)] - [MaxLength(64)] - public string? BottomTab { get; set; } - - /// - /// 下表关联字段 - /// - [SugarColumn(ColumnDescription = "右区域下框表关联字段", Length = 64)] - [MaxLength(64)] - public string? BottomKey { get; set; } - - /// - /// 下表关联主表字段 - /// - [SugarColumn(ColumnDescription = "右区域下框表关联主表字段", Length = 64)] - [MaxLength(64)] - public string? BottomPrimaryKey { get; set; } - - /// - /// 模板文件夹 - /// - [SugarColumn(ColumnDescription = "模板文件夹", Length = 64)] - [MaxLength(64)] - public string? Template { get; set; } - - /// - /// 表类型 - /// - [SugarColumn(ColumnDescription = "表类型", Length = 64)] - public string TabType { get; set; } - - /// - /// 树控件PidKey字段 - /// - [SugarColumn(ColumnDescription = "树控件PidKey字段", Length = 64)] - [MaxLength(64)] - public string? TreeKey { get; set; } - - /// - /// 是否使用 Api Service - /// - [SugarColumn(ColumnDescription = "是否使用 Api Service")] - public bool IsApiService { get; set; } = false; - - /// - /// 模板关系:SysCodeGenTemplateRelation表中的CodeGenId,注意禁止给CodeGenTemplateRelations手动赋值 - /// - [Navigate(NavigateType.OneToMany, nameof(SysCodeGenTemplateRelation.CodeGenId))] - public List CodeGenTemplateRelations { get; set; } - - /// - /// 表唯一字段列表 - /// - [SugarColumn(IsIgnore = true)] - public virtual List TableUniqueList => string.IsNullOrWhiteSpace(TableUniqueConfig) ? null : JSON.Deserialize>(TableUniqueConfig); +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成表 +/// +[SysTable] +[SugarTable(null, "代码生成表")] +[SugarIndex("index_{table}_b", nameof(BusName), OrderByType.Asc)] +public partial class SysCodeGen : EntityBase +{ + /// + /// 作者姓名 + /// + [MaxLength(32)] + [SugarColumn(ColumnDescription = "作者姓名", Length = 32)] + public virtual string? AuthorName { get; set; } + + /// + /// 作者邮箱 + /// + [MaxLength(32)] + [SugarColumn(ColumnDescription = "作者邮箱", Length = 32)] + public virtual string? Email { get; set; } + + /// + /// 生成方式 + /// + [SugarColumn(ColumnDescription = "生成方式")] + public virtual CodeGenMethodEnum GenerateMethod { get; set; } + + /// + /// 生成场景 + /// + [SugarColumn(ColumnDescription = "生成场景")] + public virtual CodeGenSceneEnum Scene { get; set; } + + /// + /// 树组件配置 + /// + [SugarColumn(ColumnDescription = "树组件配置", IsJson = true, ColumnDataType = StaticConfig.CodeFirst_BigString)] + public virtual TreeWithTableConfigInput? TreeConfig { get; set; } + + /// + /// 命名空间 + /// + [MaxLength(128)] + [SugarColumn(ColumnDescription = "命名空间", Length = 128)] + public virtual string NameSpace { get; set; } + + /// + /// 业务名 + /// + [MaxLength(128)] + [SugarColumn(ColumnDescription = "业务名", Length = 128)] + public virtual string BusName { get; set; } + + /// + /// 模块名称 + /// + [MaxLength(32)] + [SugarColumn(ColumnDescription = "模块名称", Length = 32)] + public virtual string ModuleName { get; set; } + + /// + /// 是否水平布局 + /// + [SugarColumn(ColumnDescription = "是否水平布局")] + public virtual bool IsHorizontal { get; set; } + + /// + /// 是否生成菜单 + /// + [SugarColumn(ColumnDescription = "是否生成菜单")] + public virtual bool GenerateMenu { get; set; } = true; + + /// + /// 菜单图标 + /// + [SugarColumn(ColumnDescription = "菜单图标", Length = 32)] + public virtual string MenuIcon { get; set; } = "ele-Menu"; + + /// + /// 菜单编码 + /// + [SugarColumn(ColumnDescription = "菜单编码")] + public virtual long MenuPid { get; set; } + + /// + /// 页面目录 + /// + [SugarColumn(ColumnDescription = "页面目录", Length = 32)] + public virtual string PagePath { get; set; } + + /// + /// 支持打印类型 + /// + [SugarColumn(ColumnDescription = "支持打印类型")] + public virtual CodeGenPrintTypeEnum PrintType { get; set; } + + /// + /// 打印模版名称 + /// + [MaxLength(32)] + [SugarColumn(ColumnDescription = "打印模版名称", Length = 32)] + public virtual string? PrintName { get; set; } + + /// + /// 是否使用 Api Service + /// + [SugarColumn(ColumnDescription = "是否使用 Api Service")] + public virtual bool IsApiService { get; set; } = false; + + /// + /// 关联表 + /// + [Navigate(NavigateType.OneToMany, nameof(SysCodeGenTable.CodeGenId))] + public List TableList { get; set; } + + /// + /// 简拼 + /// + [BindTextAbbr(nameof(BusName))] + [SugarColumn(ColumnDescription = "简拼", Length = 128)] + [MaxLength(128)] + public virtual string? Pinyin { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenColumn.cs b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenColumn.cs new file mode 100644 index 00000000..7dfeb7f5 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenColumn.cs @@ -0,0 +1,162 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成表字段配置表 +/// +[SysTable] +[SugarTable(null, "代码生成表字段配置表")] +[SugarIndex("index_{table}_cti", nameof(CodeGenTableId), OrderByType.Asc)] +[SugarIndex("index_{table}_cn", nameof(ColumnName), OrderByType.Asc)] +public partial class SysCodeGenColumn : EntityBase +{ + /// + /// 代码生成表Id + /// + [SugarColumn(ColumnDescription = "表Id")] + public virtual long CodeGenTableId { get; set; } + + /// + /// 数据库字段名 + /// + [SugarColumn(ColumnDescription = "字段名称", Length = 128)] + [Required, MaxLength(128)] + public virtual string ColumnName { get; set; } + + /// + /// 实体属性名 + /// + [SugarColumn(ColumnDescription = "属性名称", Length = 128)] + [Required, MaxLength(128)] + public virtual string PropertyName { get; set; } + + /// + /// .NET数据类型 + /// + [SugarColumn(ColumnDescription = "NET数据类型", Length = 64)] + [MaxLength(64)] + public virtual string NetType { get; set; } + + /// + /// 数据库中类型(物理类型) + /// + [SugarColumn(ColumnDescription = "数据库中类型", Length = 64)] + [MaxLength(64)] + public virtual string DataType { get; set; } + + /// + /// 字段数据长度 + /// + [SugarColumn(ColumnDescription = "字段数据长度")] + public virtual int? ColumnLength { get; set; } + + /// + /// 字段描述 + /// + [SugarColumn(ColumnDescription = "字段描述", Length = 128)] + [MaxLength(128)] + public virtual string ColumnComment { get; set; } + + /// + /// 控件类型 + /// + [SugarColumn(ColumnDescription = "控件类型")] + public virtual CodeGenEffectTypeEnum EffectType { get; set; } + + /// + /// 控件配置 + /// + [SugarColumn(ColumnDescription = "控件配置", ColumnDataType = StaticConfig.CodeFirst_BigString)] + public virtual string? Config { get; set; } + + /// + /// 主键 + /// + [SugarColumn(ColumnDescription = "主键")] + public virtual bool IsPrimarykey { get; set; } + + /// + /// 是否通用字段 + /// + [SugarColumn(ColumnDescription = "是否通用字段")] + public virtual bool IsCommon { get; set; } + + /// + /// 是否必填 + /// + [SugarColumn(ColumnDescription = "是否必填")] + public virtual bool IsRequired { get; set; } + + /// + /// 增改 + /// + [SugarColumn(ColumnDescription = "增改")] + public virtual bool IsAddUpdate { get; set; } + + /// + /// 导入导出 + /// + [SugarColumn(ColumnDescription = "导入导出")] + public virtual bool IsImport { get; set; } + + /// + /// 是否可排序 + /// + [SugarColumn(ColumnDescription = "是否可排序")] + public virtual bool IsSortable { get; set; } + + /// + /// 是否是统计字段 + /// + [SugarColumn(ColumnDescription = "是否是统计字段")] + public virtual bool IsStatistical { get; set; } + + /// + /// 是否是查询条件 + /// + [SugarColumn(ColumnDescription = "是否是查询条件")] + public virtual bool IsQuery { get; set; } + + /// + /// 查询方式 + /// + [SugarColumn(ColumnDescription = "查询方式", Length = 16)] + [MaxLength(16)] + public virtual string? QueryType { get; set; } + + /// + /// 列表显示 + /// + [SugarColumn(ColumnDescription = "列表显示")] + public virtual bool IsTable { get; set; } + + /// + /// 内容复制 + /// + [SugarColumn(ColumnDescription = "内容复制")] + public virtual bool IsCopy { get; set; } + + /// + /// 默认值 + /// + [SugarColumn(ColumnDescription = "默认值", Length = 256)] + [MaxLength(256)] + public virtual string? DefaultValue { get; set; } + + /// + /// 字段验证规则 + /// + [SugarColumn(ColumnDescription = "字段验证规则")] + public virtual CodeGenFromRuleValidEnum? FromValid { get; set; } + + /// + /// 排序 + /// + [SugarColumn(ColumnDescription = "排序", DefaultValue = "100")] + public virtual int OrderNo { get; set; } = 100; +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs deleted file mode 100644 index ab3def49..00000000 --- a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenConfig.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -/// -/// 代码生成字段配置表 -/// -[SugarTable(null, "代码生成字段配置表")] -[SysTable] -public partial class SysCodeGenConfig : EntityBase -{ - /// - /// 代码生成主表Id - /// - [SugarColumn(ColumnDescription = "主表Id")] - public long CodeGenId { get; set; } - - /// - /// 数据库字段名 - /// - [SugarColumn(ColumnDescription = "字段名称", Length = 128)] - [Required, MaxLength(128)] - public virtual string ColumnName { get; set; } - - /// - /// 实体属性名 - /// - [SugarColumn(ColumnDescription = "属性名称", Length = 128)] - [Required, MaxLength(128)] - public virtual string PropertyName { get; set; } - - /// - /// 字段数据长度 - /// - [SugarColumn(ColumnDescription = "字段数据长度", DefaultValue = "0")] - public int ColumnLength { get; set; } = 0; - - /// - /// 字段描述 - /// - [SugarColumn(ColumnDescription = "字段描述", Length = 128)] - [MaxLength(128)] - public string? ColumnComment { get; set; } - - /// - /// .NET数据类型 - /// - [SugarColumn(ColumnDescription = "NET数据类型", Length = 64)] - [MaxLength(64)] - public string? NetType { get; set; } - - /// - /// 作用类型(字典) - /// - [SugarColumn(ColumnDescription = "作用类型", Length = 64)] - [MaxLength(64)] - public string? EffectType { get; set; } - - /// - /// 外键库标识 - /// - [SugarColumn(ColumnDescription = "外键库标识", Length = 20)] - [MaxLength(20)] - public string? FkConfigId { get; set; } - - /// - /// 外键实体名称 - /// - [SugarColumn(ColumnDescription = "外键实体名称", Length = 64)] - [MaxLength(64)] - public string? FkEntityName { get; set; } - - /// - /// 外键表名称 - /// - [SugarColumn(ColumnDescription = "外键表名称", Length = 128)] - [MaxLength(128)] - public string? FkTableName { get; set; } - - /// - /// 外键显示字段 - /// - [SugarColumn(ColumnDescription = "外键显示字段", Length = 64)] - [MaxLength(64)] - public string? FkColumnName { get; set; } - - /// - /// 外键链接字段 - /// - [SugarColumn(ColumnDescription = "外键链接字段", Length = 64)] - [MaxLength(64)] - public string? FkLinkColumnName { get; set; } - - /// - /// 外键显示字段.NET类型 - /// - [SugarColumn(ColumnDescription = "外键显示字段.NET类型", Length = 64)] - [MaxLength(64)] - public string? FkColumnNetType { get; set; } - - /// - /// 字典编码 - /// - [SugarColumn(ColumnDescription = "字典编码", Length = 64)] - [MaxLength(64)] - public string? DictTypeCode { get; set; } - - /// - /// 是否缩进列表(字典) - /// - [SugarColumn(ColumnDescription = "是否缩进列表", Length = 8)] - [MaxLength(8)] - public string? WhetherRetract { get; set; } - - /// - /// 是否必填(字典) - /// - [SugarColumn(ColumnDescription = "是否必填", Length = 8)] - [MaxLength(8)] - public string? WhetherRequired { get; set; } - - /// - /// 是否可排序(字典) - /// - [SugarColumn(ColumnDescription = "是否可排序", Length = 8)] - [MaxLength(8)] - public string? WhetherSortable { get; set; } - - /// - /// 是否是统计字段 - /// - [SugarColumn(ColumnDescription = "是否是统计字段", Length = 8)] - [MaxLength(8)] - public string? Statistical { get; set; } - - /// - /// 是否是分组字段 - /// - [SugarColumn(ColumnDescription = "是否是分组字段", Length = 8)] - [MaxLength(8)] - public string? IsGroupBy { get; set; } - - /// - /// 是否是查询条件 - /// - [SugarColumn(ColumnDescription = "是否是查询条件", Length = 8)] - [MaxLength(8)] - public string? QueryWhether { get; set; } - - /// - /// 查询方式 - /// - [SugarColumn(ColumnDescription = "查询方式", Length = 16)] - [MaxLength(16)] - public string? QueryType { get; set; } - - /// - /// 列表显示 - /// - [SugarColumn(ColumnDescription = "列表显示", Length = 8)] - [MaxLength(8)] - public string? WhetherTable { get; set; } - - /// - /// 增改 - /// - [SugarColumn(ColumnDescription = "增改", Length = 8)] - [MaxLength(8)] - public string? WhetherAddUpdate { get; set; } - - /// - /// 主键 - /// - [SugarColumn(ColumnDescription = "主键", Length = 8)] - [MaxLength(8)] - public string? ColumnKey { get; set; } - - /// - /// 数据库中类型(物理类型) - /// - [SugarColumn(ColumnDescription = "数据库中类型", Length = 64)] - [MaxLength(64)] - public string? DataType { get; set; } - - /// - /// 是否通用字段 - /// - [SugarColumn(ColumnDescription = "是否通用字段", Length = 8)] - [MaxLength(8)] - public string? WhetherCommon { get; set; } - - /// - /// 显示文本字段 - /// - [SugarColumn(ColumnDescription = "显示文本字段", ColumnDataType = StaticConfig.CodeFirst_BigString)] - public string? DisplayColumn { get; set; } - - /// - /// 选中值字段 - /// - [SugarColumn(ColumnDescription = "选中值字段", Length = 128)] - [MaxLength(128)] - public string? ValueColumn { get; set; } - - /// - /// 父级字段 - /// - [SugarColumn(ColumnDescription = "父级字段", Length = 128)] - [MaxLength(128)] - public string? PidColumn { get; set; } - - /// - /// 排序 - /// - [SugarColumn(ColumnDescription = "排序", DefaultValue = "100")] - public int OrderNo { get; set; } = 100; - - /// - /// 字段验证规则 - /// - [SugarColumn(ColumnDescription = "字段验证规则", ColumnDataType = StaticConfig.CodeFirst_BigString)] - public string? Rules { get; set; } - - /// - /// 默认值 - /// - [SugarColumn(ColumnDescription = "默认值", Length = 256)] - [MaxLength(256)] - public string? DefaultValue { get; set; } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTable.cs b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTable.cs new file mode 100644 index 00000000..992c5772 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTable.cs @@ -0,0 +1,77 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成关联表 +/// +[SysTable] +[SugarTable(null, "代码生成关联表")] +[SugarIndex("index_{table}_cgi", nameof(CodeGenId), OrderByType.Asc)] +[SugarIndex("index_{table}_tn", nameof(TableName), OrderByType.Asc)] +public partial class SysCodeGenTable : EntityBase +{ + /// + /// 代码生成Id + /// + [SugarColumn(ColumnDescription = "代码生成Id")] + [Required] + public virtual long CodeGenId { get; set; } + + /// + /// 数据库配置id + /// + [SugarColumn(ColumnDescription = "数据库配置id", Length = 64)] + [MaxLength(64)] + public virtual string ConfigId { get; set; } + + /// + /// 数据库表名 + /// + [SugarColumn(ColumnDescription = "数据库表名", Length = 128)] + [MaxLength(128)] + public virtual string TableName { get; set; } + + /// + /// 表实体名称 + /// + [SugarColumn(ColumnDescription = "表实体名称", Length = 128)] + [MaxLength(128)] + public virtual string EntityName { get; set; } + + /// + /// 模块名称 + /// + [SugarColumn(ColumnDescription = "模块名称", Length = 64)] + [MaxLength(64)] + public virtual string ModuleName { get; set; } + + /// + /// 业务名 + /// + [MaxLength(128)] + [SugarColumn(ColumnDescription = "业务名", Length = 128)] + public virtual string BusName { get; set; } + + /// + /// 上级联表字段 + /// + [SugarColumn(ColumnDescription = "上级联表字段", Length = 32)] + public virtual string? LastLinkPropertyName { get; set; } + + /// + /// 下级联表字段 + /// + [SugarColumn(ColumnDescription = "下级联表字段", Length = 32)] + public virtual string? NextLinkPropertyName { get; set; } + + /// + /// 关联字段 + /// + [Navigate(NavigateType.OneToMany, nameof(SysCodeGenColumn.CodeGenTableId))] + public virtual List ColumnList { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplate.cs b/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplate.cs deleted file mode 100644 index e858a9ea..00000000 --- a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplate.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core; - -/// -/// 代码生成模板配置表 -/// -[SugarTable(null, "代码生成模板配置表")] -[SysTable] -public partial class SysCodeGenTemplate : EntityBase -{ - /// - /// 模板文件名 - /// - [SugarColumn(ColumnDescription = "模板文件名", Length = 128)] - [Required, MaxLength(128)] - public string Name { get; set; } - - /// - /// 代码生成类型 - /// - [SugarColumn(ColumnDescription = "代码生成类型", DefaultValue = "2")] - public CodeGenTypeEnum Type { get; set; } = CodeGenTypeEnum.Backend; - - /// - /// 是否是内置模板(Y-是,N-否) - /// - [SugarColumn(ColumnDescription = "是否是内置模板", DefaultValue = "1")] - public YesNoEnum SysFlag { get; set; } = YesNoEnum.Y; - - /// - /// 是否默认 - /// - [SugarColumn(ColumnDescription = "是否默认")] - public bool? IsDefault { get; set; } - - /// - /// 输出位置 - /// - [SugarColumn(ColumnDescription = "输出位置", Length = 256)] - [Required, MaxLength(256)] - public string OutputFile { get; set; } - - /// - /// 描述 - /// - [SugarColumn(ColumnDescription = "描述", Length = 256)] - [Required, MaxLength(256)] - public string Describe { get; set; } - - /// - /// 排序 - /// - [SugarColumn(ColumnDescription = "排序", DefaultValue = "100")] - public int OrderNo { get; set; } = 100; -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/CodeGenEffectTypeEnum.cs b/Admin.NET/Admin.NET.Core/Enum/CodeGenEffectTypeEnum.cs new file mode 100644 index 00000000..07174934 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Enum/CodeGenEffectTypeEnum.cs @@ -0,0 +1,47 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成控件类型枚举 +/// +[Description("代码生成控件类型枚举")] +public enum CodeGenEffectTypeEnum +{ + [Description("输入框")] + Input = 100, + + [Description("字典选择器")] + DictSelector = 101, + + [Description("常量选择器")] + ConstSelector = 102, + + [Description("枚举选择器")] + EnumSelector = 103, + + [Description("树选择器")] + ApiTreeSelector = 104, + + [Description("外键")] + ForeignKey = 105, + + [Description("数字输入框")] + InputNumber = 106, + + [Description("时间选择")] + DatePicker = 107, + + [Description("文本域")] + InputTextArea = 108, + + [Description("上传")] + Upload = 109, + + [Description("开关")] + Switch = 110 +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/CodeGenFromRuleValidEnum.cs b/Admin.NET/Admin.NET.Core/Enum/CodeGenFromRuleValidEnum.cs new file mode 100644 index 00000000..f8c1638e --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Enum/CodeGenFromRuleValidEnum.cs @@ -0,0 +1,152 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成表单校验类型枚举 +/// +[Description("代码生成表单校验类型枚举")] +public enum CodeGenFromRuleValidEnum +{ + /// + /// 唯一性校验 + /// + [Description("唯一性")] + Unique = 100, + + /// + /// 字符串长度校验 + /// + [Description("字符串长度")] + MaxLength, + + /// + /// 数字范围 + /// + [Description("数字范围")] + Range, + + /// + /// 身份证号码 + /// + [Description("身份证号码")] + IDCard, + + /// + /// 邮政编码 + /// + [Description("邮政编码")] + PostCode, + + /// + /// 手机号码 + /// + [Description("手机号码")] + PhoneNumber, + + /// + /// 固话格式 + /// + [Description("固话格式")] + Telephone, + + /// + /// 手机或固话类型 + /// + [Description("手机或固话类型")] + PhoneOrTelNumber, + + /// + /// 邮箱 + /// + [Description("邮箱")] + EmailAddress, + + /// + /// 统一社会信用代码 + /// + [Description("统一社会信用代码")] + SocialCreditCode, + + /// + /// 网址类型 + /// + [Description("网址类型")] + Url, + + /// + /// 中文 + /// + [Description("中文")] + Chinese, + + /// + /// 中文名 + /// + [Description("中文名")] + ChineseName, + + /// + /// 英文名 + /// + [Description("英文名")] + EnglishName, + + /// + /// 纯大写 + /// + [Description("纯大写")] + Capital, + + /// + /// 纯小写 + /// + [Description("纯小写")] + Lowercase, + + /// + /// 字母和数字组合 + /// + [Description("字母和数字组合")] + WordWithNumber, + + /// + /// Html 标签格式 + /// + [Description("Html 标签格式")] + Html, + + /// + /// GUID 或者 UUID + /// + [Description("GUID 或者 UUID")] + GUID_OR_UUID, + + /// + /// 用户名 + /// + [Description("用户名")] + Username, + + /// + /// 日期类型 + /// + [Description("日期类型")] + Date, + + /// + /// 时间类型 + /// + [Description("时间类型")] + Time, + + /// + /// 年龄 + /// + [Description("年龄")] + Age, +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/CodeGenMethodEnum.cs b/Admin.NET/Admin.NET.Core/Enum/CodeGenMethodEnum.cs new file mode 100644 index 00000000..f5df9007 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Enum/CodeGenMethodEnum.cs @@ -0,0 +1,32 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成方式枚举 +/// +[Description("代码生成方式枚举")] +public enum CodeGenMethodEnum +{ + [Description("下载压缩包")] + DownloadZip = 100, + + [Description("下载压缩包(前端)")] + DownloadZipFrontend = 101, + + [Description("下载压缩包(后端)")] + DownloadZipBackend = 102, + + [Description("生成到本项目")] + GenerateToProject = 200, + + [Description("生成到本项目(前端)")] + GenerateToProjectFrontend = 201, + + [Description("生成到本项目(后端)")] + GenerateToProjectBackend = 202 +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplateRelation.cs b/Admin.NET/Admin.NET.Core/Enum/CodeGenPrintTypeEnum.cs similarity index 63% rename from Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplateRelation.cs rename to Admin.NET/Admin.NET.Core/Enum/CodeGenPrintTypeEnum.cs index d229de4a..0d541297 100644 --- a/Admin.NET/Admin.NET.Core/Entity/SysCodeGenTemplateRelation.cs +++ b/Admin.NET/Admin.NET.Core/Enum/CodeGenPrintTypeEnum.cs @@ -7,23 +7,20 @@ namespace Admin.NET.Core; /// -/// 代码生成模板关系表 +/// 代码生成打印类型枚举 /// -[SugarTable(null, "代码生成模板关系表")] -[SysTable] -public partial class SysCodeGenTemplateRelation : EntityBaseId +[Description("代码生成打印类型枚举")] +public enum CodeGenPrintTypeEnum { /// - /// 代码生成Id + /// 不需要 /// - [SugarColumn(ColumnDescription = "代码生成Id")] - [Required] - public long CodeGenId { get; set; } + [Description("不需要")] + Off = 1, /// - /// 模板Id + /// 绑定打印模版 /// - [SugarColumn(ColumnDescription = "模板Id")] - [Required] - public long TemplateId { get; set; } + [Description("绑定打印模版")] + Custom = 2 } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/CodeGenQueryTypeEnum.cs b/Admin.NET/Admin.NET.Core/Enum/CodeGenQueryTypeEnum.cs new file mode 100644 index 00000000..21286ed2 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Enum/CodeGenQueryTypeEnum.cs @@ -0,0 +1,68 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成查询类型枚举 +/// +[Description("代码生成查询类型枚举")] +public enum CodeGenQueryTypeEnum +{ + /// + /// 等于 + /// + [Description("等于")] + Equal = 100, + + /// + /// 模糊匹配 + /// + [Description("模糊")] + Like = 101, + + /// + /// 大于 + /// + [Description("大于")] + GreaterThan = 102, + + /// + /// 小于 + /// + [Description("小于")] + LessThan = 103, + + /// + /// 不等于 + /// + [Description("不等于")] + NotEqual = 104, + + /// + /// 大于等于 + /// + [Description("大于等于")] + GreaterThanOrEqual = 105, + + /// + /// 小于等于 + /// + [Description("小于等于")] + LessThanOrEqual = 106, + + /// + /// 不为空 + /// + [Description("不为空")] + IsNotNull = 107, + + /// + /// 时间范围 + /// + [Description("时间范围")] + TimeRange = 108 +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/CodeGenSceneEnum.cs b/Admin.NET/Admin.NET.Core/Enum/CodeGenSceneEnum.cs new file mode 100644 index 00000000..8aa7980a --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Enum/CodeGenSceneEnum.cs @@ -0,0 +1,62 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 代码生成模板枚举 +/// +[Description("代码生成模板枚举")] +public enum CodeGenSceneEnum +{ + /// + /// 单表 + /// + [Description("单表")] + SingleTable = 1000, + + /// + /// 单表树组件 + /// + [Description("单表树组件")] + TreeSingleTable = 1010, + + /// + /// 主从表 + /// + [Description("主从表")] + MasterSlaveTables = 2000, + + /// + /// 主从表树组件 + /// + [Description("主从表树组件")] + TreeMasterSlaveTables = 2010, + + /// + /// 关系对照 + /// + [Description("关系对照")] + TableRelationship = 3000, + + /// + /// 关系对照树组件 + /// + [Description("关系对照树组件")] + TreeTableRelationship = 3010, + + /// + /// 表实体 + /// + [Description("表实体")] + TableEntity = -1000, + + /// + /// 表种子数据 + /// + [Description("表种子数据")] + TableSeedData = -2000, +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Enum/ErrorCodeEnum.cs b/Admin.NET/Admin.NET.Core/Enum/ErrorCodeEnum.cs index c41bef3a..05d316d8 100644 --- a/Admin.NET/Admin.NET.Core/Enum/ErrorCodeEnum.cs +++ b/Admin.NET/Admin.NET.Core/Enum/ErrorCodeEnum.cs @@ -583,6 +583,12 @@ public enum ErrorCodeEnum [ErrorCodeItemMetadata("禁止越权操作系统内置参数")] D9002, + /// + /// 无效的参数键值 + /// + [ErrorCodeItemMetadata("无效的参数键值")] + D9003, + /// /// 已存在同名任务调度 /// @@ -626,11 +632,41 @@ public enum ErrorCodeEnum D1303, /// - /// 该表代码模板已经生成过 + /// 未处理的场景类型 /// - [ErrorCodeItemMetadata("该表代码模板已经生成过")] + [ErrorCodeItemMetadata("未处理的场景类型【{0}】")] D1400, + /// + /// 代码生成表数据为空 + /// + [ErrorCodeItemMetadata("代码生成表数据为空")] + D1401, + + /// + /// 树组件配置参数不能为空 + /// + [ErrorCodeItemMetadata("树组件配置参数不能为空")] + D1402, + + /// + /// 字段控件类型配置不能为空 + /// + [ErrorCodeItemMetadata("字段控件类型配置不能为空")] + D1403, + + /// + /// 后端服务不存在 + /// + [ErrorCodeItemMetadata("{0}Service后端服务不存在,请检查【使用现有Api】参数")] + D1404, + + /// + /// 表实体必须指定至少一个主键 + /// + [ErrorCodeItemMetadata("[{0}]表实体必须指定至少一个主键")] + D1405, + /// /// 该类型不存在 /// diff --git a/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs b/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs deleted file mode 100644 index a0894688..00000000 --- a/Admin.NET/Admin.NET.Core/SeedData/SysCodeGenTemplateSeedData.cs +++ /dev/null @@ -1,266 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.SeedData; - -/// -/// 代码生成模板配置表 表种子数据 -/// -[IgnoreUpdateSeed] -public class SysCodeGenTemplateSeedData : ISqlSugarEntitySeedData -{ - /// - /// 种子数据 - /// - /// - public IEnumerable HasData() - { - string recordList = @" - [ - { - ""Name"": ""web_api.ts.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": false, - ""OutputFile"": ""api/{PagePath}/{TableNameLower}.ts"", - ""Describe"": ""(WEB)接口请求"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000101 - }, - { - ""Name"": ""web_views_index.vue.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""views/{PagePath}/{TableNameLower}/index.vue"", - ""Describe"": ""(WEB)前端页面"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000111 - }, - { - ""Name"": ""web_views_List.vue.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""views/{PagePath}/{TableNameLower}/component/list.vue"", - ""Describe"": ""(WEB)表格组件"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 21:25:43"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000121 - }, - { - ""Name"": ""web_views_editDialog.vue.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""views/{PagePath}/{TableNameLower}/component/edit.vue"", - ""Describe"": ""(WEB)编辑对话框"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000131 - }, - { - ""Name"": ""service_Service.cs.vm"", - ""Type"": 2, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""Service/{TableName}/{TableName}Service.cs"", - ""Describe"": ""(服务端)接口服务"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000141 - }, - { - ""Name"": ""service_InputDto.cs.vm"", - ""Type"": 2, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""Service/{TableName}/Dto/{TableName}Input.cs"", - ""Describe"": ""(服务端)输入参数"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000151 - }, - { - ""Name"": ""service_OutputDto.cs.vm"", - ""Type"": 2, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""Service/{TableName}/Dto/{TableName}Output.cs"", - ""Describe"": ""(服务端)输出参数"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000161 - }, - { - ""Name"": ""sys_menu_seed_data.cs.vm"", - ""Type"": 3, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""SeedData/{TableName}MenuSeedData.cs"", - ""Describe"": ""(服务端)菜单种子数据"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000171 - }, - { - ""Name"": ""web_views_el_table_index.vue.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": false, - ""OutputFile"": ""views/{PagePath}/{TableNameLower}/index.vue"", - ""Describe"": ""(WEB)前端页面,基于el-table(和默认的vxetable互斥)"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000181 - }, - { - ""Name"": ""PartialEntity_Entity.cs.vm"", - ""Type"": 2, - ""SysFlag"": 1, - ""IsDefault"": false, - ""OutputFile"": ""PartialEntity/{TableName}Entity.cs"", - ""Describe"": ""(实体扩展)Partial实体"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 21:25:43"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000191 - }, - { - ""Name"": ""PartialService_Service.cs.vm"", - ""Type"": 2, - ""SysFlag"": 1, - ""IsDefault"": false, - ""OutputFile"": ""PartialService/{TableName}/{TableName}Service.cs"", - ""Describe"": ""(服务扩展)Partial服务"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 21:25:43"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000201 - }, - { - ""Name"": ""web_views_Tree.vue.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": false, - ""OutputFile"": ""views/{PagePath}/{TableNameLower}/component/{TableNameLower}Tree.vue"", - ""Describe"": ""(WEB)左边树型组件"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 21:25:43"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000211 - }, - { - ""Name"": ""service_Mid.cs.vm"", - ""Type"": 2, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""Service/{TableName}/Dto/{TableName}Mid.cs"", - ""Describe"": ""(服务端)中间件"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 21:25:43"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000215 - }, - { - ""Name"": ""web_views_language.ts.vm"", - ""Type"": 1, - ""SysFlag"": 1, - ""IsDefault"": true, - ""OutputFile"": ""i18n/pages/{TableNameLower}/zh-CN.ts"", - ""Describe"": ""(WEB)多语言模板,默认数据库中文备注,其他语言自己用AI替换"", - ""OrderNo"": 100, - ""CreateTime"": ""1900-01-01 00:00:00"", - ""UpdateTime"": ""2025-01-13 23:02:29"", - ""CreateUserId"": null, - ""CreateUserName"": null, - ""UpdateUserId"": null, - ""UpdateUserName"": null, - ""IsDelete"": false, - ""Id"": 1300000000216 - }, - ] - "; - var records = JSON.Deserialize>(recordList); - return records; - } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/CustomViewEngine.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/CustomViewEngine.cs deleted file mode 100644 index 04831591..00000000 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/CustomViewEngine.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.Service; - -/// -/// 自定义模板引擎 -/// -public class CustomViewEngine : ViewEngineModel -{ - private readonly ISqlSugarClient _db; - - public CustomViewEngine() - { - } - - public CustomViewEngine(ISqlSugarClient db) - { - _db = db; - } - - /// - /// 库定位器 - /// - public string ConfigId { get; set; } = SqlSugarConst.MainConfigId; - - public string AuthorName { get; set; } - - public string BusName { get; set; } - - public string NameSpace { get; set; } - - public string ClassName { get; set; } - - public string ProjectLastName { get; set; } - - public string LowerClassName - { - get - { - return ClassName[..1].ToLower() + ClassName[1..]; // 首字母小写 - } - } - - public string? TreeName { get; set; } - public string? TreeKey { get; set; } - public string? LowerTreeName { get; set; } - public string? LeftTab { get; set; } - public string? LowerLeftTab { get; set; } - public string? LeftKey { get; set; } - public string? LeftPrimaryKey { get; set; } - public string? LowerLeftKey { get; set; } - public string? LowerLeftPrimaryKey { get; set; } - public string? LeftName { get; set; } - public string? BottomTab { get; set; } - public string? LowerBottomTab { get; set; } - public string? BottomKey { get; set; } - public string? BottomPrimaryKey { get; set; } - public string? LowerBottomKey { get; set; } - public string? LowerBottomPrimaryKey { get; set; } - public string TabType { get; set; } - public string PagePath { get; set; } = "main"; - - public bool IsJoinTable { get; set; } - - public bool IsUpload { get; set; } - - public string PrintType { get; set; } - - public string PrintName { get; set; } - - public bool IsApiService { get; set; } - - /// - /// 远程验证 - /// - public bool RemoteVerify { get; set; } - - public List QueryWhetherList { get; set; } - - public List TableField { get; set; } - - private List ColumnList { get; set; } - - public List TableUniqueConfigList { get; set; } - - public string GetColumnNetType(object tbName, object colName) - { - if (tbName == null || colName == null) return null; - - var config = App.GetOptions().ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId); - ColumnList = GetColumnListByTableName(tbName.ToString()); - var col = ColumnList.Where(c => (config.DbSettings.EnableUnderLine - ? CodeGenHelper.CamelColumnName(c.ColumnName, []) - : c.ColumnName) == colName.ToString()).FirstOrDefault(); - return col.NetType; - } - - public List GetColumnListByTableName(string tableName) - { - // 多库代码生成切换库 - var provider = _db.AsTenant().GetConnectionScope(ConfigId != SqlSugarConst.MainConfigId ? ConfigId : SqlSugarConst.MainConfigId); - - // 获取实体类型属性 - var entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName); - - // 因为ConfigId的表通常也会用到主库的表来做连接,所以这里如果在ConfigId中找不到实体也尝试一下在主库中查找 - if (ConfigId == SqlSugarConst.MainConfigId && entityType == null) return null; - if (ConfigId != SqlSugarConst.MainConfigId) - { - provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId); - entityType = provider.DbMaintenance.GetTableInfoList().FirstOrDefault(u => u.Name == tableName); - if (entityType == null) return null; - } - - // 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null) - return provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput - { - ColumnName = u.DbColumnName, - ColumnKey = u.IsPrimarykey.ToString(), - DataType = u.DataType.ToString(), - NetType = CodeGenHelper.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), - ColumnComment = u.ColumnDescription - }).ToList(); - } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs deleted file mode 100644 index d2549281..00000000 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenConfig.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.Service; - -/// -/// 代码生成详细配置参数 -/// -public class CodeGenConfig -{ - /// - /// 主键Id - /// - public long Id { get; set; } - - /// - /// 代码生成主表ID - /// - public long CodeGenId { get; set; } - - /// - /// 数据库字段名 - /// - public string ColumnName { get; set; } - - /// - /// 实体属性名 - /// - public string PropertyName { get; set; } - - /// - /// 字段数据长度 - /// - public int ColumnLength { get; set; } - - /// - /// 数据库字段名(首字母小写) - /// - public string LowerPropertyName => string.IsNullOrWhiteSpace(PropertyName) ? null : PropertyName[..1].ToLower() + PropertyName[1..]; - - /// - /// 字段描述 - /// - public string ColumnComment { get; set; } - - /// - /// .NET类型 - /// - public string NetType { get; set; } - - /// - /// 作用类型(字典) - /// - public string EffectType { get; set; } - - /// - /// 外键库标识 - /// - public string FkConfigId { get; set; } - - /// - /// 外键实体名称 - /// - public string FkEntityName { get; set; } - - /// - /// 外键表名称 - /// - public string FkTableName { get; set; } - - /// - /// 外键实体名称(首字母小写) - /// - public string LowerFkEntityName => - string.IsNullOrWhiteSpace(FkEntityName) ? null : FkEntityName[..1].ToLower() + FkEntityName[1..]; - - /// - /// 外键显示字段 - /// - public string FkColumnName { get; set; } - - /// - /// 外键链接字段 - /// - public string FkLinkColumnName { get; set; } - - /// - /// 外键显示字段(首字母小写) - /// - public string LowerFkColumnName => - string.IsNullOrWhiteSpace(FkColumnName) ? null : FkColumnName[..1].ToLower() + FkColumnName[1..]; - - /// - /// 外键显示字段.NET类型 - /// - public string FkColumnNetType { get; set; } - - /// - /// 字典code - /// - public string DictTypeCode { get; set; } - - /// - /// 列表是否缩进(字典) - /// - public string WhetherRetract { get; set; } - - /// - /// 是否必填(字典) - /// - public string WhetherRequired { get; set; } - - /// - /// 是否可排序(字典) - /// - public string WhetherSortable { get; set; } - - /// - /// 是否是统计字段 - /// - public string Statistical { get; set; } - - /// - /// 是否是GroupBy字段 - /// - public string? IsGroupBy { get; set; } - - /// - /// 是否是查询条件 - /// - public string QueryWhether { get; set; } - - /// - /// 查询方式 - /// - public string QueryType { get; set; } - - /// - /// 列表显示 - /// - public string WhetherTable { get; set; } - - /// - /// 增改 - /// - public string WhetherAddUpdate { get; set; } - - /// - /// 主外键 - /// - public string ColumnKey { get; set; } - - /// - /// 数据库中类型(物理类型) - /// - public string DataType { get; set; } - - /// - /// 是否是通用字段 - /// - public string WhetherCommon { get; set; } - - /// - /// 表的别名 Table as XXX - /// - public string TableNickName - { - get - { - string str = ""; - if (EffectType == "ForeignKey") - { - str = LowerFkEntityName + "_FK_" + LowerFkColumnName; - } - else if (EffectType == "Upload") - { - str = "sysFile_FK_" + LowerPropertyName; - } - return str; - } - } - - /// - /// 显示文本字段 - /// - public string DisplayColumn { get; set; } - - /// - /// 选中值字段 - /// - public string ValueColumn { get; set; } - - /// - /// 父级字段 - /// - public string PidColumn { get; set; } - - /// - /// 排序 - /// - public int OrderNo { get; set; } - - /// - /// 字段验证规则 - /// - public string Rules { get; set; } - - /// - /// 默认值 - /// - public string? DefaultValue { get; set; } - - #region 不在数据库中的字段 - - /// - /// 字段验证集合 - /// - public List? RuleItems { get; set; } - - /// - /// 是否远程验证 - /// - public bool RemoteVerify { get; set; } = false; - - /// - /// 是否存在验证规则 - /// - public bool AnyRule { get; set; } = false; - - /// - /// 验证触发器 - /// - public string Trigger { get; set; } - - #endregion 不在数据库中的字段 -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenInput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenInput.cs index 1a1d4f7f..0b75d424 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenInput.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenInput.cs @@ -4,7 +4,7 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core.Service; +namespace Admin.NET.Core; /// /// 代码生成参数类 @@ -12,129 +12,32 @@ namespace Admin.NET.Core.Service; public class PageCodeGenInput : BasePageInput { /// - /// 作者姓名 + /// 业务名 /// - public virtual string AuthorName { get; set; } + public string BusName { get; set; } /// - /// 类名 + /// 表名 /// - public virtual string ClassName { get; set; } - - /// - /// 是否移除表前缀 - /// - public virtual string TablePrefix { get; set; } - - /// - /// 库定位器名 - /// - public virtual string ConfigId { get; set; } - - /// - /// 数据库名(保留字段) - /// - public virtual string DbName { get; set; } - - /// - /// 数据库类型 - /// - public virtual string DbType { get; set; } - - /// - /// 数据库链接 - /// - public virtual string ConnectionString { get; set; } + public string TableName { get; set; } +} +/// +/// 代码生成参数类 +/// +public class AddCodeGenInput : SysCodeGen +{ /// /// 生成方式 /// - public virtual string GenerateType { get; set; } + [Dict(nameof(CodeGenMethodEnum))] + public override CodeGenMethodEnum GenerateMethod { get; set; } /// - /// 数据库表名 + /// 生成场景 /// - public virtual string TableName { get; set; } - - /// - /// 树控件名称 - /// - public string? TreeName { get; set; } - - /// - /// 树控件key - /// - public string? TreeKey { get; set; } - - /// - /// 命名空间 - /// - public virtual string NameSpace { get; set; } - - /// - /// 业务名(业务代码包名称) - /// - public virtual string BusName { get; set; } - - /// - /// 功能名(数据库表名称) - /// - public virtual string TableComment { get; set; } - - /// - /// 菜单应用分类(应用编码) - /// - public virtual string MenuApplication { get; set; } - - /// - /// 是否生成菜单 - /// - public virtual bool GenerateMenu { get; set; } - - /// - /// 菜单父级 - /// - public virtual long? MenuPid { get; set; } - - /// - /// 菜单图标 - /// - public virtual string MenuIcon { get; set; } - - /// - /// 页面目录 - /// - public virtual string PagePath { get; set; } - - /// - /// 支持打印类型 - /// - public virtual string PrintType { get; set; } - - /// - /// 打印模版名称 - /// - public virtual string PrintName { get; set; } - - /// - /// 是否使用 Api Service - /// - public virtual bool IsApiService { get; set; } -} - -public class AddCodeGenInput : PageCodeGenInput -{ - /// - /// 数据库表名 - /// - [Required(ErrorMessage = "数据库表名不能为空")] - public override string TableName { get; set; } - - /// - /// 业务名(业务代码包名称) - /// - [Required(ErrorMessage = "业务名不能为空")] - public override string BusName { get; set; } + [Dict(nameof(CodeGenSceneEnum))] + public override CodeGenSceneEnum Scene { get; set; } /// /// 命名空间 @@ -143,104 +46,145 @@ public class AddCodeGenInput : PageCodeGenInput public override string NameSpace { get; set; } /// - /// 作者姓名 + /// 业务名 /// - [Required(ErrorMessage = "作者姓名不能为空")] - public override string AuthorName { get; set; } - - ///// - ///// 类名 - ///// - //[Required(ErrorMessage = "类名不能为空")] - //public override string ClassName { get; set; } - - ///// - ///// 是否移除表前缀 - ///// - //[Required(ErrorMessage = "是否移除表前缀不能为空")] - //public override string TablePrefix { get; set; } + [Required(ErrorMessage = "业务名不能为空")] + public override string BusName { get; set; } /// - /// 生成方式 + /// 关联表 /// - [Required(ErrorMessage = "生成方式不能为空")] - public override string GenerateType { get; set; } - - ///// - ///// 功能名(数据库表名称) - ///// - //[Required(ErrorMessage = "数据库表名不能为空")] - //public override string TableComment { get; set; } + [Required(ErrorMessage = "关联表列表不能为空")] + public new List TableList { get; set; } = new(); /// - /// 是否生成菜单 + /// 页面目录 /// - [Required(ErrorMessage = "是否生成菜单不能为空")] - public override bool GenerateMenu { get; set; } + [Required(ErrorMessage = "页面目录不能为空")] + public override string PagePath { get; set; } /// - /// 是否使用 Api Service + /// 支持打印类型 /// - public override bool IsApiService { get; set; } + [Dict(nameof(CodeGenPrintTypeEnum))] + public override CodeGenPrintTypeEnum PrintType { get; set; } /// - /// 模板Id集合 + /// 页面目录 /// - public List CodeGenTemplateIds { get; set; } + public new EffectTreeConfigInput TreeConfig { get; set; } +} + +/// +/// 添加关联表 +/// +public class AddSysCodeGenTable : SysCodeGenTable +{ + /// + /// 代码生成Id + /// + [Required(ErrorMessage = "代码生成Id不能为空")] + public override long CodeGenId { get; set; } /// - /// 左边树形结构表 + /// 数据库配置id /// - public string? LeftTab { get; set; } + [Required(ErrorMessage = "数据库配置id不能为空")] + public override string ConfigId { get; set; } /// - /// 左边关联字段 + /// 数据库表名 /// - public string? LeftKey { get; set; } + [Required(ErrorMessage = "数据库表名不能为空")] + public override string TableName { get; set; } /// - /// 左边关联主表字段 + /// 表实体名称 /// - public string? LeftPrimaryKey { get; set; } + [Required(ErrorMessage = "表实体名称不能为空")] + public override string EntityName { get; set; } /// - /// 左边树Name + /// 模块名称 /// - public string? LeftName { get; set; } + [Required(ErrorMessage = "模块名称不能为空")] + public override string ModuleName { get; set; } /// - /// 下表名称 + /// 业务名称 /// - public string? BottomTab { get; set; } + [Required(ErrorMessage = "业务名称不能为空")] + public override string BusName { get; set; } /// - /// 下表关联字段 + /// 字段列表 /// - public string? BottomKey { get; set; } + [Required(ErrorMessage = "字段列表不能为空")] + public new List ColumnList { get; set; } +} + +/// +/// 增加表字段输入参数 +/// +public class AddSysCodeGenColumn : SysCodeGenColumn +{ + /// + /// 代码生成表Id + /// + [Required(ErrorMessage = "代码生成表Id不能为空")] + public override long CodeGenTableId { get; set; } /// - /// 下表关联主表字段 + /// 数据库字段名 /// - public string? BottomPrimaryKey { get; set; } + [Required(ErrorMessage = "数据库字段名不能为空")] + public override string ColumnName { get; set; } /// - /// 模板 + /// 实体属性名 /// - public string? Template { get; set; } + [Required(ErrorMessage = "实体属性名不能为空")] + public override string PropertyName { get; set; } /// - /// 表类型 + /// .NET数据类型 /// - public string TabType { get; set; } + [Required(ErrorMessage = ".NET数据类型不能为空")] + public override string NetType { get; set; } + + /// + /// 数据库中类型(物理类型) + /// + [Required(ErrorMessage = "数据库中类型不能为空")] + public override string DataType { get; set; } + + /// + /// 字段描述 + /// + [Required(ErrorMessage = "字段描述不能为空")] + public override string ColumnComment { get; set; } + + /// + /// 控件类型 + /// + [Dict(nameof(CodeGenEffectTypeEnum))] + public override CodeGenEffectTypeEnum EffectType { get; set; } + + /// + /// 字段验证规则 + /// + [Dict(nameof(CodeGenFromRuleValidEnum))] + public override CodeGenFromRuleValidEnum? FromValid { get; set; } } public class DeleteCodeGenInput { /// - /// 代码生成器Id + /// Id列表 /// - [Required(ErrorMessage = "代码生成器Id不能为空")] - public long Id { get; set; } + [NotEmpty(ErrorMessage = "Id列表不能为空")] + [Required(ErrorMessage = "Id列表不能为空")] + public List Id { get; set; } } public class UpdateCodeGenInput : AddCodeGenInput @@ -249,9 +193,22 @@ public class UpdateCodeGenInput : AddCodeGenInput /// 代码生成器Id /// [Required(ErrorMessage = "代码生成器Id不能为空")] - public long Id { get; set; } + public override long Id { get; set; } } -public class QueryCodeGenInput : DeleteCodeGenInput +/// +/// 获取默认列配置输入参数 +/// +public class DefaultColumnConfigInput { + /// + /// 数据库配置id + /// + public string ConfigId { get; set; } = SqlSugarConst.MainConfigId; + + /// + /// 数据库表名 + /// + [Required(ErrorMessage = "数据库表名不能为空")] + public string TableName { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenOutput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenOutput.cs deleted file mode 100644 index 52795a29..00000000 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/CodeGenOutput.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.Service; - -/// -/// 代码生成参数类 -/// -public class CodeGenOutput -{ - /// - /// 代码生成器Id - /// - public long Id { get; set; } - - /// - /// 作者姓名 - /// - public string AuthorName { get; set; } - - /// - /// 类名 - /// - public string ClassName { get; set; } - - /// - /// 是否移除表前缀 - /// - public string TablePrefix { get; set; } - - /// - /// 生成方式 - /// - public string GenerateType { get; set; } - - /// - /// 数据库表名 - /// - public string TableName { get; set; } - - /// - /// 表类型 - /// - public string TabType { get; set; } - - /// - /// 包名 - /// - public string PackageName { get; set; } - - /// - /// 业务名(业务代码包名称) - /// - public string BusName { get; set; } - - /// - /// 功能名(数据库表名称) - /// - public string TableComment { get; set; } - - /// - /// 菜单应用分类(应用编码) - /// - public string MenuApplication { get; set; } - - /// - /// 是否生成菜单 - /// - public bool GenerateMenu { get; set; } - - /// - /// 树控件名称 - /// - public string? TreeName { get; set; } - - /// - /// 树控件key - /// - public string? TreeKey { get; set; } - - /// - /// 菜单父级 - /// - public long? MenuPid { get; set; } - - /// - /// 支持打印类型 - /// - public string PrintType { get; set; } - - /// - /// 打印模版名称 - /// - public string PrintName { get; set; } - - /// - /// 是否使用 Api Service - /// - public bool IsApiService { get; set; } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/ColumnOuput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/ColumnOutput.cs similarity index 64% rename from Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/ColumnOuput.cs rename to Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/ColumnOutput.cs index 1b5894bb..185049c8 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/ColumnOuput.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/ColumnOutput.cs @@ -4,23 +4,42 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core.Service; +namespace Admin.NET.Core; /// /// 数据库表列 /// -public class ColumnOuput +public class ColumnOutput { /// - /// 字段名 + /// 属性信息 /// - public string ColumnName { get; set; } + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public PropertyInfo PropertyInfo { get; set; } /// /// 实体的Property名 /// public string PropertyName { get; set; } + /// + /// .NET字段类型 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public Type PropertyType { get; set; } + + /// + /// .NET字段类型 + /// + public string NetType { get; set; } + + /// + /// 字段名 + /// + public string ColumnName { get; set; } + /// /// 字段数据长度 /// @@ -36,28 +55,37 @@ public class ColumnOuput /// public bool IsPrimarykey { get; set; } + /// + /// 是否为外键 + /// + public bool IsForeignKey { get; set; } + /// /// 是否允许为空 /// public bool IsNullable { get; set; } - /// - /// .NET字段类型 - /// - public string NetType { get; set; } - /// /// 字段描述 /// public string ColumnComment { get; set; } - /// - /// 主外键 - /// - public string ColumnKey { get; set; } - /// /// 默认值 /// public string DefaultValue { get; set; } + + /// + /// 外键属性信息 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public PropertyInfo ForeignProperty { get; set; } + + /// + /// 外键表实体类型 + /// + [Newtonsoft.Json.JsonIgnore] + [System.Text.Json.Serialization.JsonIgnore] + public Type ForeignEntityType { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/DatabaseOutput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/DatabaseOutput.cs index 5f6d81c3..a43ee3bd 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/DatabaseOutput.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/DatabaseOutput.cs @@ -4,7 +4,7 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core.Service; +namespace Admin.NET.Core; /// /// 数据库 diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/EffectConfigInput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/EffectConfigInput.cs new file mode 100644 index 00000000..b1f73b45 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/EffectConfigInput.cs @@ -0,0 +1,188 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 外键控件配置信息类 +/// +public class EffectForeignKeyConfigInput +{ + /// + /// 外键库标识 + /// + [Required(ErrorMessage = "外键库标识不能为空")] + public virtual string ConfigId { get; set; } + + /// + /// 外键实体名称 + /// + [Required(ErrorMessage = "外键实体名称不能为空")] + public virtual string EntityName { get; set; } + + /// + /// 首字母小写实体名称 + /// + [System.Text.Json.Serialization.JsonIgnore] + public virtual string LowerEntityName => EntityName?[..1].ToLower() + EntityName?[1..]; + + /// + /// 外键表名称 + /// + [Required(ErrorMessage = "外键表名称不能为空")] + public virtual string TableName { get; set; } + + /// + /// 表注释 + /// + [Required(ErrorMessage = "表注释不能为空")] + public virtual string TableComment { get; set; } + + /// + /// 外键显示属性名(多选) + /// + [Required(ErrorMessage = "外键显示属性名不能为空")] + public virtual string DisplayPropertyNames { get; set; } + + /// + /// 首位外键显示属性名 + /// + [System.Text.Json.Serialization.JsonIgnore] + public virtual string FirstDisplayName => DisplayPropertyNames?.Split(",").First(); + + /// + /// 首字母小写首位外键显示属性名 + /// + [System.Text.Json.Serialization.JsonIgnore] + public virtual string LowerFirstDisplayName + { + get + { + var displayName = FirstDisplayName; + return displayName?[..1].ToLower() + displayName?[1..]; + } + } + + /// + /// 外键属性名 + /// + [Required(ErrorMessage = "外键属性名不能为空")] + public virtual string LinkPropertyName { get; set; } + + /// + /// 首字母小写外键属性名 + /// + [System.Text.Json.Serialization.JsonIgnore] + public virtual string LowerLinkPropertyName => LinkPropertyName?[..1].ToLower() + LinkPropertyName?[1..]; + + /// + /// 外键显示属性.NET类型 + /// + [Required(ErrorMessage = "外键显示属性.NET类型")] + public virtual string LinkPropertyType { get; set; } + + /// + /// 用于检索的属性名 + /// + public virtual string SearchPropertyName { get; set; } + + /// + /// 首字母小写外键属性名 + /// + [System.Text.Json.Serialization.JsonIgnore] + public virtual string LowerSearchPropertyName => SearchPropertyName?[..1].ToLower() + SearchPropertyName?[1..]; + + /// + /// 用于检索的属性.NET类型 + /// + public virtual string SearchPropertyType { get; set; } + + /// + /// 是否使用表格 + /// + public virtual bool UseTable { get; set; } + + /// + /// 是否多选 + /// + public virtual bool Multiple { get; set; } +} + +/// +/// 树控件配置信息类 +/// +public class EffectTreeConfigInput : EffectForeignKeyConfigInput +{ + /// + /// 树组件标题不能为空 + /// + public virtual string TreeTitle { get; set; } + + /// + /// 父属性名称 + /// + public virtual string ParentPropertyName { get; set; } + + /// + /// 父属性.NET类型 + /// + public virtual string ParentPropertyType { get; set; } +} + +/// +/// 字典控件配置信息类 +/// +public class EffectDictConfigInput +{ + /// + /// 字典编码 + /// + [Required(ErrorMessage = "字典编码不能为空")] + public virtual string Code { get; set; } + + /// + /// 是否多选 + /// + public virtual bool Multiple { get; set; } +} + +/// +/// 文件控件配置信息类 +/// +public class EffectFileConfigInput +{ + /// + /// 链接预览 + /// + public virtual bool UseDownload { get; set; } + + /// + /// 链接文本 + /// + public virtual string DownloadText { get; set; } + + /// + /// 是否图片 + /// + public virtual bool IsImage { get; set; } +} + +/// +/// 时间控件配置信息类 +/// +public class EffectDatePickerConfigInput +{ + /// + /// 格式 + /// + [Required(ErrorMessage = "时间控件格式不能为空")] + public virtual string Format { get; set; } = "datetime"; + + /// + /// 默认值 + /// + public virtual string Default { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableOutput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableOutput.cs index fb053e64..55d2e64a 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableOutput.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TableOutput.cs @@ -4,7 +4,7 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! -namespace Admin.NET.Core.Service; +namespace Admin.NET.Core; /// /// 数据库表 @@ -42,12 +42,12 @@ public class TableOutput public string TableComment { get; set; } /// - /// 表字段个数 + /// 字段个数 /// public int ColumnCount { get; set; } /// - /// 程序集名称 + /// 所属程序集名称 /// public string AssemblyName { get; set; } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TemplateConfigInput.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TemplateConfigInput.cs new file mode 100644 index 00000000..84ce3012 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/Dto/TemplateConfigInput.cs @@ -0,0 +1,60 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +namespace Admin.NET.Core; + +/// +/// 单表带树组件模板配置输入参数 +/// +public class TreeWithTableConfigInput : EffectTreeConfigInput +{ + /// + /// 树标题 + /// + [Required(ErrorMessage = "树标题不能为空")] + public override string TreeTitle { get; set; } +} + +/// +/// 多表模板配置输入参数 +/// +public class MoreTableConfigInput +{ + /// + /// 是否水平布局 + /// + public bool IsHorizontal { get; set; } +} + +/// +/// 对照表扩展配置输入参数 +/// +public class TableRelationshipConfigInput : MoreTableConfigInput +{ + /// + /// 目标表数据库配置id + /// + [Required(ErrorMessage = "目标表数据库配置id不能为空")] + public string ConfigId { get; set; } + + /// + /// 目标表数据库表名 + /// + [Required(ErrorMessage = "目标表数据库表名不能为空")] + public string TableName { get; set; } + + /// + /// 对照表1链接字段名 + /// + [Required(ErrorMessage = "对照表1链接字段名不能为空")] + public string PropertyName1 { get; set; } + + /// + /// 对照表2链接字段名 + /// + [Required(ErrorMessage = "对照表2链接字段名不能为空")] + public string PropertyName2 { get; set; } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenColumnService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenColumnService.cs new file mode 100644 index 00000000..41825976 --- /dev/null +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenColumnService.cs @@ -0,0 +1,473 @@ +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using Admin.NET.Core.CodeGen; +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Admin.NET.Core; + +/// +/// 代码生成表字段配置 🧩 +/// +[ApiDescriptionSettings(Order = 260, Description = "代码生成表字段配置")] +public class SysCodeGenColumnService : IDynamicApiController, ITransient +{ + private readonly ISqlSugarClient _db; + private readonly CodeGenOptions _codeGenOptions; + private readonly DbConnectionOptions _dbConnectionOptions; + + public SysCodeGenColumnService(ISqlSugarClient db, + IOptions dbConnectionOptions, + IOptions codeGenOptions) + { + _db = db; + _dbConnectionOptions = dbConnectionOptions.Value; + _codeGenOptions = codeGenOptions.Value; + } + + /// + /// 获取数据表列(实体属性)集合 + /// + /// + [NonAction] + public async Task> GetColumnList([FromQuery] BaseIdInput input) + { + var genTable = await _db.Queryable().FirstAsync(u => u.Id == input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002); + + var entityType = GetEntityInfos().ConfigureAwait(false).GetAwaiter().GetResult().FirstOrDefault(u => u.EntityName == genTable.EntityName); + if (entityType == null) return null; + + var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == genTable.ConfigId); + var dbTableName = genTable.TableName; + + int bracketIndex = dbTableName.IndexOf('{'); + if (bracketIndex != -1) + { + dbTableName = dbTableName[..bracketIndex]; + var dbTableInfos = _db.AsTenant().GetConnectionScope(genTable.ConfigId).DbMaintenance.GetTableInfoList(false); + var table = dbTableInfos.FirstOrDefault(u => u.Name.StartsWith(config!.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName, StringComparison.CurrentCultureIgnoreCase)); + if (table != null) dbTableName = table.Name; + } + + // 切库---多库代码生成用 + var provider = _db.AsTenant().GetConnectionScope(!string.IsNullOrEmpty(genTable.ConfigId) ? genTable.ConfigId : SqlSugarConst.MainConfigId); + + var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenantBaseData)]; + var columnInfos = provider.DbMaintenance.GetColumnInfosByTableName(dbTableName, false); + var result = columnInfos.Select(u => new ColumnOutput + { + ColumnName = u.DbColumnName, + ColumnLength = u.Length, + IsPrimarykey = u.IsPrimarykey, + IsNullable = u.IsNullable, + DataType = u.DataType, + NetType = CodeGenHelper.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), + ColumnComment = string.IsNullOrWhiteSpace(u.ColumnDescription) ? u.DbColumnName : u.ColumnDescription, + DefaultValue = u.DefaultValue, + }).ToList(); + + // 获取实体的属性信息,赋值给PropertyName属性(CodeFirst模式应以PropertyName为实际使用名称) + var entityProperties = entityType.Type.GetProperties(); + for (int i = result.Count - 1; i >= 0; i--) + { + var columnOutput = result[i]; + // 先找自定义字段名的,如果找不到就再找自动生成字段名的(并且过滤掉没有SugarColumn的属性) + var propertyInfo = entityProperties.FirstOrDefault(u => string.Equals((u.GetCustomAttribute()?.ColumnName ?? ""), columnOutput.ColumnName, StringComparison.CurrentCultureIgnoreCase)) ?? + entityProperties.FirstOrDefault(u => u.GetCustomAttribute() != null && u.Name.Equals(config!.DbSettings.EnableUnderLine + ? CodeGenHelper.CamelColumnName(columnOutput.ColumnName, entityBasePropertyNames).ToLower() + : columnOutput.ColumnName.ToLower(), StringComparison.CurrentCultureIgnoreCase)); + if (propertyInfo != null) + { + columnOutput.PropertyName = propertyInfo.Name; + columnOutput.ColumnComment = propertyInfo.GetCustomAttribute()!.ColumnDescription; + } + else + { + result.RemoveAt(i); // 移除没有定义此属性的字段 + } + } + return result; + } + + /// + /// 获取库表信息 + /// + /// 是否排除带SysTable属性的表 + /// + public async Task> GetEntityInfos(bool excludeSysTable = false) + { + var types = new List(); + if (_codeGenOptions.EntityAssemblyNames != null) + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + foreach (var assembly in assemblies) + { + var assemblyName = assembly.GetName().Name!; + if (_codeGenOptions.EntityAssemblyNames.Contains(assemblyName) || _codeGenOptions.EntityAssemblyNames.Any(name => assemblyName.Contains(name))) + { + Assembly asm = Assembly.Load(assemblyName); + types.AddRange(asm.GetExportedTypes().ToList()); + } + } + } + var sugarTableType = typeof(SugarTable); + bool IsMyAttribute(Attribute[] o) + { + foreach (Attribute a in o) + { + if (a.GetType() == sugarTableType) + return true; + } + return false; + } + Type[] cosType = types.Where(u => IsMyAttribute(Attribute.GetCustomAttributes(u, false))).ToArray(); + + var entityInfos = new List(); + foreach (var ct in cosType) + { + // 若实体贴[SysTable]特性,则禁止显示系统自带的 + if (excludeSysTable && ct.IsDefined(typeof(SysTableAttribute), false)) continue; + + var des = ct.GetCustomAttributes(typeof(DescriptionAttribute), false); + var description = des.Length > 0 ? ((DescriptionAttribute)des[0]).Description : ""; + var sugarAttribute = ct.GetCustomAttributes(sugarTableType, true).FirstOrDefault(); + + entityInfos.Add(new EntityInfo() + { + EntityName = ct.Name, + DbTableName = sugarAttribute == null ? ct.Name : ((SugarTable)sugarAttribute).TableName, + TableDescription = sugarAttribute == null ? description : ((SugarTable)sugarAttribute).TableDescription, + Type = ct + }); + } + return await Task.FromResult(entityInfos); + } + + /// + /// 获取代码生成配置列表 🔖 + /// + /// + /// + [DisplayName("获取代码生成配置列表")] + public async Task> GetList([FromQuery] BaseIdInput input) + { + // 获取主表 + var codeGenTable = await _db.Queryable().FirstAsync(u => u.Id == input.Id); + + // 获取配置的字段 + var genConfigColumnList = await _db.Queryable().Where(u => u.CodeGenTableId == input.Id).ToListAsync(); + + // 获取实体所有字段 + var tableColumnList = await GetColumnList(new BaseIdInput { Id = input.Id }); + + // 获取新增的字段 + var addColumnList = tableColumnList.Where(u => !genConfigColumnList.Select(d => d.ColumnName).Contains(u.ColumnName)).ToList(); + + // 获取删除的字段 + var delColumnList = genConfigColumnList.Where(u => !tableColumnList.Select(d => d.ColumnName).Contains(u.ColumnName)).ToList(); + + // 获取更新的字段 + var updateColumnList = new List(); + foreach (var column in genConfigColumnList) + { + // 获取没有增减的 + if (tableColumnList.Any(u => u.ColumnName == column.ColumnName)) + { + var nmd = tableColumnList.Single(u => u.ColumnName == column.ColumnName); + // 如果数据库类型或者长度改变 + if (nmd.NetType != column.NetType || nmd.ColumnLength != column.ColumnLength || nmd.ColumnComment != column.ColumnComment) + { + column.NetType = nmd.NetType; + column.ColumnLength = nmd.ColumnLength; + column.ColumnComment = nmd.ColumnComment; + updateColumnList.Add(column); + } + } + } + + // 增加新增的 + if (addColumnList.Count > 0) AddList(addColumnList, codeGenTable); + + // 删除没有的 + if (delColumnList.Count > 0) await _db.Deleteable(delColumnList).ExecuteCommandAsync(); + + // 更新配置 + if (updateColumnList.Count > 0) await _db.Updateable(updateColumnList).ExecuteCommandAsync(); + + // 重新获取配置 + return await _db.Queryable() + .Where(u => u.CodeGenTableId == input.Id) + .Select() + .OrderBy(u => new { u.OrderNo, u.Id }) + .ToListAsync(); + } + + /// + /// 更新代码生成配置 🔖 + /// + /// + /// + [ApiDescriptionSettings(Name = "Update"), HttpPost] + [DisplayName("更新代码生成配置")] + public async Task UpdateCodeGenConfig(List inputList) + { + if (inputList == null || inputList.Count < 1) return; + + await _db.Updateable(inputList) + .IgnoreColumns(u => new + { + u.CodeGenTableId, + u.ColumnLength, + u.ColumnName, + u.PropertyName, + u.IsPrimarykey, + u.IsCommon, + }) + .ExecuteCommandAsync(); + } + + /// + /// 删除代码生成配置 + /// + /// + /// + [NonAction] + public async Task DeleteCodeGenConfig(long tableId) + { + await _db.Deleteable().Where(u => u.CodeGenTableId == tableId).ExecuteCommandAsync(); + } + + /// + /// 获取代码生成配置详情 🔖 + /// + /// + /// + [DisplayName("获取代码生成配置详情")] + public async Task GetDetail([FromQuery] CodeGenColumnConfig input) + { + return await _db.Queryable().SingleAsync(u => u.Id == input.Id); + } + + /// + /// 获取默认列配置 + /// + /// + /// + [NonAction] + public List GetDefaultColumnConfigList(List tableColumnOutputList, long codeGenTableId) + { + if (tableColumnOutputList == null) return null; + var settings = new JsonSerializer { ContractResolver = new CamelCasePropertyNamesContractResolver() }; + + var orderNo = 1; + var columnConfigList = new List(); + foreach (var tableColumn in tableColumnOutputList) + { + if (codeGenTableId > 0 && _db.Queryable().Any(u => u.ColumnName == tableColumn.ColumnName && u.CodeGenTableId == codeGenTableId)) + continue; + + var columnConfig = new SysCodeGenColumn(); + var yesOrNo = !tableColumn.IsPrimarykey; + if (CodeGenHelper.IsCommonColumn(tableColumn.PropertyName)) + { + columnConfig.OrderNo = tableColumnOutputList.Count + orderNo; + columnConfig.IsCommon = true; + yesOrNo = false; + } + else + { + columnConfig.IsQuery = true; + columnConfig.IsCommon = false; + columnConfig.OrderNo = orderNo; + } + + columnConfig.NetType = tableColumn.NetType; + columnConfig.CodeGenTableId = codeGenTableId; + columnConfig.ColumnName = tableColumn.ColumnName; // 字段名 + columnConfig.PropertyName = tableColumn.PropertyName; // 实体属性名 + columnConfig.ColumnLength = tableColumn.ColumnLength; // 长度 + columnConfig.IsPrimarykey = tableColumn.IsPrimarykey; + columnConfig.ColumnComment = Regex.Replace(tableColumn.ColumnComment ?? "", @"(id|Id|ID)$", ""); + + // 是否必填验证 + columnConfig.IsQuery = yesOrNo; + columnConfig.IsTable = yesOrNo; + columnConfig.IsImport = yesOrNo; + columnConfig.IsSortable = yesOrNo; + columnConfig.IsAddUpdate = yesOrNo; + columnConfig.DataType = tableColumn.DataType; + columnConfig.QueryType = GetDefaultQueryType(columnConfig); + columnConfig.DefaultValue = GetDefaultValue(tableColumn.DefaultValue); + columnConfig.EffectType = CodeGenHelper.DataTypeToEff(columnConfig.NetType); + var propertyType = Nullable.GetUnderlyingType(tableColumn.PropertyType ?? typeof(object)) ?? tableColumn.PropertyType; + if (propertyType is { IsEnum: true }) // 枚举类型 + { + columnConfig.EffectType = CodeGenEffectTypeEnum.EnumSelector; + columnConfig.Config = new { Code = propertyType.Name }.ToJson(); + columnConfig.QueryType = "=="; + } + else if (tableColumn.PropertyInfo.IsDefined(typeof(DictAttribute), true)) // 字段特性 + { + var attribute = tableColumn.PropertyInfo.GetCustomAttribute(); + columnConfig.EffectType = CodeGenEffectTypeEnum.DictSelector; + columnConfig.Config = new { Code = attribute?.DictTypeCode }.ToJson(); + columnConfig.QueryType = "=="; + } + else if (tableColumn.PropertyInfo.IsDefined(typeof(ConstAttribute), true)) // 常量特性 + { + var attribute = tableColumn.PropertyInfo.GetCustomAttribute(); + columnConfig.EffectType = CodeGenEffectTypeEnum.DictSelector; + columnConfig.Config = new { Code = attribute?.Name }.ToJson(); + columnConfig.QueryType = "=="; + } + else + { + columnConfig.Config = null; + } + + if (columnConfig.EffectType == CodeGenEffectTypeEnum.DatePicker) + { + columnConfig.Config = new EffectDatePickerConfigInput { Format = "datetime" }.ToJson(); + } + + // 是否是外键 + if (tableColumn.IsForeignKey) + { + // 设置外键配置 + if (tableColumn.ForeignProperty != null) + { + var fkEntityInfo = _db.EntityMaintenance.GetEntityInfoNoCache(tableColumn.ForeignEntityType); + var fkConfigId = tableColumn.ForeignEntityType.GetCustomAttribute()?.configId as string ?? SqlSugarConst.MainConfigId; + var displayProperty = fkEntityInfo.Columns.FirstOrDefault(u => u.PropertyName.Contains("Name") && u.PropertyInfo.PropertyType.Name == "String"); + var pidProperty = fkEntityInfo.Columns.FirstOrDefault(u => u.PropertyName is "Pis" or "pid"); + columnConfig.EffectType = pidProperty != null ? CodeGenEffectTypeEnum.ApiTreeSelector : CodeGenEffectTypeEnum.ForeignKey; + columnConfig.Config = new EffectTreeConfigInput + { + ConfigId = fkConfigId, + LinkPropertyName = "Id", + LinkPropertyType = "long?", + EntityName = fkEntityInfo.EntityName, + TableName = fkEntityInfo.DbTableName, + TableComment = fkEntityInfo.TableDescription, + DisplayPropertyNames = displayProperty?.PropertyName, + ParentPropertyName = pidProperty?.PropertyName, + ParentPropertyType = pidProperty?.PropertyInfo.PropertyType.Name, + SearchPropertyName = displayProperty?.PropertyName, + SearchPropertyType = displayProperty?.PropertyInfo.PropertyType.Name, + }.ToJson(); + } + } + + columnConfig.IsRequired = columnConfig.IsRequired || columnConfig.IsPrimarykey || !tableColumn.IsNullable; + columnConfigList.Add(columnConfig); + orderNo += 1; // 每个配置排序间隔1 + } + return columnConfigList.OrderBy(u => u.OrderNo).ToList(); + } + + /// + /// 批量增加代码生成配置 + /// + /// + /// + [NonAction] + public void AddList(List tableColumnOutputList, SysCodeGenTable codeGenTable) + { + if (tableColumnOutputList == null) return; + + var columnConfigList = new List(); + var orderNo = 1; + foreach (var tableColumn in tableColumnOutputList) + { + if (_db.Queryable().Any(u => u.ColumnName == tableColumn.ColumnName && u.CodeGenTableId == codeGenTable.Id)) + continue; + + var columnConfig = new SysCodeGenColumn(); + + var yesOrNo = !(tableColumn.IsPrimarykey || tableColumn.IsForeignKey); + + if (CodeGenHelper.IsCommonColumn(tableColumn.PropertyName)) + { + columnConfig.IsCommon = true; + yesOrNo = false; + } + else + { + columnConfig.IsCommon = false; + } + + columnConfig.CodeGenTableId = codeGenTable.Id; + columnConfig.ColumnName = tableColumn.ColumnName; // 字段名 + columnConfig.PropertyName = tableColumn.PropertyName;// 实体属性名 + columnConfig.ColumnLength = tableColumn.ColumnLength;// 长度 + columnConfig.ColumnComment = tableColumn.ColumnComment; + columnConfig.NetType = tableColumn.NetType; + + // 是否必填验证 + columnConfig.IsQuery = false; + columnConfig.IsTable = yesOrNo; + columnConfig.IsAddUpdate = yesOrNo; + + columnConfig.DataType = tableColumn.DataType; + columnConfig.EffectType = CodeGenHelper.DataTypeToEff(columnConfig.NetType); + columnConfig.QueryType = GetDefaultQueryType(columnConfig); // QueryTypeEnum.eq.ToString(); + columnConfig.DefaultValue = GetDefaultValue(tableColumn.DefaultValue); + columnConfig.OrderNo = orderNo; + columnConfigList.Add(columnConfig); + + orderNo += 1; // 每个配置排序间隔1 + } + // 多库代码生成---这里要切回主库 + var provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId); + provider.Insertable(columnConfigList).ExecuteCommand(); + } + + /// + /// 默认查询类型 + /// + /// + /// + private static string GetDefaultQueryType(SysCodeGenColumn columnConfig) + { + return (columnConfig.NetType?.TrimEnd('?')) switch + { + "string" => "like", + "DateTime" => "~", + _ => "==", + }; + } + + /// + /// 获取默认值 + /// + /// + /// + private static string? GetDefaultValue(string dataValue) + { + if (dataValue == null) return null; + // 正则表达式模式 + // \( 和 \) 用来匹配字面量的括号 + // .+ 用来匹配一个或多个任意字符,但不包括换行符 + string pattern = @"\((.+)\)";//适合MSSQL其他数据库没有测试 + + // 使用 Regex 类进行匹配 + Match match = Regex.Match(dataValue, pattern); + + string value; + // 如果找到了匹配项 + if (match.Success) + { + // 提取括号内的值 + value = match.Groups[1].Value.Trim('\''); + } + else + { + value = dataValue; + } + return value; + } +} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs deleted file mode 100644 index d2eaf244..00000000 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenConfigService.cs +++ /dev/null @@ -1,365 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.Service; - -/// -/// 系统代码生成配置服务 🧩 -/// -[ApiDescriptionSettings(Order = 260, Description = "代码生成配置")] -public class SysCodeGenConfigService : IDynamicApiController, ITransient -{ - private readonly ISqlSugarClient _db; - private readonly CodeGenOptions _codeGenOptions; - private readonly DbConnectionOptions _dbConnectionOptions; - - public SysCodeGenConfigService(ISqlSugarClient db, - IOptions codeGenOptions, - IOptions dbConnectionOptions) - { - _db = db; - _codeGenOptions = codeGenOptions.Value; - _dbConnectionOptions = dbConnectionOptions.Value; - } - - /// - /// 获取数据表列(实体属性)集合 - /// - /// - [DisplayName("获取数据表列(实体属性)集合")] - public List GetColumnList([FromQuery] AddCodeGenInput input) - { - return GetColumnList(input.TableName, input.ConfigId); - } - - /// - /// 获取数据表列(实体属性)集合 - /// - /// - /// - /// - [DisplayName("获取数据表列(实体属性)集合")] - public List GetColumnList(string EntityName, string ConfigId) - { - var entityType = GetEntityInfos().GetAwaiter().GetResult().FirstOrDefault(u => u.EntityName == EntityName); - if (entityType == null) return null; - - var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == ConfigId); - var dbTableName = config!.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(entityType.DbTableName) : entityType.DbTableName; - int bracketIndex = dbTableName.IndexOf('{'); - if (bracketIndex != -1) - { - dbTableName = dbTableName[..bracketIndex]; - var dbTableInfos = _db.AsTenant().GetConnectionScope(ConfigId).DbMaintenance.GetTableInfoList(false); - var table = dbTableInfos.FirstOrDefault(u => u.Name.StartsWith(config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName, StringComparison.CurrentCultureIgnoreCase)); - if (table != null) - dbTableName = table.Name; - } - - // 切库---多库代码生成用 - var provider = _db.AsTenant().GetConnectionScope(!string.IsNullOrEmpty(ConfigId) ? ConfigId : SqlSugarConst.MainConfigId); - - var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenantBaseData)]; - var columnInfos = provider.DbMaintenance.GetColumnInfosByTableName(dbTableName, false); - var result = columnInfos.Select(u => new ColumnOuput - { - // 转下划线后的列名需要再转回来(暂时不转) - //ColumnName = config.DbSettings.EnableUnderLine ? CodeGenUtil.CamelColumnName(u.DbColumnName, entityBasePropertyNames) : u.DbColumnName, - ColumnName = u.DbColumnName, - ColumnLength = u.Length, - IsPrimarykey = u.IsPrimarykey, - IsNullable = u.IsNullable, - ColumnKey = u.IsPrimarykey.ToString(), - NetType = CodeGenHelper.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), - DataType = u.DataType, - ColumnComment = string.IsNullOrWhiteSpace(u.ColumnDescription) ? u.DbColumnName : u.ColumnDescription, - DefaultValue = u.DefaultValue, - }).ToList(); - - // 获取实体的属性信息,赋值给PropertyName属性(CodeFirst模式应以PropertyName为实际使用名称) - var entityProperties = entityType.Type.GetProperties(); - for (int i = result.Count - 1; i >= 0; i--) - { - var columnOutput = result[i]; - // 先找自定义字段名的,如果找不到就再找自动生成字段名的(并且过滤掉没有SugarColumn的属性) - var propertyInfo = entityProperties.FirstOrDefault(u => (u.GetCustomAttribute()?.ColumnName ?? "").ToLower() == columnOutput.ColumnName.ToLower()) ?? - entityProperties.FirstOrDefault(u => u.GetCustomAttribute() != null && u.Name.ToLower() == (config.DbSettings.EnableUnderLine - ? CodeGenHelper.CamelColumnName(columnOutput.ColumnName, entityBasePropertyNames).ToLower() - : columnOutput.ColumnName.ToLower())); - if (propertyInfo != null) - { - columnOutput.PropertyName = propertyInfo.Name; - columnOutput.ColumnComment = propertyInfo.GetCustomAttribute()!.ColumnDescription; - } - else - { - result.RemoveAt(i); // 移除没有定义此属性的字段 - } - } - return result; - } - - /// - /// 获取库表信息 - /// - /// 是否排除带SysTable属性的表 - /// - [DisplayName("获取库表信息")] - public async Task> GetEntityInfos(bool excludeSysTable = false) - { - var types = new List(); - if (_codeGenOptions.EntityAssemblyNames != null) - { - types = App.EffectiveTypes.Where(u => u.IsClass).Where(u => _codeGenOptions.EntityAssemblyNames.Contains(u.Assembly.GetName().Name) - || _codeGenOptions.EntityAssemblyNames.Any(name => u.Assembly.GetName().Name!.Contains(name))).ToList(); - } - - Type[] cosType = types.Where(u => u.IsDefined(typeof(SugarTable), false) && !u.GetCustomAttributes().Any()).ToArray(); - var entityInfos = new List(); - foreach (var ct in cosType) - { - // 若实体贴[SysTable]特性,则禁止显示系统自带的 - if (excludeSysTable && ct.IsDefined(typeof(SysTableAttribute), false)) - continue; - - var des = ct.GetCustomAttributes(typeof(DescriptionAttribute), false); - var description = des.Length > 0 ? ((DescriptionAttribute)des[0]).Description : ""; - var sugarAttribute = ct.GetCustomAttributes(typeof(SugarTable), true).FirstOrDefault(); - - entityInfos.Add(new EntityInfo() - { - EntityName = ct.Name, - DbTableName = sugarAttribute == null ? ct.Name : ((SugarTable)sugarAttribute).TableName, - TableDescription = sugarAttribute == null ? description : ((SugarTable)sugarAttribute).TableDescription, - Type = ct - }); - } - return await Task.FromResult(entityInfos); - } - - /// - /// 获取代码生成配置列表 🔖 - /// - /// - /// - [DisplayName("获取代码生成配置列表")] - public async Task> GetList([FromQuery] CodeGenConfig input) - { - // 获取主表 - var codeGenTable = _db.Queryable().Single(u => u.Id == input.CodeGenId); - // 获取配置的字段 - var genConfigColumnList = await _db.Queryable().Where(u => u.CodeGenId == input.CodeGenId).ToListAsync(); - // 获取实体所有字段 - var tableColumnList = GetColumnList(codeGenTable.TableName, codeGenTable.ConfigId); - // 获取新增的字段 - var addColumnList = tableColumnList.Where(u => !genConfigColumnList.Select(d => d.ColumnName).Contains(u.ColumnName)).ToList(); - // 获取删除的字段 - var delColumnList = genConfigColumnList.Where(u => !tableColumnList.Select(d => d.ColumnName).Contains(u.ColumnName)).ToList(); - // 获取更新的字段 - var updateColumnList = new List(); - foreach (var column in genConfigColumnList) - { - // 获取没有增减的 - if (tableColumnList.Any(u => u.ColumnName == column.ColumnName)) - { - var nmd = tableColumnList.Single(u => u.ColumnName == column.ColumnName); - // 如果数据库类型或者长度改变 - if (nmd.NetType != column.NetType || nmd.ColumnLength != column.ColumnLength || nmd.ColumnComment != column.ColumnComment) - { - column.NetType = nmd.NetType; - column.ColumnLength = nmd.ColumnLength; - column.ColumnComment = nmd.ColumnComment; - updateColumnList.Add(column); - } - } - } - // 增加新增的 - if (addColumnList.Count > 0) AddList(addColumnList, codeGenTable); - // 删除没有的 - if (delColumnList.Count > 0) await _db.Deleteable(delColumnList).ExecuteCommandAsync(); - // 更新配置 - if (updateColumnList.Count > 0) await _db.Updateable(updateColumnList).ExecuteCommandAsync(); - // 重新获取配置 - return await _db.Queryable() - .Where(u => u.CodeGenId == input.CodeGenId) - .Select() - .Mapper(u => - { - u.NetType = (u.EffectType is "EnumSelector" or "ConstSelector" ? u.DictTypeCode : u.NetType); - }) - .OrderBy(u => new { u.OrderNo, u.Id }) - .ToListAsync(); - } - - /// - /// 更新代码生成配置 🔖 - /// - /// - /// - [ApiDescriptionSettings(Name = "Update"), HttpPost] - [DisplayName("更新代码生成配置")] - public async Task UpdateCodeGenConfig(List inputList) - { - if (inputList == null || inputList.Count < 1) return; - - await _db.Updateable(inputList.Adapt>()) - .IgnoreColumns(u => new { u.ColumnLength, u.ColumnName, u.PropertyName }) - .ExecuteCommandAsync(); - } - - /// - /// 删除代码生成配置 - /// - /// - /// - [NonAction] - public async Task DeleteCodeGenConfig(long codeGenId) - { - await _db.Deleteable().Where(u => u.CodeGenId == codeGenId).ExecuteCommandAsync(); - } - - /// - /// 获取代码生成配置详情 🔖 - /// - /// - /// - [DisplayName("获取代码生成配置详情")] - public async Task GetDetail([FromQuery] CodeGenConfig input) - { - return await _db.Queryable().SingleAsync(u => u.Id == input.Id); - } - - /// - /// 批量增加代码生成配置 - /// - /// - /// - [NonAction] - public void AddList(List tableColumnOutputList, SysCodeGen codeGenerate) - { - if (tableColumnOutputList == null) return; - - var codeGenConfigs = new List(); - var orderNo = 1; - foreach (var tableColumn in tableColumnOutputList) - { - if (_db.Queryable().Any(u => u.ColumnName == tableColumn.ColumnName && u.CodeGenId == codeGenerate.Id)) - continue; - - var codeGenConfig = new SysCodeGenConfig(); - - var YesOrNo = YesNoEnum.Y.ToString(); - if (Convert.ToBoolean(tableColumn.ColumnKey)) - { - YesOrNo = YesNoEnum.N.ToString(); - } - - if (CodeGenHelper.IsCommonColumn(tableColumn.PropertyName)) - { - codeGenConfig.WhetherCommon = YesNoEnum.Y.ToString(); - YesOrNo = YesNoEnum.N.ToString(); - } - else - { - codeGenConfig.WhetherCommon = YesNoEnum.N.ToString(); - } - - codeGenConfig.CodeGenId = codeGenerate.Id; - codeGenConfig.ColumnName = tableColumn.ColumnName; // 字段名 - codeGenConfig.PropertyName = tableColumn.PropertyName;// 实体属性名 - codeGenConfig.ColumnLength = tableColumn.ColumnLength;// 长度 - codeGenConfig.ColumnComment = tableColumn.ColumnComment; - codeGenConfig.NetType = tableColumn.NetType; - codeGenConfig.WhetherRetract = YesNoEnum.N.ToString(); - - // 生成代码时,主键并不是必要输入项,故一定要排除主键字段 - //codeGenConfig.WhetherRequired = (tableColumn.IsNullable || tableColumn.IsPrimarykey) ? YesNoEnum.N.ToString() : YesNoEnum.Y.ToString(); - - #region 添加校验规则 - - // 添加校验规则 - codeGenConfig.Id = YitIdHelper.NextId(); - // 验证规则 - List ruleItems = []; - if (!tableColumn.IsNullable && !tableColumn.IsPrimarykey) - { - ruleItems.Add(new VerifyRuleItem() - { - Key = codeGenConfig.Id, - Type = "required", - Message = $"{tableColumn.ColumnComment}不能为空", - }); - } - codeGenConfig.WhetherRequired = ruleItems.Any(t => t.Type == "required") ? YesNoEnum.Y.ToString() : YesNoEnum.N.ToString(); - codeGenConfig.Rules = ruleItems.ToJson(); - - #endregion 添加校验规则 - - codeGenConfig.QueryWhether = YesNoEnum.N.ToString(); - codeGenConfig.WhetherAddUpdate = YesOrNo; - codeGenConfig.WhetherTable = YesOrNo; - - codeGenConfig.ColumnKey = tableColumn.ColumnKey; - - codeGenConfig.DataType = tableColumn.DataType; - codeGenConfig.EffectType = CodeGenHelper.DataTypeToEff(codeGenConfig.NetType); - codeGenConfig.QueryType = GetDefaultQueryType(codeGenConfig); // QueryTypeEnum.eq.ToString(); - codeGenConfig.OrderNo = orderNo; - codeGenConfig.DefaultValue = GetDefaultValue(tableColumn.DefaultValue); - codeGenConfigs.Add(codeGenConfig); - - orderNo += 1; // 每个配置排序间隔1 - } - // 多库代码生成---这里要切回主库 - var provider = _db.AsTenant().GetConnectionScope(SqlSugarConst.MainConfigId); - provider.Insertable(codeGenConfigs).ExecuteCommand(); - } - - /// - /// 默认查询类型 - /// - /// - /// - private static string GetDefaultQueryType(SysCodeGenConfig codeGenConfig) - { - return (codeGenConfig.NetType?.TrimEnd('?')) switch - { - "string" => "like", - "DateTime" => "~", - _ => "==", - }; - } - - /// - /// 获取默认值 - /// - /// - /// - private static string? GetDefaultValue(string dataValue) - { - if (dataValue == null) return null; - // 正则表达式模式 - // \( 和 \) 用来匹配字面量的括号 - // .+ 用来匹配一个或多个任意字符,但不包括换行符 - string pattern = @"\((.+)\)";//适合MSSQL其他数据库没有测试 - - // 使用 Regex 类进行匹配 - Match match = Regex.Match(dataValue, pattern); - - string value; - // 如果找到了匹配项 - if (match.Success) - { - // 提取括号内的值 - value = match.Groups[1].Value.Trim('\''); - } - else - { - value = dataValue; - } - return value; - } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs index a8d89ffe..3227f4d0 100644 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs +++ b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenService.cs @@ -1,825 +1,769 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -using System.IO.Compression; -using DbType = SqlSugar.DbType; - -namespace Admin.NET.Core.Service; - -/// -/// 系统代码生成器服务 🧩 -/// -[ApiDescriptionSettings(Order = 270, Description = "代码生成器")] -public class SysCodeGenService : IDynamicApiController, ITransient -{ - private readonly ISqlSugarClient _db; - private readonly CodeGenOptions _codeGenOptions; - private readonly DbConnectionOptions _dbConnectionOptions; - private readonly SysCodeGenConfigService _codeGenConfigService; - private readonly IViewEngine _viewEngine; - - public SysCodeGenService(ISqlSugarClient db, - IOptions codeGenOptions, - IOptions dbConnectionOptions, - SysCodeGenConfigService codeGenConfigService, - IViewEngine viewEngine) - { - _db = db; - _dbConnectionOptions = dbConnectionOptions.Value; - _codeGenOptions = codeGenOptions.Value; - _codeGenConfigService = codeGenConfigService; - _viewEngine = viewEngine; - } - - /// - /// 获取代码生成分页列表 🔖 - /// - /// - /// - [DisplayName("获取代码生成分页列表")] - public async Task> Page(PageCodeGenInput input) - { - return await _db.Queryable() - .Includes(u => u.CodeGenTemplateRelations) - .WhereIF(!string.IsNullOrWhiteSpace(input.TableName), u => u.TableName!.Contains(input.TableName.Trim())) - .WhereIF(!string.IsNullOrWhiteSpace(input.BusName), u => u.BusName!.Contains(input.BusName.Trim())) - .OrderBy(u => u.Id, OrderByType.Desc) - .ToPagedListAsync(input.Page, input.PageSize); - } - - /// - /// 增加代码生成 🔖 - /// - /// - /// - [ApiDescriptionSettings(Name = "Add"), HttpPost] - [DisplayName("增加代码生成")] - public async Task AddCodeGen(AddCodeGenInput input) - { - var isExist = await _db.Queryable().Where(u => u.TableName == input.TableName).AnyAsync(); - if (isExist) - throw Oops.Oh(ErrorCodeEnum.D1400); - - var codeGen = input.Adapt(); - long id = YitIdHelper.NextId(); - var templateRelations = SysCodeGenService.GetCodeGenTemplateRelation(id, input.CodeGenTemplateIds); - codeGen.Id = id; - codeGen.CodeGenTemplateRelations = templateRelations; - //var newCodeGen = await _db.Insertable(codeGen).ExecuteReturnEntityAsync(); - var newCodeGen = await _db.InsertNav(codeGen) - .Include(t => t.CodeGenTemplateRelations) - .ExecuteReturnEntityAsync(); - - // 增加配置表 - _codeGenConfigService.AddList(_codeGenConfigService.GetColumnList(input), newCodeGen); - } - - /// - /// 获取代码生成模板关系集合 🔖 - /// - /// - /// - /// - private static List GetCodeGenTemplateRelation(long codeGenId, List templateIds) - { - List list = []; - foreach (var item in templateIds) - { - SysCodeGenTemplateRelation relation = new() - { - CodeGenId = codeGenId, - TemplateId = item - }; - list.Add(relation); - } - return list; - } - - /// - /// 更新代码生成 🔖 - /// - /// - /// - [ApiDescriptionSettings(Name = "Update"), HttpPost] - [DisplayName("更新代码生成")] - public async Task UpdateCodeGen(UpdateCodeGenInput input) - { - //开发阶段不断生成调整 - //var isExist = await _db.Queryable().AnyAsync(u => u.TableName == input.TableName && u.Id != input.Id); - //if (isExist) - // throw Oops.Oh(ErrorCodeEnum.D1400); - - var codeGen = input.Adapt(); - var templateRelations = SysCodeGenService.GetCodeGenTemplateRelation(codeGen.Id, input.CodeGenTemplateIds); - codeGen.CodeGenTemplateRelations = templateRelations; - //await _db.Updateable(codeGen).ExecuteCommandAsync(); - await _db.UpdateNav(codeGen).Include(t => t.CodeGenTemplateRelations).ExecuteCommandAsync(); - - // 更新配置表 - _codeGenConfigService.AddList(_codeGenConfigService.GetColumnList(input.Adapt()), codeGen); - } - - /// - /// 删除代码生成 🔖 - /// - /// - /// - [ApiDescriptionSettings(Name = "Delete"), HttpPost] - [DisplayName("删除代码生成")] - public async Task DeleteCodeGen(List inputs) - { - if (inputs == null || inputs.Count < 1) return; - - var codeGenConfigTaskList = new List(); - inputs.ForEach(u => - { - //_db.Deleteable().In(u.Id).ExecuteCommand(); - _db.DeleteNav(t => t.Id == u.Id) - .Include(t => t.CodeGenTemplateRelations) - .ExecuteCommand(); - - // 删除配置表 - codeGenConfigTaskList.Add(_codeGenConfigService.DeleteCodeGenConfig(u.Id)); - }); - await Task.WhenAll(codeGenConfigTaskList); - } - - /// - /// 获取代码生成详情 🔖 - /// - /// - /// - [DisplayName("获取代码生成详情")] - public async Task GetDetail([FromQuery] QueryCodeGenInput input) - { - return await _db.Queryable().SingleAsync(u => u.Id == input.Id); - } - - /// - /// 获取数据库库集合 🔖 - /// - /// - [DisplayName("获取数据库库集合")] - public async Task> GetDatabaseList() - { - var dbConfigs = _dbConnectionOptions.ConnectionConfigs; - return await Task.FromResult(dbConfigs.Adapt>()); - } - - /// - /// 获取数据库表(实体)集合 🔖 - /// - /// - [DisplayName("获取数据库表(实体)集合")] - public async Task> GetTableList(string configId = SqlSugarConst.MainConfigId) - { - var provider = _db.AsTenant().GetConnectionScope(configId); - var dbTableInfos = provider.DbMaintenance.GetTableInfoList(false); - - var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => configId.Equals(u.ConfigId)); - - // 获取所有实体列表并按照程序集和实体名称进行排序 - IEnumerable entityInfos = await _codeGenConfigService.GetEntityInfos(); - entityInfos = entityInfos.OrderBy(u => u.Type.Assembly.ManifestModule.Name).ThenBy(u => u.EntityName); - - var tableOutputList = new List(); - foreach (var item in entityInfos) - { - var tbConfigId = item.Type.GetCustomAttribute()?.configId as string ?? SqlSugarConst.MainConfigId; - if (item.Type.IsDefined(typeof(LogTableAttribute)) && !item.Type.IsDefined(typeof(SysTableAttribute))) tbConfigId = SqlSugarConst.LogConfigId; - if (tbConfigId != configId) - continue; - - var dbTableName = item.DbTableName; - int bracketIndex = dbTableName.IndexOf('{'); - if (bracketIndex != -1) - dbTableName = dbTableName.Substring(0, bracketIndex); - - var table = dbTableInfos.FirstOrDefault(u => u.Name.ToLower().Equals((config != null && config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName).ToLower())); - //if (table == null) continue; - tableOutputList.Add(new TableOutput - { - ConfigId = configId, - EntityName = item.EntityName, - TableName = table?.Name, - TableComment = item.TableDescription, - ColumnCount = item.Type.GetProperties().Length, - AssemblyName = item.Type.Assembly.ManifestModule.Name - }); - } - return tableOutputList; - } - - /// - /// 根据表名获取列集合 🔖 - /// - /// - [DisplayName("根据表名获取列集合")] - public List GetColumnListByTableName([Required] string tableName, string configId = SqlSugarConst.MainConfigId) - { - // 切库---多库代码生成用 - var provider = _db.AsTenant().GetConnectionScope(configId); - - var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == configId); - // 获取实体类型属性 - var entityType = provider.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == tableName); - if (entityType == null) return null; - var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenantBaseData)]; - - tableName = GetRealTableName(tableName); - var properties = _codeGenConfigService.GetEntityInfos().Result.First(u => GetRealTableName(u.DbTableName).EqualIgnoreCase(tableName)).Type.GetProperties() - .Where(u => u.GetCustomAttribute()?.IsIgnore == false).Select(u => new - { - PropertyName = u.Name, - ColumnComment = u.GetCustomAttribute()?.ColumnDescription, - ColumnName = GetRealColumnName(u.GetCustomAttribute()?.ColumnName ?? u.Name) - }).ToList(); - - // 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null) - var columnList = provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOuput - { - ColumnName = config!.DbSettings.EnableUnderLine ? CodeGenHelper.CamelColumnName(u.DbColumnName, entityBasePropertyNames) : u.DbColumnName, - ColumnKey = u.IsPrimarykey.ToString(), - DataType = u.DataType.ToString(), - NetType = CodeGenHelper.ConvertDataType(u, provider.CurrentConnectionConfig.DbType), - ColumnComment = u.ColumnDescription - }).ToList(); - - foreach (var column in columnList) - { - var property = properties.FirstOrDefault(u => u.ColumnName == column.ColumnName); - column.ColumnComment ??= property?.ColumnComment; - column.PropertyName = property?.PropertyName; - } - return columnList; - - string GetRealTableName(string name) - { - string realName = config!.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(name) : name; - return realName; - } - - string GetRealColumnName(string name) - { - if (string.IsNullOrWhiteSpace(name)) return null; - string realName = config!.DbSettings.EnableUnderLine ? CodeGenHelper.CamelColumnName(name, entityBasePropertyNames) : name; - if (config.DbType == DbType.PostgreSQL) realName = realName.ToLower(); - return realName; - } - } - - /// - /// 获取程序保存位置 🔖 - /// - /// - [DisplayName("获取程序保存位置")] - public List GetApplicationNamespaces() - { - return _codeGenOptions.BackendApplicationNamespaces; - } - - /// - /// 执行代码生成 🔖 - /// - /// - [DisplayName("执行代码生成")] - public async Task RunLocal(SysCodeGen input) - { - if (string.IsNullOrEmpty(input.GenerateType)) input.GenerateType = "200"; - - string outputPath = Path.Combine(App.WebHostEnvironment.WebRootPath, "codeGen", input.TableName!); - if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true); - - var tableFieldList = await _codeGenConfigService.GetList(new CodeGenConfig { CodeGenId = input.Id }); // 字段集合 - SysCodeGenService.ProcessTableFieldList(tableFieldList); // 处理字段集合 - - var queryWhetherList = tableFieldList.Where(u => u.QueryWhether == YesNoEnum.Y.ToString()).ToList(); // 前端查询集合 - var joinTableList = tableFieldList.Where(u => u.EffectType is "Upload" or "ForeignKey" or "ApiTreeSelector").ToList(); // 需要连表查询的字段 - var data = CreateCustomViewEngine(input, tableFieldList, queryWhetherList, joinTableList); // 创建视图引擎数据 - - // 获取菜单 - var menuList = await GetMenus(input.TableName!, input.BusName!, input.MenuPid ?? 0, input.MenuIcon!, input.PagePath!, tableFieldList); - if (input.GenerateMenu) - { - await AddMenu(menuList, input.MenuPid ?? 0); // 添加菜单 - } - - // 模板 - var templateList = GetTemplateList(input); - var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "template"); - for (var i = 0; i < templateList.Count; i++) - { - string tResult = await ProcessTemplate(templateList[i], input, templatePath, data, menuList); // 处理模板 - string targetFile = templateList[i].OutputFile - .Replace("{PagePath}", input.PagePath) - .Replace("{TableName}", input.TableName) - .Replace("{TableNameLower}", input.TableName?.ToFirstLetterLowerCase() ?? ""); - - string tmpPath; - if (!input.GenerateType.StartsWith('1')) - { - if (templateList[i].Type == CodeGenTypeEnum.Frontend) - tmpPath = Path.Combine(new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent!.Parent!.FullName, _codeGenOptions.FrontRootPath, "src"); - else - tmpPath = Path.Combine(new DirectoryInfo(App.WebHostEnvironment.ContentRootPath).Parent!.FullName, input.NameSpace!); - } - else - { - tmpPath = templateList[i].Type == CodeGenTypeEnum.Frontend ? Path.Combine(outputPath, _codeGenOptions.FrontRootPath, "src") : Path.Combine(outputPath, input!.NameSpace!); - } - targetFile = Path.Combine(tmpPath, targetFile); - var dirPath = new DirectoryInfo(targetFile).Parent!.FullName; - if (!Directory.Exists(dirPath)) - Directory.CreateDirectory(dirPath); - await File.WriteAllTextAsync(targetFile, tResult, Encoding.UTF8); - } - - // 非ZIP压缩返回空 - if (!input.GenerateType.StartsWith('1')) return null; - - var downloadPath = outputPath + ".zip"; - if (File.Exists(downloadPath)) File.Delete(downloadPath); // 删除同名文件 - ZipFile.CreateFromDirectory(outputPath, downloadPath); - return new { url = $"{App.HttpContext.Request.Scheme}://{App.HttpContext.Request.Host.Value}/codeGen/{input.TableName}.zip" }; - } - - /// - /// 获取代码生成预览 🔖 - /// - /// - [DisplayName("获取代码生成预览")] - public async Task> Preview(SysCodeGen input) - { - var tableFieldList = await _codeGenConfigService.GetList(new CodeGenConfig { CodeGenId = input.Id }); // 字段集合 - SysCodeGenService.ProcessTableFieldList(tableFieldList); // 处理字段集合 - - var queryWhetherList = tableFieldList.Where(u => u.QueryWhether == YesNoEnum.Y.ToString()).ToList(); // 前端查询集合 - var joinTableList = tableFieldList.Where(u => u.EffectType is "Upload" or "ForeignKey" or "ApiTreeSelector").ToList(); // 需要连表查询的字段 - var data = CreateCustomViewEngine(input, tableFieldList, queryWhetherList, joinTableList); // 创建视图引擎数据 - - // 获取模板文件并替换 - var templateList = GetTemplateList(input); - var templatePath = Path.Combine(App.WebHostEnvironment.WebRootPath, "template"); - - await _db.Ado.BeginTranAsync(); - try - { - var menuList = await GetMenus(input.TableName!, input.BusName!, input.MenuPid ?? 0, input.MenuIcon!, input.PagePath!, tableFieldList); - var result = new Dictionary(); - foreach (var template in templateList) - { - string tResult = await ProcessTemplate(template, input, templatePath, data, menuList); // 处理模板 - result.Add(template.Name?.TrimEnd(".vm")!, tResult); - } - return result; - } - finally - { - await _db.Ado.RollbackTranAsync(); - } - } - - /// - /// 处理字段集合 - /// - /// - private static void ProcessTableFieldList(List tableFieldList) - { - foreach (var item in tableFieldList) - { - List list = []; - if (!string.IsNullOrWhiteSpace(item.Rules)) - { - if (item.Rules != "[]") - list = JSON.Deserialize>(item.Rules); - } - else - { - item.Rules = "[]"; - } - item.RuleItems = list; - item.WhetherRequired = list.Any(u => u.Type == "required") ? YesNoEnum.Y.ToString() : YesNoEnum.N.ToString(); - item.AnyRule = list.Count > 0; - item.RemoteVerify = list.Any(u => u.Type == "remote"); - } - } - - /// - /// 创建视图引擎数据 - /// - /// - /// - /// - /// - /// - private CustomViewEngine CreateCustomViewEngine(SysCodeGen input, List tableFieldList, List queryWhetherList, List joinTableList) - { - return new CustomViewEngine(_db) - { - ConfigId = input.ConfigId!, // 库定位器名 - AuthorName = input.AuthorName!, // 作者 - BusName = input.BusName!, // 业务名称 - NameSpace = input.NameSpace!, // 命名空间 - ClassName = input.TableName!, // 类名称 - PagePath = input.PagePath!, // 页面目录 - ProjectLastName = input.NameSpace!.Split('.').Last(), // 项目最后个名称,生成的时候赋值 - QueryWhetherList = queryWhetherList, // 查询条件 - TableField = tableFieldList, // 表字段配置信息 - IsJoinTable = joinTableList.Count > 0, // 是否联表 - IsUpload = joinTableList.Any(u => u.EffectType == "Upload"), // 是否上传 - PrintType = input.PrintType!, // 支持打印类型 - PrintName = input.PrintName!, // 打印模板名称 - IsApiService = input.IsApiService, - RemoteVerify = tableFieldList.Any(t => t.RemoteVerify), // 远程验证 - TreeName = input.TreeName, - LowerTreeName = input.TreeName?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - LeftTab = input.LeftTab, - LeftKey = input.LeftKey!, - LeftPrimaryKey = input.LeftPrimaryKey, - LeftName = input.LeftName, - LowerLeftTab = input.LeftTab?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - LowerLeftKey = input.LeftKey?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - LowerLeftPrimaryKey = input.LeftPrimaryKey?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - BottomTab = input.BottomTab, - BottomKey = input.BottomKey!, - BottomPrimaryKey = input.BottomPrimaryKey, - LowerBottomTab = input.BottomTab?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - LowerBottomKey = input.BottomKey?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - LowerBottomPrimaryKey = input.BottomPrimaryKey?.ToFirstLetterLowerCase() ?? "", // 首字母小写 - TabType = input.TabType ?? "", - }; - } - - /// - /// 处理模板 - /// - /// - /// - /// - /// - /// - /// - private async Task ProcessTemplate(SysCodeGenTemplate template, SysCodeGen input, string templatePath, CustomViewEngine data, List menuList) - { - string tResult; - - var filename = template.Name; - // 更改默认首页模板 - if (filename == "web_views_index.vue.vm") - { - filename = string.IsNullOrEmpty(input.LeftTab) ? filename : "web_views_LeftTree.vue.vm"; // 左树右列表 - filename = (!string.IsNullOrEmpty(input.LeftTab) && !string.IsNullOrEmpty(input.BottomTab)) ? "web_views_BottomIndx.vue.vm" : filename; // 左树右上列表下列表属性 - filename = (string.IsNullOrEmpty(input.LeftTab) && !string.IsNullOrEmpty(input.BottomTab)) ? "web_views_UDIndx.vue.vm" : filename; // 右上列表下列表属性 - } - //更改list控件 - if (filename == "web_views_List.vue.vm") - { - filename = data.TabType switch - { - "Tree" => "web_views_TreeList.vue.vm", - _ => "web_views_List.vue.vm" // 默认列表 - }; - } - var templateFilePath = Path.Combine(templatePath, filename); - if (!File.Exists(templateFilePath)) return null; - - var tContent = await File.ReadAllTextAsync(templateFilePath); - - if (template.Type == CodeGenTypeEnum.SeedData) - { - // 种子模板 - var seedData = new - { - AuthorName = input.AuthorName!, // 作者 - BusName = input.BusName!, // 业务名称 - NameSpace = input.NameSpace!, // 命名空间 - ClassName = input.TableName!, // 类名称 - ConfigId = input.ConfigId, // 库标识 - MenuList = menuList, // 菜单集合 - PrintType = input.PrintType! - }; - tResult = await _viewEngine.RunCompileAsync(tContent, seedData, builderAction: builder => - { - builder.AddAssemblyReferenceByName("System.Linq"); - builder.AddAssemblyReferenceByName("System.Collections"); - builder.AddAssemblyReferenceByName("System.Text.RegularExpressions"); - builder.AddUsing("System.Text.RegularExpressions"); - builder.AddUsing("System.Collections.Generic"); - builder.AddUsing("System.Linq"); - }); - } - else - { - tResult = await _viewEngine.RunCompileAsync(tContent, data, builderAction: builder => - { - builder.AddAssemblyReferenceByName("System.Linq"); - builder.AddAssemblyReferenceByName("System.Collections"); - builder.AddAssemblyReferenceByName("System.Text.RegularExpressions"); - builder.AddUsing("System.Text.RegularExpressions"); - builder.AddUsing("System.Collections.Generic"); - builder.AddUsing("System.Linq"); - }); - } - - return tResult; - } - - /// - /// 获取连表的实体名和别名 - /// - /// - /// - private static (string, string) GetJoinTableStr(List configs) - { - var uploads = configs.Where(u => u.EffectType == "Upload").ToList(); - var fks = configs.Where(u => u.EffectType == "ForeignKey").ToList(); - string str = ""; // - string lowerStr = ""; // (o, i, c) - foreach (var item in uploads) - { - lowerStr += "sysFile_FK_" + item.LowerPropertyName + ","; - str += "SysFile,"; - } - foreach (var item in fks) - { - lowerStr += item.LowerFkEntityName + "_FK_" + item.LowerFkColumnName + ","; - str += item.FkEntityName + ","; - } - return (str.TrimEnd(','), lowerStr.TrimEnd(',')); - } - - /// - /// 增加菜单 - /// - /// - /// - /// - private async Task AddMenu(List menus, long pid) - { - // 若 pid=0 为顶级则创建菜单目录 - if (pid == 0) - { - // 若已存在相同目录则删除本级和下级 - var menuType0 = menus.FirstOrDefault(u => u.Type == MenuTypeEnum.Dir && u.Pid == 0); - var menuList0 = await _db.Queryable().Where(u => u.Title == menuType0.Title && u.Type == menuType0.Type).ToListAsync(); - if (menuList0.Count > 0) - { - var listIds = menuList0.Select(u => u.Id).ToList(); - var childrenIds = new List(); - foreach (var item in listIds) - { - var children = await _db.Queryable().ToChildListAsync(u => u.Pid, item); - childrenIds.AddRange(children.Select(u => u.Id).ToList()); - } - listIds.AddRange(childrenIds); - await _db.Deleteable().Where(u => listIds.Contains(u.Id)).ExecuteCommandAsync(); - await _db.Deleteable().Where(u => listIds.Contains(u.MenuId)).ExecuteCommandAsync(); - } - } - - // 若已存在相同菜单则删除本级和下级 - var menuType = menus.FirstOrDefault(u => u.Type == MenuTypeEnum.Menu); - var menuListCurrent = await _db.Queryable().Where(u => u.Title == menuType.Title && u.Type == menuType.Type).ToListAsync(); - if (menuListCurrent.Count > 0) - { - var listIds = menuListCurrent.Select(u => u.Id).ToList(); - var childListIds = new List(); - foreach (var item in listIds) - { - var childList = await _db.Queryable().ToChildListAsync(u => u.Pid, item); - childListIds.AddRange(childList.Select(u => u.Id).ToList()); - } - listIds.AddRange(childListIds); - await _db.Deleteable().Where(u => listIds.Contains(u.Id)).ExecuteCommandAsync(); - await _db.Deleteable().Where(u => listIds.Contains(u.MenuId)).ExecuteCommandAsync(); - } - - await _db.Insertable(menus).ExecuteCommandAsync(); - - // 删除角色菜单按钮缓存 - App.GetRequiredService().RemoveByPrefixKey(CacheConst.KeyUserApi); - } - - /// - /// 获得菜单列表 - /// - /// - /// - /// - /// - /// - /// - /// - private async Task> GetMenus(string className, string busName, long pid, string menuIcon, string pagePath, List tableFieldList) - { - string pPath; - // 若 pid=0 为顶级则创建菜单目录 - SysMenu menuType0 = null; - long tempPid = pid; - var menuList = new List(); - var classNameLower = className.ToLower(); - var classNameFirstLower = className.ToFirstLetterLowerCase(); - if (pid == 0) - { - // 目录 - menuType0 = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = 0, - Title = busName + "管理", - Type = MenuTypeEnum.Dir, - Icon = "robot", - Path = "/" + classNameLower + "Manage", - Name = classNameFirstLower + "Manage", - Component = "Layout", - OrderNo = 100, - CreateTime = DateTime.Now - }; - pid = menuType0.Id; - pPath = menuType0.Path; - } - else - { - var pMenu = await _db.Queryable().FirstAsync(u => u.Id == pid) ?? throw Oops.Oh(ErrorCodeEnum.D1505); - pPath = pMenu.Path; - } - - // 菜单 - var menuType = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = pid, - Title = busName + "管理", - Name = classNameFirstLower, - Type = MenuTypeEnum.Menu, - Icon = menuIcon, - Path = pPath + "/" + classNameLower, - Component = "/" + pagePath + "/" + classNameFirstLower + "/index", - CreateTime = DateTime.Now - }; - - var menuPid = menuType.Id; - int menuOrder = 100; - // 按钮-page - var menuTypePage = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "查询", - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/page", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuTypePage); - - // 按钮-detail - var menuTypeDetail = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "详情", - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/detail", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuTypeDetail); - - // 按钮-add - var menuTypeAdd = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "增加", - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/add", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuTypeAdd); - - // 按钮-delete - var menuTypeDelete = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "删除", - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/delete", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuTypeDelete); - - // 按钮-update - var menuTypeUpdate = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "编辑", - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/update", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuTypeUpdate); - - // 加入ForeignKey、Upload、ApiTreeSelector 等接口的权限 - // 在生成表格时,有些字段只是查询时显示,不需要填写(WhetherAddUpdate),所以这些字段没必要生成相应接口 - var fkTableList = tableFieldList.Where(u => u.EffectType == "ForeignKey" && (u.WhetherAddUpdate == "Y" || u.QueryWhether == "Y")).ToList(); - foreach (var column in fkTableList) - { - var menuType1 = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "外键" + column.ColumnName, - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/" + column.FkEntityName + column.ColumnName + "Dropdown", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuType1); - } - var treeSelectTableList = tableFieldList.Where(u => u.EffectType == "ApiTreeSelector").ToList(); - foreach (var column in treeSelectTableList) - { - var menuType1 = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "树型" + column.ColumnName, - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/" + column.FkEntityName + "Tree", - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuType1); - } - var uploadTableList = tableFieldList.Where(u => u.EffectType == "Upload").ToList(); - foreach (var column in uploadTableList) - { - var menuType1 = new SysMenu - { - Id = YitIdHelper.NextId(), - Pid = menuPid, - Title = "上传" + column.ColumnName, - Type = MenuTypeEnum.Btn, - Permission = classNameFirstLower + "/Upload" + column.ColumnName, - OrderNo = menuOrder, - CreateTime = DateTime.Now - }; - menuOrder += 10; - menuList.Add(menuType1); - } - menuList.Insert(0, menuType); - if (tempPid == 0) - { - // 顶级目录需要添加目录本身 - menuList.Insert(0, menuType0); - } - return menuList; - } - - /// - /// 获取模板文件集合 - /// - /// - private List GetTemplateList(SysCodeGen input) - { - //var codeGen= _codeGenRep.AsQueryable() - //TODO: 只获取选中的模板 - if (input.GenerateType!.Substring(1, 1).Contains('1')) - { - return _db.Queryable() - .Where(u => u.Type == CodeGenTypeEnum.Frontend) - .Where(u => u.Id == SqlFunc.Subqueryable().Where(s => s.CodeGenId == input.Id).GroupBy(s => s.TemplateId).Select(s => s.TemplateId)) - .ToList(); - } - - if (input.GenerateType.Substring(1, 1).Contains('2')) - { - return _db.Queryable() - .Where(u => u.Type == CodeGenTypeEnum.Backend) - .Where(u => u.Id == SqlFunc.Subqueryable().Where(s => s.CodeGenId == input.Id).GroupBy(s => s.TemplateId).Select(s => s.TemplateId)) - .ToList(); - } - else - { - return _db.Queryable() - .Where(u => u.Id == SqlFunc.Subqueryable().Where(s => s.CodeGenId == input.Id).GroupBy(s => s.TemplateId).Select(s => s.TemplateId)) - .ToList(); - } - } +// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 +// +// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 +// +// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + +using Admin.NET.Core.CodeGen; +using System.IO.Compression; + +namespace Admin.NET.Core; + +/// +/// 系统代码生成器服务 🧩 +/// +[ApiDescriptionSettings(Order = 270, Description = "代码生成器")] +public class SysCodeGenService : IDynamicApiController, ITransient +{ + private readonly CodeGenStrategyFactory _codeGenStrategyFactory; + private readonly SysCodeGenColumnService _codeGenColumnService; + private readonly DbConnectionOptions _dbConnectionOptions; + private readonly SysCacheService _sysCacheService; + private readonly SysMenuService _sysMenuService; + private readonly CodeGenOptions _codeGenOptions; + private readonly ISqlSugarClient _db; + + public SysCodeGenService( + IOptions dbConnectionOptions, + CodeGenStrategyFactory codeGenStrategyFactory, + SysCodeGenColumnService codeGenColumnService, + IOptions codeGenOptions, + SysCacheService sysCacheService, + SysMenuService sysMenuService, + ISqlSugarClient db) + { + _db = db; + _sysMenuService = sysMenuService; + _sysCacheService = sysCacheService; + _codeGenOptions = codeGenOptions.Value; + _codeGenColumnService = codeGenColumnService; + _codeGenStrategyFactory = codeGenStrategyFactory; + _dbConnectionOptions = dbConnectionOptions.Value; + } + + /// + /// 获取代码生成分页列表 🔖 + /// + /// + /// + [DisplayName("获取代码生成分页列表")] + public async Task> Page(PageCodeGenInput input) + { + return await _db.Queryable().Includes(u => u.TableList) + .WhereIF(!string.IsNullOrWhiteSpace(input.TableName), u => u.TableList.Any(a => a.TableName.Contains(input.TableName.Trim()) || a.EntityName.Contains(input.TableName.Trim()))) + .WhereIF(!string.IsNullOrWhiteSpace(input.BusName), u => u.BusName.Contains(input.BusName.Trim()) || u.Pinyin.Contains(input.BusName.Trim())) + .OrderBy(u => u.Id, OrderByType.Desc) + .ToPagedListAsync(input.Page, input.PageSize); + } + + /// + /// 增加代码生成 🔖 + /// + /// + /// + [DisplayName("增加代码生成")] + [ApiDescriptionSettings(Name = "Add"), HttpPost] + public async Task AddCodeGen(AddCodeGenInput input) + { + try + { + // 验证参数 + ValidateTemplateParameters(input.Adapt()); + + await _db.Ado.BeginTranAsync(); + + // 保存代码生成记录 + var codegen = input.Adapt(); + await _db.Insertable(codegen).ExecuteCommandAsync(); + + // 保存关联表 + codegen.TableList.ForEach(e => e.CodeGenId = codegen.Id); + await _db.Insertable(codegen.TableList).ExecuteCommandAsync(); + + // 处理并保存表字段配置 + codegen.TableList.ForEach(e => + { + int orderNo = 1; + e.ColumnList = e.ColumnList.DistinctBy(u => u.PropertyName).ToList(); // 去重 + e.ColumnList.ForEach(a => + { + a.CodeGenTableId = e.Id; // 关联表id + a.OrderNo = orderNo++; // 排序 + }); + }); + await _db.Storageable(codegen.TableList.SelectMany(e => e.ColumnList).ToList()).ExecuteCommandAsync(); + await _db.Ado.CommitTranAsync(); + } + catch (Exception) + { + await _db.Ado.RollbackTranAsync(); + throw; + } + } + + /// + /// 更新代码生成 🔖 + /// + /// + /// + [DisplayName("更新代码生成")] + [ApiDescriptionSettings(Name = "Update"), HttpPost] + public async Task UpdateCodeGen(UpdateCodeGenInput input) + { + try + { + // 验证参数 + ValidateTemplateParameters(input); + + await _db.Ado.BeginTranAsync(); + + // 保存代码生成记录 + var codegen = input.Adapt(); + await _db.Updateable(codegen).ExecuteCommandAsync(); + + // 保存关联表 + codegen.TableList.ForEach(e => e.CodeGenId = codegen.Id); + await _db.Storageable(codegen.TableList).ExecuteCommandAsync(); + + // 更新配置表 + var tableIds = codegen.TableList.Select(w => w.Id).ToList(); + await _db.Deleteable().Where(u => tableIds.Contains(u.CodeGenTableId)).ExecuteCommandAsync(); + + // 处理并保存表字段配置 + codegen.TableList.ForEach(e => + { + int orderNo = 1; + e.ColumnList = e.ColumnList.DistinctBy(u => u.PropertyName).ToList(); // 去重 + e.ColumnList.ForEach(a => + { + a.CodeGenTableId = e.Id; // 关联表id + a.OrderNo = orderNo++; // 排序 + }); + }); + await _db.Storageable(codegen.TableList.SelectMany(e => e.ColumnList).ToList()).ExecuteCommandAsync(); + await _db.Ado.CommitTranAsync(); + } + catch (Exception) + { + await _db.Ado.RollbackTranAsync(); + throw; + } + } + + /// + /// 删除代码生成 🔖 + /// + /// + /// + [DisplayName("删除代码生成")] + [ApiDescriptionSettings(Name = "Delete"), HttpPost] + public async Task DeleteCodeGen(BaseIdInput input) + { + try + { + await _db.Ado.BeginTranAsync(); + var entity = await GetDetail(input.Id); + if (entity == null) return; + + await _db.Deleteable(entity).ExecuteCommandAsync(); + + var tableList = entity.TableList; + await _db.Deleteable(tableList).ExecuteCommandAsync(); + + // 删除表字段配置 + var tableIds = tableList.Select(u => u.Id).ToList(); + await _db.Deleteable().Where(u => tableIds.Contains(u.CodeGenTableId)) + .ExecuteCommandAsync(); + await _db.Ado.CommitTranAsync(); + } + catch (Exception) + { + await _db.Ado.RollbackTranAsync(); + throw; + } + } + + /// + /// 同步代码生成 🔖 + /// + /// + /// + [DisplayName("同步代码生成")] + [ApiDescriptionSettings(Name = "Sync"), HttpPost] + public async Task SyncCodeGen(BaseIdInput input) + { + try + { + await _db.Ado.BeginTranAsync(); + var entity = await GetDetail(input.Id); + if (entity == null) return; + + var addColumns = new List(); + var updateColumns = new List(); + var deleteColumns = new List(); + foreach (var tableConfig in entity.TableList) + { + // 获取默认字段配置 + var columns = await GetDefaultColumnConfigList(new DefaultColumnConfigInput { ConfigId = tableConfig.ConfigId, TableName = tableConfig.TableName }); + + // 计算新增字段 + var addList = columns.Where(u => tableConfig.ColumnList.All(a => a.PropertyName != u.PropertyName)) + .Select(u => + { + u.CodeGenTableId = tableConfig.Id; + return u; + }).ToList(); + + // 计算更新字段 + var updateList = columns.Join(tableConfig.ColumnList, + c => c.PropertyName, + t => t.PropertyName, + (c, t) => new { Column = c, OldColumn = t }) + .Where(x => x.Column.NetType != x.OldColumn.NetType || + x.Column.DataType != x.OldColumn.DataType || + x.Column.IsPrimarykey != x.OldColumn.IsPrimarykey || + x.Column.IsRequired != x.OldColumn.IsRequired || + x.Column.ColumnLength != x.OldColumn.ColumnLength) + .Select(x => + { + x.Column.Id = x.OldColumn.Id; + x.Column.CodeGenTableId = x.OldColumn.CodeGenTableId; + return x.Column; + }).ToList(); + + // 计算删除字段 + var deleteList = tableConfig.ColumnList.Where(u => columns.All(c => c.PropertyName != u.PropertyName)).ToList(); + + // 追加到集合 + addColumns.AddRange(addList); + updateColumns.AddRange(updateList); + deleteColumns.AddRange(deleteList); + } + + // 保存新增、更新、删除字段 + if (addColumns.Count > 0) await _db.Insertable(addColumns).ExecuteCommandAsync(); + if (updateColumns.Count > 0) await _db.Updateable(updateColumns).ExecuteCommandAsync(); + if (deleteColumns.Count > 0) await _db.Deleteable(deleteColumns).ExecuteCommandAsync(); + + await _db.Ado.CommitTranAsync(); + } + catch (Exception) + { + await _db.Ado.RollbackTranAsync(); + throw; + } + } + + /// + /// 获取代码生成详情 🔖 + /// + /// + /// + [DisplayName("获取代码生成详情")] + public async Task GetDetail([FromQuery] BaseIdInput input) + { + return await GetDetail(input.Id); + } + + /// + /// 获取代码生成详情 🔖 + /// + /// + /// + [NonAction] + private async Task GetDetail(long id) + { + return await _db.Queryable().Includes(u => u.TableList, w => w.ColumnList).FirstAsync(u => u.Id == id); + } + + /// + /// 获取代码生成表详情 🔖 + /// + /// + /// + [DisplayName("获取代码生成表详情")] + public async Task GetTableDetail([FromQuery] BaseIdInput input) + { + return await _db.Queryable().Includes(u => u.ColumnList).FirstAsync(u => u.Id == input.Id); + } + + /// + /// 获取默认表字段配置列表 🔖 + /// + /// + /// + [DisplayName("获取默认表字段配置列表")] + [ApiDescriptionSettings, HttpPost] + public async Task> GetDefaultColumnConfigList(DefaultColumnConfigInput input) + { + var list = await GetColumnListByTableName(input.TableName, input.ConfigId); + return _codeGenColumnService.GetDefaultColumnConfigList(list, 0); + } + + /// + /// 获取数据库集合 🔖 + /// + /// + [DisplayName("获取数据库集合")] + public async Task> GetDatabaseList() + { + var dbConfigs = _dbConnectionOptions.ConnectionConfigs; + return await Task.FromResult(dbConfigs.Adapt>()); + } + + /// + /// 获取数据库表(实体)集合 🔖 + /// + /// + [DisplayName("获取数据库表(实体)集合")] + public async Task> GetTableList(string configId = SqlSugarConst.MainConfigId) + { + var provider = _db.AsTenant().GetConnectionScope(configId); + var dbTableInfos = provider.DbMaintenance.GetTableInfoList(false); + + var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => configId.Equals(u.ConfigId)); + + IEnumerable entityInfos = await _codeGenColumnService.GetEntityInfos(); // 获取所有实体定义 + entityInfos = entityInfos.OrderBy(u => u.EntityName.StartsWith("Sys") ? 1 : 0).ThenBy(u => u.EntityName); + + var tableOutputList = new List(); + foreach (var item in entityInfos) + { + var tbConfigId = item.Type.GetCustomAttribute()?.configId as string ?? SqlSugarConst.MainConfigId; + if (item.Type.IsDefined(typeof(LogTableAttribute))) tbConfigId = SqlSugarConst.LogConfigId; + if (tbConfigId != configId) continue; + + var dbTableName = item.DbTableName; + int bracketIndex = dbTableName.IndexOf('{'); + if (bracketIndex != -1) + dbTableName = dbTableName.Substring(0, bracketIndex); + + var table = dbTableInfos.FirstOrDefault(u => u.Name.ToLower().Equals((config != null && config.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(dbTableName) : dbTableName).ToLower())); + if (table == null) continue; + + // 计算字段个数 + var columnCount = 0; + try + { + var columns = await GetColumnListByTableName(table.Name, configId); + columnCount = columns?.Count ?? 0; + } + catch (Exception) + { + // 如果获取字段失败,设为0,不影响主流程 + columnCount = 0; + } + + // 获取程序集名称 + var assemblyName = item.Type.Assembly.ManifestModule.Name ?? ""; + + tableOutputList.Add(new TableOutput + { + ConfigId = configId, + EntityName = item.EntityName, + TableName = table.Name, + TableComment = item.TableDescription, + ColumnCount = columnCount, + AssemblyName = assemblyName + }); + } + return tableOutputList; + } + + /// + /// 根据表名获取列集合 🔖 + /// + /// + [DisplayName("根据表名获取列集合")] + public async Task> GetColumnListByTableName([Required] string tableName, string configId = SqlSugarConst.MainConfigId) + { + // 切库---多库代码生成用 + var provider = _db.AsTenant().GetConnectionScope(configId); + + var config = _dbConnectionOptions.ConnectionConfigs.FirstOrDefault(u => u.ConfigId.ToString() == configId); + // 获取实体类型属性 + tableName = CodeGenHelper.GetRealName(tableName, config); + var entityType = provider.DbMaintenance.GetTableInfoList(false).FirstOrDefault(u => u.Name == tableName); + if (entityType == null) return null; + //var entityBasePropertyNames = _codeGenOptions.EntityBaseColumn[nameof(EntityTenantBaseData)]; + + var entityList = await _codeGenColumnService.GetEntityInfos(); + var entityInfo = entityList.FirstOrDefault(u => CodeGenHelper.GetRealName(u.DbTableName, config).EqualIgnoreCase(tableName)); + if (entityInfo == null) throw new Exception($"未找到实体类型:{tableName}"); + + var entityProps = entityInfo.Type.GetProperties(); + var sugarProperties = entityProps.Where(u => u.GetCustomAttribute()?.IsIgnore == false).Select(u => new + { + PropertyInfo = u, + PropertyName = u.Name, + NetType = u.PropertyType, + EntityInfo = entityInfo, + ColumnComment = u.GetCustomAttribute()?.ColumnDescription, + ColumnName = CodeGenHelper.GetRealName(u.GetCustomAttribute()?.ColumnName ?? u.Name, config), + ForeignProperty = entityProps.FirstOrDefault(w => w.GetCustomAttribute()?.GetName() == u.Name) + }).ToList(); + + // 按原始类型的顺序获取所有实体类型属性(不包含导航属性,会返回null) + var columnList = provider.DbMaintenance.GetColumnInfosByTableName(entityType.Name).Select(u => new ColumnOutput + { + IsNullable = u.IsNullable, + IsPrimarykey = u.IsPrimarykey, + DataType = u.DataType.ToString(), + ColumnComment = u.ColumnDescription, + ColumnName = CodeGenHelper.GetRealName(u.DbColumnName, config), + NetType = CodeGenHelper.ConvertDataType(u, provider.CurrentConnectionConfig.DbType) + }).ToList(); + + foreach (var property in sugarProperties) + { + var column = columnList.FirstOrDefault(u => u.ColumnName == property.ColumnName); + if (column == null) continue; + + column.ColumnComment ??= property.ColumnComment; + column.PropertyName = property.PropertyName; + column.PropertyType = property.NetType; + column.PropertyInfo = property.PropertyInfo; + + // 设置外键配置 + if (property.ForeignProperty != null) + { + column.IsForeignKey = true; + column.ForeignProperty = property.ForeignProperty; + column.ForeignEntityType = property.ForeignProperty.PropertyType.GetGenericArguments().FirstOrDefault() ?? property.ForeignProperty.PropertyType; + } + } + return columnList.Where(u => !string.IsNullOrWhiteSpace(u.PropertyName)).ToList(); + } + + /// + /// 获取程序保存位置 🔖 + /// + /// + [DisplayName("获取程序保存位置")] + public List GetApplicationNamespaces() + { + return _codeGenOptions.BackendApplicationNamespaces; + } + + /// + /// 获取快捷设置外键配置 🔖 + /// + /// + [DisplayName("获取快捷设置外键配置")] + public async Task GetQuickConfigMap() + { + return new + { + sysUser = await GetEffectTreeConfig(u => u.Id, u => u.RealName, u => u.RealName), + sysOrg = await GetEffectTreeConfig(u => u.Id, u => u.Name, u => u.Name, u => u.Pid) + }; + } + + /// + /// 获取联表配置信息 + /// + /// + /// + /// + /// + /// + /// + private async Task GetEffectTreeConfig(Expression> linkExp, Expression> dispExp, Expression> searchExp, Expression> parentExp = null) + { + var entity = _db.EntityMaintenance.GetEntityInfoNoCache(typeof(T)); + var configId = entity.Type.GetCustomAttribute()?.configId?.ToString() ?? SqlSugarConst.MainConfigId; + var provider = _db.AsTenant().GetConnectionScope(configId); + var linkProperty = GetPropertyInfo(linkExp); + var disProperty = GetPropertyInfo(dispExp); + var searchProperty = GetPropertyInfo(searchExp); + var parentProperty = GetPropertyInfo(parentExp); + + // 获取字段对应的 .NET 类型 + var columnNetTypeMap = (await GetColumnListByTableName(entity.Type.Name, configId)) + ?.ToDictionary(u => u.PropertyName, u => u.NetType) ?? new(); + + return new() + { + ConfigId = configId, + EntityName = entity.EntityName, + TableName = entity.DbTableName, + TableComment = entity.TableDescription, + TreeTitle = entity.TableDescription, + LinkPropertyName = linkProperty.Name, + DisplayPropertyNames = disProperty.Name, + SearchPropertyName = searchProperty.Name, + ParentPropertyName = parentProperty?.Name, + LinkPropertyType = columnNetTypeMap.GetValueOrDefault(linkProperty.Name), + SearchPropertyType = columnNetTypeMap.GetValueOrDefault(searchProperty.Name), + ParentPropertyType = columnNetTypeMap.GetValueOrDefault(parentProperty?.Name ?? ""), + }; + } + + /// + /// 获取表达式属性信息 + /// + /// + /// + /// + private PropertyInfo GetPropertyInfo(Expression> expression) + { + if (expression == null) return null; + if (expression.Body is UnaryExpression { Operand: MemberExpression member }) return (PropertyInfo)member.Member; + if (expression.Body is MemberExpression memberExpression) return (PropertyInfo)memberExpression.Member; + throw Oops.Oh("表达式必须是一个属性访问: " + expression); + } + + /// + /// 执行代码生成 🔖 + /// + /// + [DisplayName("执行代码生成")] + public async Task Generate(BaseIdInput input) + { + var codeGen = await GetDetail(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002); + var codeGenStrategy = _codeGenStrategyFactory.GetStrategy(codeGen.Scene); + var templateList = await codeGenStrategy.GenerateCode(codeGen); + + // 删除旧目录 + string outputPath = Path.Combine(App.WebHostEnvironment.WebRootPath, "codeGen", codeGen.ModuleName); + if (Directory.Exists(outputPath)) Directory.Delete(outputPath, true); + + // 输出文件 + foreach (var template in templateList) + { + var dirPath = new DirectoryInfo(template.OutPath).Parent!.FullName; + if (!Directory.Exists(dirPath)) Directory.CreateDirectory(dirPath); + await File.WriteAllTextAsync(template.OutPath, template.Context); + } + + // 生成菜单 + if (codeGen.GenerateMenu) + { + var menuList = await GetMenusByCodeGen(codeGen); + await AddMenu(menuList, codeGen.MenuPid); + } + + // 非下载模式则返回空 + if (!codeGen.GenerateMethod.ToString().StartsWith("DownloadZip")) return null; + + // 删除同名文件 + var downloadPath = outputPath + ".zip"; + if (File.Exists(downloadPath)) File.Delete(downloadPath); + + // 创建压缩文件并下载 + ZipFile.CreateFromDirectory(outputPath, downloadPath); + return new { url = $"{App.HttpContext.Request.Scheme}://{App.HttpContext.Request.Host.Value}/codeGen/{codeGen.ModuleName}.zip" }; + } + + /// + /// 获取代码生成预览 🔖 + /// + /// + [DisplayName("获取代码生成预览")] + public async Task> Preview(BaseIdInput input) + { + var codeGen = await GetDetail(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D1002); + var codeGenStrategy = _codeGenStrategyFactory.GetStrategy(codeGen.Scene); + return (await codeGenStrategy.GenerateCode(codeGen)).ToDictionary(u => u.Name, u => u.Context); + } + + /// + /// 增加菜单 + /// + /// + /// + /// + private async Task AddMenu(List menus, long pid) + { + var first = menus.First(); + var menu = await _db.Queryable().FirstAsync(u => u.Type == first.Type && u.Name == first.Name && u.Pid == first.Pid); + if (menu != null) await _sysMenuService.DeleteMenu(new() { Id = menu.Id }); + + await _db.Insertable(menus).ExecuteCommandAsync(); + + // 删除角色菜单按钮缓存 + _sysCacheService.RemoveByPrefixKey(CacheConst.KeyUserApi); + } + + /// + /// 获取菜单列表 + /// + /// + /// + private async Task> GetMenusByCodeGen(SysCodeGen codeGen) + { + string pPath; + // 若 pid=0 为顶级则创建菜单目录 + SysMenu menuType0 = null; + long tempPid = codeGen.MenuPid; + var menuList = new List(); + var classNameLower = codeGen.ModuleName.ToLower(); + var classNameFirstLower = codeGen.ModuleName.ToFirstLetterLowerCase(); + if (codeGen.MenuPid == 0) + { + // 目录 + menuType0 = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = 0, + Title = codeGen.BusName + "管理", + Type = MenuTypeEnum.Dir, + Icon = "ele-Menu", + Path = $"/{classNameLower}Manage", + Name = classNameFirstLower + "Manage", + Component = "Layout", + OrderNo = 100, + CreateTime = DateTime.Now + }; + codeGen.MenuPid = menuType0.Id; + pPath = menuType0.Path; + } + else + { + var pMenu = await _db.Queryable().FirstAsync(u => u.Id == codeGen.MenuPid) ?? throw Oops.Oh(ErrorCodeEnum.D1505); + pPath = pMenu.Path; + } + + // 菜单 + var menuType = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = codeGen.MenuPid, + Title = codeGen.BusName + "管理", + Name = classNameFirstLower, + Type = MenuTypeEnum.Menu, + Icon = codeGen.MenuIcon, + Path = pPath + "/" + classNameLower, + Component = $"/{codeGen.PagePath}/{classNameFirstLower}/index" + }; + + var menuPid = menuType.Id; + int menuOrder = 100; + // 按钮-page + var menuTypePage = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = menuPid, + Title = "查询", + Type = MenuTypeEnum.Btn, + Permission = classNameFirstLower + "/page", + OrderNo = menuOrder, + CreateTime = DateTime.Now + }; + menuOrder += 10; + menuList.Add(menuTypePage); + + // 按钮-detail + var menuTypeDetail = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = menuPid, + Title = "详情", + Type = MenuTypeEnum.Btn, + Permission = classNameFirstLower + "/detail", + OrderNo = menuOrder, + CreateTime = DateTime.Now + }; + menuOrder += 10; + menuList.Add(menuTypeDetail); + + // 按钮-add + var menuTypeAdd = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = menuPid, + Title = "增加", + Type = MenuTypeEnum.Btn, + Permission = classNameFirstLower + "/add", + OrderNo = menuOrder, + CreateTime = DateTime.Now + }; + menuOrder += 10; + menuList.Add(menuTypeAdd); + + // 按钮-delete + var menuTypeDelete = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = menuPid, + Title = "删除", + Type = MenuTypeEnum.Btn, + Permission = classNameFirstLower + "/delete", + OrderNo = menuOrder, + CreateTime = DateTime.Now + }; + menuOrder += 10; + menuList.Add(menuTypeDelete); + + // 按钮-update + var menuTypeUpdate = new SysMenu + { + Id = YitIdHelper.NextId(), + Pid = menuPid, + Title = "编辑", + Type = MenuTypeEnum.Btn, + Permission = classNameFirstLower + "/update", + OrderNo = menuOrder, + CreateTime = DateTime.Now + }; + menuList.Add(menuTypeUpdate); + menuList.Insert(0, menuType); + if (tempPid == 0) menuList.Insert(0, menuType0); // 顶级目录需要添加目录本身 + return menuList; + } + + /// + /// 验证模板参数 + /// + /// + [NonAction] + public void ValidateTemplateParameters(UpdateCodeGenInput input) + { + switch (input.Scene) + { + case CodeGenSceneEnum.SingleTable: // 单表操作 + break; + + case CodeGenSceneEnum.TreeSingleTable: // 树单表操作 + if (input.TreeConfig == null) throw Oops.Oh(ErrorCodeEnum.D1402); + input.TreeConfig.Adapt().Validate(); + input.Validate(); + break; + } + // 字段组件配置参数校验 + foreach (var column in input.TableList.SelectMany(x => x.ColumnList)) + { + if (column.IsCommon) return; + if (column.EffectType is CodeGenEffectTypeEnum.DictSelector or + CodeGenEffectTypeEnum.EnumSelector or CodeGenEffectTypeEnum.ConstSelector + or CodeGenEffectTypeEnum.ApiTreeSelector or CodeGenEffectTypeEnum.ForeignKey + or CodeGenEffectTypeEnum.Upload or CodeGenEffectTypeEnum.DatePicker && column.Config == null) throw Oops.Oh(ErrorCodeEnum.D1403); + switch (column.EffectType) + { + case CodeGenEffectTypeEnum.DictSelector or CodeGenEffectTypeEnum.EnumSelector or CodeGenEffectTypeEnum.ConstSelector: + JSON.Deserialize(column.Config)?.Validate(); + break; + + case CodeGenEffectTypeEnum.ApiTreeSelector: + JSON.Deserialize(column.Config)?.Validate(); + break; + + case CodeGenEffectTypeEnum.ForeignKey: + JSON.Deserialize(column.Config)?.Validate(); + break; + + case CodeGenEffectTypeEnum.Upload: + JSON.Deserialize(column.Config)?.Validate(); + break; + + case CodeGenEffectTypeEnum.DatePicker: + JSON.Deserialize(column.Config)?.Validate(); + break; + + default: + column.Config = null; + break; + } + } + } } \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs b/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs deleted file mode 100644 index a061431a..00000000 --- a/Admin.NET/Admin.NET.Core/Service/CodeGen/SysCodeGenTemplateService.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。 -// -// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。 -// -// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - -namespace Admin.NET.Core.Service; - -/// -/// 系统代码生成模板配置服务 🧩 -/// -[ApiDescriptionSettings(Order = 260, Description = "代码生成模板配置")] -public class SysCodeGenTemplateService : IDynamicApiController, ITransient -{ - private readonly SqlSugarRepository _codeGenTemplateRep; - - public SysCodeGenTemplateService(SqlSugarRepository codeGenTemplateRep) - { - _codeGenTemplateRep = codeGenTemplateRep; - } - - /// - /// 获取代码生成模板配置列表 🔖 - /// - /// - [DisplayName("获取代码生成模板配置列表")] - public async Task> GetList() - { - return await _codeGenTemplateRep.AsQueryable().Select().ToListAsync(); - } -} \ No newline at end of file diff --git a/Admin.NET/Admin.NET.Core/Utils/System/CodeGenHelper.cs b/Admin.NET/Admin.NET.Core/Utils/System/CodeGenHelper.cs index aa71b300..9da5c42b 100644 --- a/Admin.NET/Admin.NET.Core/Utils/System/CodeGenHelper.cs +++ b/Admin.NET/Admin.NET.Core/Utils/System/CodeGenHelper.cs @@ -13,6 +13,22 @@ namespace Admin.NET.Core; /// public static class CodeGenHelper { + /// + /// .NET与前端类型映射表 + /// + private static readonly Dictionary NetToTypeScriptMap = new() { + { "bool", "boolean" }, + { "int", "number" }, + { "long", "number" }, + { "double", "number" }, + { "float", "number" }, + { "decimal", "number" }, + { "byte", "number" }, + { "datetime", "string" }, + { "guid", "string" }, + { "string", "string" }, + }; + /// /// 转换大驼峰法命名 /// @@ -179,21 +195,18 @@ public static class CodeGenHelper /// /// /// - public static string DataTypeToEff(string dataType) + public static CodeGenEffectTypeEnum DataTypeToEff(string dataType) { - if (string.IsNullOrEmpty(dataType)) return ""; return dataType?.TrimEnd('?') switch { - "string" => "Input", - "int" => "InputNumber", - "long" => "InputNumber", - "float" => "InputNumber", - "double" => "InputNumber", - "decimal" => "InputNumber", - "bool" => "Switch", - "Guid" => "Input", - "DateTime" => "DatePicker", - _ => "Input", + "int" => CodeGenEffectTypeEnum.InputNumber, + "long" => CodeGenEffectTypeEnum.InputNumber, + "float" => CodeGenEffectTypeEnum.InputNumber, + "double" => CodeGenEffectTypeEnum.InputNumber, + "decimal" => CodeGenEffectTypeEnum.InputNumber, + "DateTime" => CodeGenEffectTypeEnum.DatePicker, + "bool" => CodeGenEffectTypeEnum.Switch, + _ => CodeGenEffectTypeEnum.Input, }; } @@ -215,4 +228,35 @@ public static class CodeGenHelper }; return columnList.Contains(columnName); } + + /// + /// 获取数据库中真实名称 + /// + /// + /// + /// + public static string GetRealName(string name, DbConnectionConfig config) + { + if (string.IsNullOrWhiteSpace(name)) return null; + string realName = config!.DbSettings.EnableUnderLine ? UtilMethods.ToUnderLine(name) : name; + if (config.DbType == DbType.PostgreSQL) realName = realName.ToLower(); + return realName; + } + + /// + /// 获取前端类型 + /// + /// + /// 脚本 + public static string GetTypeScriptType(string type) + { + type = type?.Trim().TrimEnd('?').ToLower(); + if (string.IsNullOrWhiteSpace(type)) return ""; + + // 判断是否为枚举 + if (type.EndsWith(nameof(Enum))) return "number"; + + // 其他类型从类型映射表中取 + return NetToTypeScriptMap.TryGetValue(type, out var result) ? result : "any"; + } } \ No newline at end of file diff --git a/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/GoViewSysService.cs b/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/GoViewSysService.cs index 01fe219e..175bdfd4 100644 --- a/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/GoViewSysService.cs +++ b/Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/GoViewSysService.cs @@ -4,6 +4,8 @@ // // 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! +using System.Threading.Tasks; + namespace Admin.NET.Plugin.GoView.Service; /// @@ -77,9 +79,9 @@ public class GoViewSysService : IDynamicApiController /// GoView 退出 🔖 /// [DisplayName("GoView 退出")] - public void GetLogout() + public async Task GetLogout() { - _sysAuthService.Logout(); + await Task.FromResult(_sysAuthService.Logout()); } /// diff --git a/Web/src/api-services/system/api.ts b/Web/src/api-services/system/api.ts index 0d3246cc..313869be 100644 --- a/Web/src/api-services/system/api.ts +++ b/Web/src/api-services/system/api.ts @@ -20,12 +20,10 @@ export * from './apis/sys-alipay-api'; export * from './apis/sys-auth-api'; export * from './apis/sys-cache-api'; export * from './apis/sys-code-gen-api'; -export * from './apis/sys-code-gen-config-api'; -export * from './apis/sys-code-gen-template-api'; +export * from './apis/sys-code-gen-column-api'; export * from './apis/sys-column-custom-api'; export * from './apis/sys-common-api'; export * from './apis/sys-config-api'; -export * from './apis/sys-config-tenant-api'; export * from './apis/sys-const-api'; export * from './apis/sys-database-api'; export * from './apis/sys-db-backup-api'; diff --git a/Web/src/api-services/system/apis/sys-auth-api.ts b/Web/src/api-services/system/apis/sys-auth-api.ts index 972eb481..7e42cccd 100644 --- a/Web/src/api-services/system/apis/sys-auth-api.ts +++ b/Web/src/api-services/system/apis/sys-auth-api.ts @@ -373,7 +373,7 @@ export const SysAuthApiAxiosParamCreator = function (configuration?: Configurati }, /** * - * @summary 获取当前登陆用户信息 🔖 + * @summary 获取登录账号 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -521,7 +521,7 @@ export const SysAuthApiFp = function(configuration?: Configuration) { }, /** * - * @summary 获取当前登陆用户信息 🔖 + * @summary 获取登录账号 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -611,7 +611,7 @@ export const SysAuthApiFactory = function (configuration?: Configuration, basePa }, /** * - * @summary 获取当前登陆用户信息 🔖 + * @summary 获取登录账号 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -705,7 +705,7 @@ export class SysAuthApi extends BaseAPI { } /** * - * @summary 获取当前登陆用户信息 🔖 + * @summary 获取登录账号 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysAuthApi diff --git a/Web/src/api-services/system/apis/sys-code-gen-api.ts b/Web/src/api-services/system/apis/sys-code-gen-api.ts index 78a8c6b2..1cfa47ca 100644 --- a/Web/src/api-services/system/apis/sys-code-gen-api.ts +++ b/Web/src/api-services/system/apis/sys-code-gen-api.ts @@ -19,16 +19,18 @@ import { Configuration } from '../configuration'; import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { AddCodeGenInput } from '../models'; import { AdminNETResultDictionaryStringString } from '../models'; -import { AdminNETResultListColumnOuput } from '../models'; +import { AdminNETResultListColumnOutput } from '../models'; import { AdminNETResultListDatabaseOutput } from '../models'; import { AdminNETResultListString } from '../models'; +import { AdminNETResultListSysCodeGenColumn } from '../models'; import { AdminNETResultListTableOutput } from '../models'; import { AdminNETResultObject } from '../models'; import { AdminNETResultSqlSugarPagedListSysCodeGen } from '../models'; import { AdminNETResultSysCodeGen } from '../models'; -import { DeleteCodeGenInput } from '../models'; +import { AdminNETResultSysCodeGenTable } from '../models'; +import { BaseIdInput } from '../models'; +import { DefaultColumnConfigInput } from '../models'; import { PageCodeGenInput } from '../models'; -import { SysCodeGen } from '../models'; import { UpdateCodeGenInput } from '../models'; /** * SysCodeGenApi - axios parameter creator @@ -184,7 +186,7 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur }, /** * - * @summary 获取数据库库集合 🔖 + * @summary 获取数据库集合 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -227,12 +229,60 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur }, /** * - * @summary 删除代码生成 🔖 - * @param {Array} [body] + * @summary 获取默认表字段配置列表 🔖 + * @param {DefaultColumnConfigInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysCodeGenDeletePost: async (body?: Array, options: AxiosRequestConfig = {}): Promise => { + apiSysCodeGenDefaultColumnConfigListPost: async (body?: DefaultColumnConfigInput, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCodeGen/defaultColumnConfigList`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 删除代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenDeletePost: async (body?: BaseIdInput, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/sysCodeGen/delete`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); @@ -276,7 +326,7 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur /** * * @summary 获取代码生成详情 🔖 - * @param {number} id 代码生成器Id + * @param {number} id 主键Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -325,6 +375,54 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur options: localVarRequestOptions, }; }, + /** + * + * @summary 执行代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenGeneratePost: async (body?: BaseIdInput, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCodeGen/generate`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, /** * * @summary 获取代码生成分页列表 🔖 @@ -376,11 +474,11 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur /** * * @summary 获取代码生成预览 🔖 - * @param {SysCodeGen} [body] + * @param {BaseIdInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysCodeGenPreviewPost: async (body?: SysCodeGen, options: AxiosRequestConfig = {}): Promise => { + apiSysCodeGenPreviewPost: async (body?: BaseIdInput, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/api/sysCodeGen/preview`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); @@ -423,13 +521,56 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur }, /** * - * @summary 执行代码生成 🔖 - * @param {SysCodeGen} [body] + * @summary 获取快捷设置外键配置 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysCodeGenRunLocalPost: async (body?: SysCodeGen, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCodeGen/runLocal`; + apiSysCodeGenQuickConfigMapGet: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCodeGen/quickConfigMap`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 同步代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenSyncPost: async (body?: BaseIdInput, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCodeGen/sync`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; @@ -469,6 +610,58 @@ export const SysCodeGenApiAxiosParamCreator = function (configuration?: Configur options: localVarRequestOptions, }; }, + /** + * + * @summary 获取代码生成表详情 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenTableDetailGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysCodeGenTableDetailGet.'); + } + const localVarPath = `/api/sysCodeGen/tableDetail`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + if (id !== undefined) { + localVarQueryParameter['Id'] = id; + } + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, /** * * @summary 获取数据库表(实体)集合 🔖 @@ -610,7 +803,7 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName: string, configId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + async apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName: string, configId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName, configId, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -619,7 +812,7 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { }, /** * - * @summary 获取数据库库集合 🔖 + * @summary 获取数据库集合 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -632,12 +825,26 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { }, /** * - * @summary 删除代码生成 🔖 - * @param {Array} [body] + * @summary 获取默认表字段配置列表 🔖 + * @param {DefaultColumnConfigInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenDeletePost(body?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + async apiSysCodeGenDefaultColumnConfigListPost(body?: DefaultColumnConfigInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenDefaultColumnConfigListPost(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 删除代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenDeletePost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenDeletePost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -647,7 +854,7 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { /** * * @summary 获取代码生成详情 🔖 - * @param {number} id 代码生成器Id + * @param {number} id 主键Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -658,6 +865,20 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 执行代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenGeneratePost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenGeneratePost(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, /** * * @summary 获取代码生成分页列表 🔖 @@ -675,11 +896,11 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { /** * * @summary 获取代码生成预览 🔖 - * @param {SysCodeGen} [body] + * @param {BaseIdInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenPreviewPost(body?: SysCodeGen, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + async apiSysCodeGenPreviewPost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenPreviewPost(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; @@ -688,13 +909,40 @@ export const SysCodeGenApiFp = function(configuration?: Configuration) { }, /** * - * @summary 执行代码生成 🔖 - * @param {SysCodeGen} [body] + * @summary 获取快捷设置外键配置 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenRunLocalPost(body?: SysCodeGen, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenRunLocalPost(body, options); + async apiSysCodeGenQuickConfigMapGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenQuickConfigMapGet(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 同步代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenSyncPost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenSyncPost(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 获取代码生成表详情 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenTableDetailGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenApiAxiosParamCreator(configuration).apiSysCodeGenTableDetailGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -764,12 +1012,12 @@ export const SysCodeGenApiFactory = function (configuration?: Configuration, bas * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName: string, configId: string, options?: AxiosRequestConfig): Promise> { + async apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName: string, configId: string, options?: AxiosRequestConfig): Promise> { return SysCodeGenApiFp(configuration).apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName, configId, options).then((request) => request(axios, basePath)); }, /** * - * @summary 获取数据库库集合 🔖 + * @summary 获取数据库集合 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -778,24 +1026,44 @@ export const SysCodeGenApiFactory = function (configuration?: Configuration, bas }, /** * - * @summary 删除代码生成 🔖 - * @param {Array} [body] + * @summary 获取默认表字段配置列表 🔖 + * @param {DefaultColumnConfigInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenDeletePost(body?: Array, options?: AxiosRequestConfig): Promise> { + async apiSysCodeGenDefaultColumnConfigListPost(body?: DefaultColumnConfigInput, options?: AxiosRequestConfig): Promise> { + return SysCodeGenApiFp(configuration).apiSysCodeGenDefaultColumnConfigListPost(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 删除代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenDeletePost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise> { return SysCodeGenApiFp(configuration).apiSysCodeGenDeletePost(body, options).then((request) => request(axios, basePath)); }, /** * * @summary 获取代码生成详情 🔖 - * @param {number} id 代码生成器Id + * @param {number} id 主键Id * @param {*} [options] Override http request option. * @throws {RequiredError} */ async apiSysCodeGenDetailGet(id: number, options?: AxiosRequestConfig): Promise> { return SysCodeGenApiFp(configuration).apiSysCodeGenDetailGet(id, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 执行代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenGeneratePost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise> { + return SysCodeGenApiFp(configuration).apiSysCodeGenGeneratePost(body, options).then((request) => request(axios, basePath)); + }, /** * * @summary 获取代码生成分页列表 🔖 @@ -809,22 +1077,41 @@ export const SysCodeGenApiFactory = function (configuration?: Configuration, bas /** * * @summary 获取代码生成预览 🔖 - * @param {SysCodeGen} [body] + * @param {BaseIdInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenPreviewPost(body?: SysCodeGen, options?: AxiosRequestConfig): Promise> { + async apiSysCodeGenPreviewPost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise> { return SysCodeGenApiFp(configuration).apiSysCodeGenPreviewPost(body, options).then((request) => request(axios, basePath)); }, /** * - * @summary 执行代码生成 🔖 - * @param {SysCodeGen} [body] + * @summary 获取快捷设置外键配置 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysCodeGenRunLocalPost(body?: SysCodeGen, options?: AxiosRequestConfig): Promise> { - return SysCodeGenApiFp(configuration).apiSysCodeGenRunLocalPost(body, options).then((request) => request(axios, basePath)); + async apiSysCodeGenQuickConfigMapGet(options?: AxiosRequestConfig): Promise> { + return SysCodeGenApiFp(configuration).apiSysCodeGenQuickConfigMapGet(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 同步代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenSyncPost(body?: BaseIdInput, options?: AxiosRequestConfig): Promise> { + return SysCodeGenApiFp(configuration).apiSysCodeGenSyncPost(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 获取代码生成表详情 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenTableDetailGet(id: number, options?: AxiosRequestConfig): Promise> { + return SysCodeGenApiFp(configuration).apiSysCodeGenTableDetailGet(id, options).then((request) => request(axios, basePath)); }, /** * @@ -886,12 +1173,12 @@ export class SysCodeGenApi extends BaseAPI { * @throws {RequiredError} * @memberof SysCodeGenApi */ - public async apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName: string, configId: string, options?: AxiosRequestConfig) : Promise> { + public async apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName: string, configId: string, options?: AxiosRequestConfig) : Promise> { return SysCodeGenApiFp(this.configuration).apiSysCodeGenColumnListByTableNameTableNameConfigIdGet(tableName, configId, options).then((request) => request(this.axios, this.basePath)); } /** * - * @summary 获取数据库库集合 🔖 + * @summary 获取数据库集合 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysCodeGenApi @@ -901,19 +1188,30 @@ export class SysCodeGenApi extends BaseAPI { } /** * - * @summary 删除代码生成 🔖 - * @param {Array} [body] + * @summary 获取默认表字段配置列表 🔖 + * @param {DefaultColumnConfigInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysCodeGenApi */ - public async apiSysCodeGenDeletePost(body?: Array, options?: AxiosRequestConfig) : Promise> { + public async apiSysCodeGenDefaultColumnConfigListPost(body?: DefaultColumnConfigInput, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenApiFp(this.configuration).apiSysCodeGenDefaultColumnConfigListPost(body, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 删除代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenApi + */ + public async apiSysCodeGenDeletePost(body?: BaseIdInput, options?: AxiosRequestConfig) : Promise> { return SysCodeGenApiFp(this.configuration).apiSysCodeGenDeletePost(body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 获取代码生成详情 🔖 - * @param {number} id 代码生成器Id + * @param {number} id 主键Id * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysCodeGenApi @@ -921,6 +1219,17 @@ export class SysCodeGenApi extends BaseAPI { public async apiSysCodeGenDetailGet(id: number, options?: AxiosRequestConfig) : Promise> { return SysCodeGenApiFp(this.configuration).apiSysCodeGenDetailGet(id, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 执行代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenApi + */ + public async apiSysCodeGenGeneratePost(body?: BaseIdInput, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenApiFp(this.configuration).apiSysCodeGenGeneratePost(body, options).then((request) => request(this.axios, this.basePath)); + } /** * * @summary 获取代码生成分页列表 🔖 @@ -935,24 +1244,45 @@ export class SysCodeGenApi extends BaseAPI { /** * * @summary 获取代码生成预览 🔖 - * @param {SysCodeGen} [body] + * @param {BaseIdInput} [body] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysCodeGenApi */ - public async apiSysCodeGenPreviewPost(body?: SysCodeGen, options?: AxiosRequestConfig) : Promise> { + public async apiSysCodeGenPreviewPost(body?: BaseIdInput, options?: AxiosRequestConfig) : Promise> { return SysCodeGenApiFp(this.configuration).apiSysCodeGenPreviewPost(body, options).then((request) => request(this.axios, this.basePath)); } /** * - * @summary 执行代码生成 🔖 - * @param {SysCodeGen} [body] + * @summary 获取快捷设置外键配置 🔖 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysCodeGenApi */ - public async apiSysCodeGenRunLocalPost(body?: SysCodeGen, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenApiFp(this.configuration).apiSysCodeGenRunLocalPost(body, options).then((request) => request(this.axios, this.basePath)); + public async apiSysCodeGenQuickConfigMapGet(options?: AxiosRequestConfig) : Promise> { + return SysCodeGenApiFp(this.configuration).apiSysCodeGenQuickConfigMapGet(options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 同步代码生成 🔖 + * @param {BaseIdInput} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenApi + */ + public async apiSysCodeGenSyncPost(body?: BaseIdInput, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenApiFp(this.configuration).apiSysCodeGenSyncPost(body, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 获取代码生成表详情 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenApi + */ + public async apiSysCodeGenTableDetailGet(id: number, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenApiFp(this.configuration).apiSysCodeGenTableDetailGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * diff --git a/Web/src/api-services/system/apis/sys-code-gen-column-api.ts b/Web/src/api-services/system/apis/sys-code-gen-column-api.ts new file mode 100644 index 00000000..b1376e4c --- /dev/null +++ b/Web/src/api-services/system/apis/sys-code-gen-column-api.ts @@ -0,0 +1,1077 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; +import { Configuration } from '../configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; +import { AdminNETResultIEnumerableEntityInfo } from '../models'; +import { AdminNETResultListCodeGenColumnConfig } from '../models'; +import { AdminNETResultSysCodeGenColumn } from '../models'; +import { CodeGenEffectTypeEnum } from '../models'; +import { CodeGenFromRuleValidEnum } from '../models'; +import { SysCodeGenColumn } from '../models'; +/** + * SysCodeGenColumnApi - axios parameter creator + * @export + */ +export const SysCodeGenColumnApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary 获取代码生成配置详情 🔖 + * @param {string} dictConfigCode 字典编码 + * @param {string} joinConfigConfigId 外键库标识 + * @param {string} joinConfigEntityName 外键实体名称 + * @param {string} joinConfigTableName 外键表名称 + * @param {string} joinConfigTableComment 表注释 + * @param {string} joinConfigDisplayPropertyNames 外键显示属性名(多选) + * @param {string} joinConfigLinkPropertyName 外键属性名 + * @param {string} joinConfigLinkPropertyType 外键显示属性.NET类型 + * @param {string} dateConfigFormat 格式 + * @param {string} columnName 数据库字段名 + * @param {string} propertyName 实体属性名 + * @param {string} [lowerPropertyName] 首字母小写的属性名 + * @param {boolean} [isDict] 是否字典字段 + * @param {boolean} [isEnum] 是否枚举字段 + * @param {boolean} [isConst] 是否常量字段 + * @param {boolean} [isUpload] 是否上传字段 + * @param {boolean} [isSwitch] 是否开关字段 + * @param {boolean} [isInput] 是否输入框字段 + * @param {boolean} [isInputNumber] 是否数字输入框字段 + * @param {boolean} [isInputTextArea] 是否文本域字段 + * @param {boolean} [isDatePicker] 是否时间选择器字段 + * @param {boolean} [isForeignKey] 是否外键字段 + * @param {boolean} [isTree] 是否树字段 + * @param {boolean} [multiple] 是否多选字段 + * @param {boolean} [isUnique] 是否唯一字段 + * @param {boolean} [isStatus] 状态字段 + * @param {boolean} [hasJoinTable] 是否要联表 + * @param {boolean} [hasSlots] 是否要插槽 + * @param {string} [leftJoinAliasName] 连表别名 + * @param {boolean} [fileConfigUseDownload] 链接预览 + * @param {string} [fileConfigDownloadText] 链接文本 + * @param {boolean} [fileConfigIsImage] 是否图片 + * @param {boolean} [dictConfigMultiple] 是否多选 + * @param {string} [joinConfigTreeTitle] 树组件标题不能为空 + * @param {string} [joinConfigParentPropertyName] 父属性名称 + * @param {string} [joinConfigParentPropertyType] 父属性.NET类型 + * @param {string} [joinConfigLowerEntityName] 首字母小写实体名称 + * @param {string} [joinConfigFirstDisplayName] 首位外键显示属性名 + * @param {string} [joinConfigLowerFirstDisplayName] 首字母小写首位外键显示属性名 + * @param {string} [joinConfigLowerLinkPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyName] 用于检索的属性名 + * @param {string} [joinConfigLowerSearchPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyType] 用于检索的属性.NET类型 + * @param {boolean} [joinConfigUseTable] 是否使用表格 + * @param {boolean} [joinConfigMultiple] 是否多选 + * @param {string} [dateConfigDefault] 默认值 + * @param {string} [nullableNetType] 获取可空类型 + * @param {string} [displayPropertyNames] 显示字段 + * @param {string} [leftJoinPropertyName] 连表属性名称 + * @param {string} [getVxeColumnExtraConfig] 获取列格式化配置方法 + * @param {string} [getFormRules] 获取表单验证规则 + * @param {number} [codeGenTableId] 代码生成表Id + * @param {string} [netType] .NET数据类型 + * @param {string} [dataType] 数据库中类型(物理类型) + * @param {number} [columnLength] 字段数据长度 + * @param {string} [columnComment] 字段描述 + * @param {CodeGenEffectTypeEnum} [effectType] 控件类型 + * @param {string} [config] 控件配置 + * @param {boolean} [isPrimarykey] 主键 + * @param {boolean} [isCommon] 是否通用字段 + * @param {boolean} [isRequired] 是否必填 + * @param {boolean} [isAddUpdate] 增改 + * @param {boolean} [isImport] 导入导出 + * @param {boolean} [isSortable] 是否可排序 + * @param {boolean} [isStatistical] 是否是统计字段 + * @param {boolean} [isQuery] 是否是查询条件 + * @param {string} [queryType] 查询方式 + * @param {boolean} [isTable] 列表显示 + * @param {boolean} [isCopy] 内容复制 + * @param {string} [defaultValue] 默认值 + * @param {CodeGenFromRuleValidEnum} [fromValid] 字段验证规则 + * @param {number} [orderNo] 排序 + * @param {Date} [createTime] 创建时间 + * @param {Date} [updateTime] 更新时间 + * @param {number} [createUserId] 创建者Id + * @param {string} [createUserName] 创建者姓名 + * @param {number} [updateUserId] 修改者Id + * @param {string} [updateUserName] 修改者姓名 + * @param {boolean} [isDelete] 软删除 + * @param {number} [id] 雪花Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenColumnDetailGet: async (dictConfigCode: string, joinConfigConfigId: string, joinConfigEntityName: string, joinConfigTableName: string, joinConfigTableComment: string, joinConfigDisplayPropertyNames: string, joinConfigLinkPropertyName: string, joinConfigLinkPropertyType: string, dateConfigFormat: string, columnName: string, propertyName: string, lowerPropertyName?: string, isDict?: boolean, isEnum?: boolean, isConst?: boolean, isUpload?: boolean, isSwitch?: boolean, isInput?: boolean, isInputNumber?: boolean, isInputTextArea?: boolean, isDatePicker?: boolean, isForeignKey?: boolean, isTree?: boolean, multiple?: boolean, isUnique?: boolean, isStatus?: boolean, hasJoinTable?: boolean, hasSlots?: boolean, leftJoinAliasName?: string, fileConfigUseDownload?: boolean, fileConfigDownloadText?: string, fileConfigIsImage?: boolean, dictConfigMultiple?: boolean, joinConfigTreeTitle?: string, joinConfigParentPropertyName?: string, joinConfigParentPropertyType?: string, joinConfigLowerEntityName?: string, joinConfigFirstDisplayName?: string, joinConfigLowerFirstDisplayName?: string, joinConfigLowerLinkPropertyName?: string, joinConfigSearchPropertyName?: string, joinConfigLowerSearchPropertyName?: string, joinConfigSearchPropertyType?: string, joinConfigUseTable?: boolean, joinConfigMultiple?: boolean, dateConfigDefault?: string, nullableNetType?: string, displayPropertyNames?: string, leftJoinPropertyName?: string, getVxeColumnExtraConfig?: string, getFormRules?: string, codeGenTableId?: number, netType?: string, dataType?: string, columnLength?: number, columnComment?: string, effectType?: CodeGenEffectTypeEnum, config?: string, isPrimarykey?: boolean, isCommon?: boolean, isRequired?: boolean, isAddUpdate?: boolean, isImport?: boolean, isSortable?: boolean, isStatistical?: boolean, isQuery?: boolean, queryType?: string, isTable?: boolean, isCopy?: boolean, defaultValue?: string, fromValid?: CodeGenFromRuleValidEnum, orderNo?: number, createTime?: Date, updateTime?: Date, createUserId?: number, createUserName?: string, updateUserId?: number, updateUserName?: string, isDelete?: boolean, id?: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'dictConfigCode' is not null or undefined + if (dictConfigCode === null || dictConfigCode === undefined) { + throw new RequiredError('dictConfigCode','Required parameter dictConfigCode was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigConfigId' is not null or undefined + if (joinConfigConfigId === null || joinConfigConfigId === undefined) { + throw new RequiredError('joinConfigConfigId','Required parameter joinConfigConfigId was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigEntityName' is not null or undefined + if (joinConfigEntityName === null || joinConfigEntityName === undefined) { + throw new RequiredError('joinConfigEntityName','Required parameter joinConfigEntityName was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigTableName' is not null or undefined + if (joinConfigTableName === null || joinConfigTableName === undefined) { + throw new RequiredError('joinConfigTableName','Required parameter joinConfigTableName was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigTableComment' is not null or undefined + if (joinConfigTableComment === null || joinConfigTableComment === undefined) { + throw new RequiredError('joinConfigTableComment','Required parameter joinConfigTableComment was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigDisplayPropertyNames' is not null or undefined + if (joinConfigDisplayPropertyNames === null || joinConfigDisplayPropertyNames === undefined) { + throw new RequiredError('joinConfigDisplayPropertyNames','Required parameter joinConfigDisplayPropertyNames was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigLinkPropertyName' is not null or undefined + if (joinConfigLinkPropertyName === null || joinConfigLinkPropertyName === undefined) { + throw new RequiredError('joinConfigLinkPropertyName','Required parameter joinConfigLinkPropertyName was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'joinConfigLinkPropertyType' is not null or undefined + if (joinConfigLinkPropertyType === null || joinConfigLinkPropertyType === undefined) { + throw new RequiredError('joinConfigLinkPropertyType','Required parameter joinConfigLinkPropertyType was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'dateConfigFormat' is not null or undefined + if (dateConfigFormat === null || dateConfigFormat === undefined) { + throw new RequiredError('dateConfigFormat','Required parameter dateConfigFormat was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'columnName' is not null or undefined + if (columnName === null || columnName === undefined) { + throw new RequiredError('columnName','Required parameter columnName was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + // verify required parameter 'propertyName' is not null or undefined + if (propertyName === null || propertyName === undefined) { + throw new RequiredError('propertyName','Required parameter propertyName was null or undefined when calling apiSysCodeGenColumnDetailGet.'); + } + const localVarPath = `/api/sysCodeGenColumn/detail`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + if (lowerPropertyName !== undefined) { + localVarQueryParameter['LowerPropertyName'] = lowerPropertyName; + } + + if (isDict !== undefined) { + localVarQueryParameter['IsDict'] = isDict; + } + + if (isEnum !== undefined) { + localVarQueryParameter['IsEnum'] = isEnum; + } + + if (isConst !== undefined) { + localVarQueryParameter['IsConst'] = isConst; + } + + if (isUpload !== undefined) { + localVarQueryParameter['IsUpload'] = isUpload; + } + + if (isSwitch !== undefined) { + localVarQueryParameter['IsSwitch'] = isSwitch; + } + + if (isInput !== undefined) { + localVarQueryParameter['IsInput'] = isInput; + } + + if (isInputNumber !== undefined) { + localVarQueryParameter['IsInputNumber'] = isInputNumber; + } + + if (isInputTextArea !== undefined) { + localVarQueryParameter['IsInputTextArea'] = isInputTextArea; + } + + if (isDatePicker !== undefined) { + localVarQueryParameter['IsDatePicker'] = isDatePicker; + } + + if (isForeignKey !== undefined) { + localVarQueryParameter['IsForeignKey'] = isForeignKey; + } + + if (isTree !== undefined) { + localVarQueryParameter['IsTree'] = isTree; + } + + if (multiple !== undefined) { + localVarQueryParameter['Multiple'] = multiple; + } + + if (isUnique !== undefined) { + localVarQueryParameter['IsUnique'] = isUnique; + } + + if (isStatus !== undefined) { + localVarQueryParameter['IsStatus'] = isStatus; + } + + if (hasJoinTable !== undefined) { + localVarQueryParameter['HasJoinTable'] = hasJoinTable; + } + + if (hasSlots !== undefined) { + localVarQueryParameter['HasSlots'] = hasSlots; + } + + if (leftJoinAliasName !== undefined) { + localVarQueryParameter['LeftJoinAliasName'] = leftJoinAliasName; + } + + if (fileConfigUseDownload !== undefined) { + localVarQueryParameter['FileConfig.UseDownload'] = fileConfigUseDownload; + } + + if (fileConfigDownloadText !== undefined) { + localVarQueryParameter['FileConfig.DownloadText'] = fileConfigDownloadText; + } + + if (fileConfigIsImage !== undefined) { + localVarQueryParameter['FileConfig.IsImage'] = fileConfigIsImage; + } + + if (dictConfigCode !== undefined) { + localVarQueryParameter['DictConfig.Code'] = dictConfigCode; + } + + if (dictConfigMultiple !== undefined) { + localVarQueryParameter['DictConfig.Multiple'] = dictConfigMultiple; + } + + if (joinConfigTreeTitle !== undefined) { + localVarQueryParameter['JoinConfig.TreeTitle'] = joinConfigTreeTitle; + } + + if (joinConfigParentPropertyName !== undefined) { + localVarQueryParameter['JoinConfig.ParentPropertyName'] = joinConfigParentPropertyName; + } + + if (joinConfigParentPropertyType !== undefined) { + localVarQueryParameter['JoinConfig.ParentPropertyType'] = joinConfigParentPropertyType; + } + + if (joinConfigConfigId !== undefined) { + localVarQueryParameter['JoinConfig.ConfigId'] = joinConfigConfigId; + } + + if (joinConfigEntityName !== undefined) { + localVarQueryParameter['JoinConfig.EntityName'] = joinConfigEntityName; + } + + if (joinConfigLowerEntityName !== undefined) { + localVarQueryParameter['JoinConfig.LowerEntityName'] = joinConfigLowerEntityName; + } + + if (joinConfigTableName !== undefined) { + localVarQueryParameter['JoinConfig.TableName'] = joinConfigTableName; + } + + if (joinConfigTableComment !== undefined) { + localVarQueryParameter['JoinConfig.TableComment'] = joinConfigTableComment; + } + + if (joinConfigDisplayPropertyNames !== undefined) { + localVarQueryParameter['JoinConfig.DisplayPropertyNames'] = joinConfigDisplayPropertyNames; + } + + if (joinConfigFirstDisplayName !== undefined) { + localVarQueryParameter['JoinConfig.FirstDisplayName'] = joinConfigFirstDisplayName; + } + + if (joinConfigLowerFirstDisplayName !== undefined) { + localVarQueryParameter['JoinConfig.LowerFirstDisplayName'] = joinConfigLowerFirstDisplayName; + } + + if (joinConfigLinkPropertyName !== undefined) { + localVarQueryParameter['JoinConfig.LinkPropertyName'] = joinConfigLinkPropertyName; + } + + if (joinConfigLowerLinkPropertyName !== undefined) { + localVarQueryParameter['JoinConfig.LowerLinkPropertyName'] = joinConfigLowerLinkPropertyName; + } + + if (joinConfigLinkPropertyType !== undefined) { + localVarQueryParameter['JoinConfig.LinkPropertyType'] = joinConfigLinkPropertyType; + } + + if (joinConfigSearchPropertyName !== undefined) { + localVarQueryParameter['JoinConfig.SearchPropertyName'] = joinConfigSearchPropertyName; + } + + if (joinConfigLowerSearchPropertyName !== undefined) { + localVarQueryParameter['JoinConfig.LowerSearchPropertyName'] = joinConfigLowerSearchPropertyName; + } + + if (joinConfigSearchPropertyType !== undefined) { + localVarQueryParameter['JoinConfig.SearchPropertyType'] = joinConfigSearchPropertyType; + } + + if (joinConfigUseTable !== undefined) { + localVarQueryParameter['JoinConfig.UseTable'] = joinConfigUseTable; + } + + if (joinConfigMultiple !== undefined) { + localVarQueryParameter['JoinConfig.Multiple'] = joinConfigMultiple; + } + + if (dateConfigFormat !== undefined) { + localVarQueryParameter['DateConfig.Format'] = dateConfigFormat; + } + + if (dateConfigDefault !== undefined) { + localVarQueryParameter['DateConfig.Default'] = dateConfigDefault; + } + + if (nullableNetType !== undefined) { + localVarQueryParameter['NullableNetType'] = nullableNetType; + } + + if (displayPropertyNames !== undefined) { + localVarQueryParameter['DisplayPropertyNames'] = displayPropertyNames; + } + + if (leftJoinPropertyName !== undefined) { + localVarQueryParameter['LeftJoinPropertyName'] = leftJoinPropertyName; + } + + if (getVxeColumnExtraConfig !== undefined) { + localVarQueryParameter['GetVxeColumnExtraConfig'] = getVxeColumnExtraConfig; + } + + if (getFormRules !== undefined) { + localVarQueryParameter['GetFormRules'] = getFormRules; + } + + if (codeGenTableId !== undefined) { + localVarQueryParameter['CodeGenTableId'] = codeGenTableId; + } + + if (columnName !== undefined) { + localVarQueryParameter['ColumnName'] = columnName; + } + + if (propertyName !== undefined) { + localVarQueryParameter['PropertyName'] = propertyName; + } + + if (netType !== undefined) { + localVarQueryParameter['NetType'] = netType; + } + + if (dataType !== undefined) { + localVarQueryParameter['DataType'] = dataType; + } + + if (columnLength !== undefined) { + localVarQueryParameter['ColumnLength'] = columnLength; + } + + if (columnComment !== undefined) { + localVarQueryParameter['ColumnComment'] = columnComment; + } + + if (effectType !== undefined) { + localVarQueryParameter['EffectType'] = effectType; + } + + if (config !== undefined) { + localVarQueryParameter['Config'] = config; + } + + if (isPrimarykey !== undefined) { + localVarQueryParameter['IsPrimarykey'] = isPrimarykey; + } + + if (isCommon !== undefined) { + localVarQueryParameter['IsCommon'] = isCommon; + } + + if (isRequired !== undefined) { + localVarQueryParameter['IsRequired'] = isRequired; + } + + if (isAddUpdate !== undefined) { + localVarQueryParameter['IsAddUpdate'] = isAddUpdate; + } + + if (isImport !== undefined) { + localVarQueryParameter['IsImport'] = isImport; + } + + if (isSortable !== undefined) { + localVarQueryParameter['IsSortable'] = isSortable; + } + + if (isStatistical !== undefined) { + localVarQueryParameter['IsStatistical'] = isStatistical; + } + + if (isQuery !== undefined) { + localVarQueryParameter['IsQuery'] = isQuery; + } + + if (queryType !== undefined) { + localVarQueryParameter['QueryType'] = queryType; + } + + if (isTable !== undefined) { + localVarQueryParameter['IsTable'] = isTable; + } + + if (isCopy !== undefined) { + localVarQueryParameter['IsCopy'] = isCopy; + } + + if (defaultValue !== undefined) { + localVarQueryParameter['DefaultValue'] = defaultValue; + } + + if (fromValid !== undefined) { + localVarQueryParameter['FromValid'] = fromValid; + } + + if (orderNo !== undefined) { + localVarQueryParameter['OrderNo'] = orderNo; + } + + if (createTime !== undefined) { + localVarQueryParameter['CreateTime'] = (createTime as any instanceof Date) ? + (createTime as any).toISOString() : + createTime; + } + + if (updateTime !== undefined) { + localVarQueryParameter['UpdateTime'] = (updateTime as any instanceof Date) ? + (updateTime as any).toISOString() : + updateTime; + } + + if (createUserId !== undefined) { + localVarQueryParameter['CreateUserId'] = createUserId; + } + + if (createUserName !== undefined) { + localVarQueryParameter['CreateUserName'] = createUserName; + } + + if (updateUserId !== undefined) { + localVarQueryParameter['UpdateUserId'] = updateUserId; + } + + if (updateUserName !== undefined) { + localVarQueryParameter['UpdateUserName'] = updateUserName; + } + + if (isDelete !== undefined) { + localVarQueryParameter['IsDelete'] = isDelete; + } + + if (id !== undefined) { + localVarQueryParameter['Id'] = id; + } + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenColumnEntityInfosExcludeSysTableGet: async (excludeSysTable: boolean, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'excludeSysTable' is not null or undefined + if (excludeSysTable === null || excludeSysTable === undefined) { + throw new RequiredError('excludeSysTable','Required parameter excludeSysTable was null or undefined when calling apiSysCodeGenColumnEntityInfosExcludeSysTableGet.'); + } + const localVarPath = `/api/sysCodeGenColumn/entityInfos/{excludeSysTable}` + .replace(`{${"excludeSysTable"}}`, encodeURIComponent(String(excludeSysTable))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 获取代码生成配置列表 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenColumnListGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysCodeGenColumnListGet.'); + } + const localVarPath = `/api/sysCodeGenColumn/list`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + if (id !== undefined) { + localVarQueryParameter['Id'] = id; + } + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 更新代码生成配置 🔖 + * @param {Array} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCodeGenColumnUpdatePost: async (body?: Array, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCodeGenColumn/update`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; + localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * SysCodeGenColumnApi - functional programming interface + * @export + */ +export const SysCodeGenColumnApiFp = function(configuration?: Configuration) { + return { + /** + * + * @summary 获取代码生成配置详情 🔖 + * @param {string} dictConfigCode 字典编码 + * @param {string} joinConfigConfigId 外键库标识 + * @param {string} joinConfigEntityName 外键实体名称 + * @param {string} joinConfigTableName 外键表名称 + * @param {string} joinConfigTableComment 表注释 + * @param {string} joinConfigDisplayPropertyNames 外键显示属性名(多选) + * @param {string} joinConfigLinkPropertyName 外键属性名 + * @param {string} joinConfigLinkPropertyType 外键显示属性.NET类型 + * @param {string} dateConfigFormat 格式 + * @param {string} columnName 数据库字段名 + * @param {string} propertyName 实体属性名 + * @param {string} [lowerPropertyName] 首字母小写的属性名 + * @param {boolean} [isDict] 是否字典字段 + * @param {boolean} [isEnum] 是否枚举字段 + * @param {boolean} [isConst] 是否常量字段 + * @param {boolean} [isUpload] 是否上传字段 + * @param {boolean} [isSwitch] 是否开关字段 + * @param {boolean} [isInput] 是否输入框字段 + * @param {boolean} [isInputNumber] 是否数字输入框字段 + * @param {boolean} [isInputTextArea] 是否文本域字段 + * @param {boolean} [isDatePicker] 是否时间选择器字段 + * @param {boolean} [isForeignKey] 是否外键字段 + * @param {boolean} [isTree] 是否树字段 + * @param {boolean} [multiple] 是否多选字段 + * @param {boolean} [isUnique] 是否唯一字段 + * @param {boolean} [isStatus] 状态字段 + * @param {boolean} [hasJoinTable] 是否要联表 + * @param {boolean} [hasSlots] 是否要插槽 + * @param {string} [leftJoinAliasName] 连表别名 + * @param {boolean} [fileConfigUseDownload] 链接预览 + * @param {string} [fileConfigDownloadText] 链接文本 + * @param {boolean} [fileConfigIsImage] 是否图片 + * @param {boolean} [dictConfigMultiple] 是否多选 + * @param {string} [joinConfigTreeTitle] 树组件标题不能为空 + * @param {string} [joinConfigParentPropertyName] 父属性名称 + * @param {string} [joinConfigParentPropertyType] 父属性.NET类型 + * @param {string} [joinConfigLowerEntityName] 首字母小写实体名称 + * @param {string} [joinConfigFirstDisplayName] 首位外键显示属性名 + * @param {string} [joinConfigLowerFirstDisplayName] 首字母小写首位外键显示属性名 + * @param {string} [joinConfigLowerLinkPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyName] 用于检索的属性名 + * @param {string} [joinConfigLowerSearchPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyType] 用于检索的属性.NET类型 + * @param {boolean} [joinConfigUseTable] 是否使用表格 + * @param {boolean} [joinConfigMultiple] 是否多选 + * @param {string} [dateConfigDefault] 默认值 + * @param {string} [nullableNetType] 获取可空类型 + * @param {string} [displayPropertyNames] 显示字段 + * @param {string} [leftJoinPropertyName] 连表属性名称 + * @param {string} [getVxeColumnExtraConfig] 获取列格式化配置方法 + * @param {string} [getFormRules] 获取表单验证规则 + * @param {number} [codeGenTableId] 代码生成表Id + * @param {string} [netType] .NET数据类型 + * @param {string} [dataType] 数据库中类型(物理类型) + * @param {number} [columnLength] 字段数据长度 + * @param {string} [columnComment] 字段描述 + * @param {CodeGenEffectTypeEnum} [effectType] 控件类型 + * @param {string} [config] 控件配置 + * @param {boolean} [isPrimarykey] 主键 + * @param {boolean} [isCommon] 是否通用字段 + * @param {boolean} [isRequired] 是否必填 + * @param {boolean} [isAddUpdate] 增改 + * @param {boolean} [isImport] 导入导出 + * @param {boolean} [isSortable] 是否可排序 + * @param {boolean} [isStatistical] 是否是统计字段 + * @param {boolean} [isQuery] 是否是查询条件 + * @param {string} [queryType] 查询方式 + * @param {boolean} [isTable] 列表显示 + * @param {boolean} [isCopy] 内容复制 + * @param {string} [defaultValue] 默认值 + * @param {CodeGenFromRuleValidEnum} [fromValid] 字段验证规则 + * @param {number} [orderNo] 排序 + * @param {Date} [createTime] 创建时间 + * @param {Date} [updateTime] 更新时间 + * @param {number} [createUserId] 创建者Id + * @param {string} [createUserName] 创建者姓名 + * @param {number} [updateUserId] 修改者Id + * @param {string} [updateUserName] 修改者姓名 + * @param {boolean} [isDelete] 软删除 + * @param {number} [id] 雪花Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnDetailGet(dictConfigCode: string, joinConfigConfigId: string, joinConfigEntityName: string, joinConfigTableName: string, joinConfigTableComment: string, joinConfigDisplayPropertyNames: string, joinConfigLinkPropertyName: string, joinConfigLinkPropertyType: string, dateConfigFormat: string, columnName: string, propertyName: string, lowerPropertyName?: string, isDict?: boolean, isEnum?: boolean, isConst?: boolean, isUpload?: boolean, isSwitch?: boolean, isInput?: boolean, isInputNumber?: boolean, isInputTextArea?: boolean, isDatePicker?: boolean, isForeignKey?: boolean, isTree?: boolean, multiple?: boolean, isUnique?: boolean, isStatus?: boolean, hasJoinTable?: boolean, hasSlots?: boolean, leftJoinAliasName?: string, fileConfigUseDownload?: boolean, fileConfigDownloadText?: string, fileConfigIsImage?: boolean, dictConfigMultiple?: boolean, joinConfigTreeTitle?: string, joinConfigParentPropertyName?: string, joinConfigParentPropertyType?: string, joinConfigLowerEntityName?: string, joinConfigFirstDisplayName?: string, joinConfigLowerFirstDisplayName?: string, joinConfigLowerLinkPropertyName?: string, joinConfigSearchPropertyName?: string, joinConfigLowerSearchPropertyName?: string, joinConfigSearchPropertyType?: string, joinConfigUseTable?: boolean, joinConfigMultiple?: boolean, dateConfigDefault?: string, nullableNetType?: string, displayPropertyNames?: string, leftJoinPropertyName?: string, getVxeColumnExtraConfig?: string, getFormRules?: string, codeGenTableId?: number, netType?: string, dataType?: string, columnLength?: number, columnComment?: string, effectType?: CodeGenEffectTypeEnum, config?: string, isPrimarykey?: boolean, isCommon?: boolean, isRequired?: boolean, isAddUpdate?: boolean, isImport?: boolean, isSortable?: boolean, isStatistical?: boolean, isQuery?: boolean, queryType?: string, isTable?: boolean, isCopy?: boolean, defaultValue?: string, fromValid?: CodeGenFromRuleValidEnum, orderNo?: number, createTime?: Date, updateTime?: Date, createUserId?: number, createUserName?: string, updateUserId?: number, updateUserName?: string, isDelete?: boolean, id?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenColumnApiAxiosParamCreator(configuration).apiSysCodeGenColumnDetailGet(dictConfigCode, joinConfigConfigId, joinConfigEntityName, joinConfigTableName, joinConfigTableComment, joinConfigDisplayPropertyNames, joinConfigLinkPropertyName, joinConfigLinkPropertyType, dateConfigFormat, columnName, propertyName, lowerPropertyName, isDict, isEnum, isConst, isUpload, isSwitch, isInput, isInputNumber, isInputTextArea, isDatePicker, isForeignKey, isTree, multiple, isUnique, isStatus, hasJoinTable, hasSlots, leftJoinAliasName, fileConfigUseDownload, fileConfigDownloadText, fileConfigIsImage, dictConfigMultiple, joinConfigTreeTitle, joinConfigParentPropertyName, joinConfigParentPropertyType, joinConfigLowerEntityName, joinConfigFirstDisplayName, joinConfigLowerFirstDisplayName, joinConfigLowerLinkPropertyName, joinConfigSearchPropertyName, joinConfigLowerSearchPropertyName, joinConfigSearchPropertyType, joinConfigUseTable, joinConfigMultiple, dateConfigDefault, nullableNetType, displayPropertyNames, leftJoinPropertyName, getVxeColumnExtraConfig, getFormRules, codeGenTableId, netType, dataType, columnLength, columnComment, effectType, config, isPrimarykey, isCommon, isRequired, isAddUpdate, isImport, isSortable, isStatistical, isQuery, queryType, isTable, isCopy, defaultValue, fromValid, orderNo, createTime, updateTime, createUserId, createUserName, updateUserId, updateUserName, isDelete, id, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenColumnApiAxiosParamCreator(configuration).apiSysCodeGenColumnEntityInfosExcludeSysTableGet(excludeSysTable, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 获取代码生成配置列表 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnListGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenColumnApiAxiosParamCreator(configuration).apiSysCodeGenColumnListGet(id, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + /** + * + * @summary 更新代码生成配置 🔖 + * @param {Array} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnUpdatePost(body?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCodeGenColumnApiAxiosParamCreator(configuration).apiSysCodeGenColumnUpdatePost(body, options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, + } +}; + +/** + * SysCodeGenColumnApi - factory interface + * @export + */ +export const SysCodeGenColumnApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + return { + /** + * + * @summary 获取代码生成配置详情 🔖 + * @param {string} dictConfigCode 字典编码 + * @param {string} joinConfigConfigId 外键库标识 + * @param {string} joinConfigEntityName 外键实体名称 + * @param {string} joinConfigTableName 外键表名称 + * @param {string} joinConfigTableComment 表注释 + * @param {string} joinConfigDisplayPropertyNames 外键显示属性名(多选) + * @param {string} joinConfigLinkPropertyName 外键属性名 + * @param {string} joinConfigLinkPropertyType 外键显示属性.NET类型 + * @param {string} dateConfigFormat 格式 + * @param {string} columnName 数据库字段名 + * @param {string} propertyName 实体属性名 + * @param {string} [lowerPropertyName] 首字母小写的属性名 + * @param {boolean} [isDict] 是否字典字段 + * @param {boolean} [isEnum] 是否枚举字段 + * @param {boolean} [isConst] 是否常量字段 + * @param {boolean} [isUpload] 是否上传字段 + * @param {boolean} [isSwitch] 是否开关字段 + * @param {boolean} [isInput] 是否输入框字段 + * @param {boolean} [isInputNumber] 是否数字输入框字段 + * @param {boolean} [isInputTextArea] 是否文本域字段 + * @param {boolean} [isDatePicker] 是否时间选择器字段 + * @param {boolean} [isForeignKey] 是否外键字段 + * @param {boolean} [isTree] 是否树字段 + * @param {boolean} [multiple] 是否多选字段 + * @param {boolean} [isUnique] 是否唯一字段 + * @param {boolean} [isStatus] 状态字段 + * @param {boolean} [hasJoinTable] 是否要联表 + * @param {boolean} [hasSlots] 是否要插槽 + * @param {string} [leftJoinAliasName] 连表别名 + * @param {boolean} [fileConfigUseDownload] 链接预览 + * @param {string} [fileConfigDownloadText] 链接文本 + * @param {boolean} [fileConfigIsImage] 是否图片 + * @param {boolean} [dictConfigMultiple] 是否多选 + * @param {string} [joinConfigTreeTitle] 树组件标题不能为空 + * @param {string} [joinConfigParentPropertyName] 父属性名称 + * @param {string} [joinConfigParentPropertyType] 父属性.NET类型 + * @param {string} [joinConfigLowerEntityName] 首字母小写实体名称 + * @param {string} [joinConfigFirstDisplayName] 首位外键显示属性名 + * @param {string} [joinConfigLowerFirstDisplayName] 首字母小写首位外键显示属性名 + * @param {string} [joinConfigLowerLinkPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyName] 用于检索的属性名 + * @param {string} [joinConfigLowerSearchPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyType] 用于检索的属性.NET类型 + * @param {boolean} [joinConfigUseTable] 是否使用表格 + * @param {boolean} [joinConfigMultiple] 是否多选 + * @param {string} [dateConfigDefault] 默认值 + * @param {string} [nullableNetType] 获取可空类型 + * @param {string} [displayPropertyNames] 显示字段 + * @param {string} [leftJoinPropertyName] 连表属性名称 + * @param {string} [getVxeColumnExtraConfig] 获取列格式化配置方法 + * @param {string} [getFormRules] 获取表单验证规则 + * @param {number} [codeGenTableId] 代码生成表Id + * @param {string} [netType] .NET数据类型 + * @param {string} [dataType] 数据库中类型(物理类型) + * @param {number} [columnLength] 字段数据长度 + * @param {string} [columnComment] 字段描述 + * @param {CodeGenEffectTypeEnum} [effectType] 控件类型 + * @param {string} [config] 控件配置 + * @param {boolean} [isPrimarykey] 主键 + * @param {boolean} [isCommon] 是否通用字段 + * @param {boolean} [isRequired] 是否必填 + * @param {boolean} [isAddUpdate] 增改 + * @param {boolean} [isImport] 导入导出 + * @param {boolean} [isSortable] 是否可排序 + * @param {boolean} [isStatistical] 是否是统计字段 + * @param {boolean} [isQuery] 是否是查询条件 + * @param {string} [queryType] 查询方式 + * @param {boolean} [isTable] 列表显示 + * @param {boolean} [isCopy] 内容复制 + * @param {string} [defaultValue] 默认值 + * @param {CodeGenFromRuleValidEnum} [fromValid] 字段验证规则 + * @param {number} [orderNo] 排序 + * @param {Date} [createTime] 创建时间 + * @param {Date} [updateTime] 更新时间 + * @param {number} [createUserId] 创建者Id + * @param {string} [createUserName] 创建者姓名 + * @param {number} [updateUserId] 修改者Id + * @param {string} [updateUserName] 修改者姓名 + * @param {boolean} [isDelete] 软删除 + * @param {number} [id] 雪花Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnDetailGet(dictConfigCode: string, joinConfigConfigId: string, joinConfigEntityName: string, joinConfigTableName: string, joinConfigTableComment: string, joinConfigDisplayPropertyNames: string, joinConfigLinkPropertyName: string, joinConfigLinkPropertyType: string, dateConfigFormat: string, columnName: string, propertyName: string, lowerPropertyName?: string, isDict?: boolean, isEnum?: boolean, isConst?: boolean, isUpload?: boolean, isSwitch?: boolean, isInput?: boolean, isInputNumber?: boolean, isInputTextArea?: boolean, isDatePicker?: boolean, isForeignKey?: boolean, isTree?: boolean, multiple?: boolean, isUnique?: boolean, isStatus?: boolean, hasJoinTable?: boolean, hasSlots?: boolean, leftJoinAliasName?: string, fileConfigUseDownload?: boolean, fileConfigDownloadText?: string, fileConfigIsImage?: boolean, dictConfigMultiple?: boolean, joinConfigTreeTitle?: string, joinConfigParentPropertyName?: string, joinConfigParentPropertyType?: string, joinConfigLowerEntityName?: string, joinConfigFirstDisplayName?: string, joinConfigLowerFirstDisplayName?: string, joinConfigLowerLinkPropertyName?: string, joinConfigSearchPropertyName?: string, joinConfigLowerSearchPropertyName?: string, joinConfigSearchPropertyType?: string, joinConfigUseTable?: boolean, joinConfigMultiple?: boolean, dateConfigDefault?: string, nullableNetType?: string, displayPropertyNames?: string, leftJoinPropertyName?: string, getVxeColumnExtraConfig?: string, getFormRules?: string, codeGenTableId?: number, netType?: string, dataType?: string, columnLength?: number, columnComment?: string, effectType?: CodeGenEffectTypeEnum, config?: string, isPrimarykey?: boolean, isCommon?: boolean, isRequired?: boolean, isAddUpdate?: boolean, isImport?: boolean, isSortable?: boolean, isStatistical?: boolean, isQuery?: boolean, queryType?: string, isTable?: boolean, isCopy?: boolean, defaultValue?: string, fromValid?: CodeGenFromRuleValidEnum, orderNo?: number, createTime?: Date, updateTime?: Date, createUserId?: number, createUserName?: string, updateUserId?: number, updateUserName?: string, isDelete?: boolean, id?: number, options?: AxiosRequestConfig): Promise> { + return SysCodeGenColumnApiFp(configuration).apiSysCodeGenColumnDetailGet(dictConfigCode, joinConfigConfigId, joinConfigEntityName, joinConfigTableName, joinConfigTableComment, joinConfigDisplayPropertyNames, joinConfigLinkPropertyName, joinConfigLinkPropertyType, dateConfigFormat, columnName, propertyName, lowerPropertyName, isDict, isEnum, isConst, isUpload, isSwitch, isInput, isInputNumber, isInputTextArea, isDatePicker, isForeignKey, isTree, multiple, isUnique, isStatus, hasJoinTable, hasSlots, leftJoinAliasName, fileConfigUseDownload, fileConfigDownloadText, fileConfigIsImage, dictConfigMultiple, joinConfigTreeTitle, joinConfigParentPropertyName, joinConfigParentPropertyType, joinConfigLowerEntityName, joinConfigFirstDisplayName, joinConfigLowerFirstDisplayName, joinConfigLowerLinkPropertyName, joinConfigSearchPropertyName, joinConfigLowerSearchPropertyName, joinConfigSearchPropertyType, joinConfigUseTable, joinConfigMultiple, dateConfigDefault, nullableNetType, displayPropertyNames, leftJoinPropertyName, getVxeColumnExtraConfig, getFormRules, codeGenTableId, netType, dataType, columnLength, columnComment, effectType, config, isPrimarykey, isCommon, isRequired, isAddUpdate, isImport, isSortable, isStatistical, isQuery, queryType, isTable, isCopy, defaultValue, fromValid, orderNo, createTime, updateTime, createUserId, createUserName, updateUserId, updateUserName, isDelete, id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig): Promise> { + return SysCodeGenColumnApiFp(configuration).apiSysCodeGenColumnEntityInfosExcludeSysTableGet(excludeSysTable, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 获取代码生成配置列表 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnListGet(id: number, options?: AxiosRequestConfig): Promise> { + return SysCodeGenColumnApiFp(configuration).apiSysCodeGenColumnListGet(id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary 更新代码生成配置 🔖 + * @param {Array} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCodeGenColumnUpdatePost(body?: Array, options?: AxiosRequestConfig): Promise> { + return SysCodeGenColumnApiFp(configuration).apiSysCodeGenColumnUpdatePost(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * SysCodeGenColumnApi - object-oriented interface + * @export + * @class SysCodeGenColumnApi + * @extends {BaseAPI} + */ +export class SysCodeGenColumnApi extends BaseAPI { + /** + * + * @summary 获取代码生成配置详情 🔖 + * @param {string} dictConfigCode 字典编码 + * @param {string} joinConfigConfigId 外键库标识 + * @param {string} joinConfigEntityName 外键实体名称 + * @param {string} joinConfigTableName 外键表名称 + * @param {string} joinConfigTableComment 表注释 + * @param {string} joinConfigDisplayPropertyNames 外键显示属性名(多选) + * @param {string} joinConfigLinkPropertyName 外键属性名 + * @param {string} joinConfigLinkPropertyType 外键显示属性.NET类型 + * @param {string} dateConfigFormat 格式 + * @param {string} columnName 数据库字段名 + * @param {string} propertyName 实体属性名 + * @param {string} [lowerPropertyName] 首字母小写的属性名 + * @param {boolean} [isDict] 是否字典字段 + * @param {boolean} [isEnum] 是否枚举字段 + * @param {boolean} [isConst] 是否常量字段 + * @param {boolean} [isUpload] 是否上传字段 + * @param {boolean} [isSwitch] 是否开关字段 + * @param {boolean} [isInput] 是否输入框字段 + * @param {boolean} [isInputNumber] 是否数字输入框字段 + * @param {boolean} [isInputTextArea] 是否文本域字段 + * @param {boolean} [isDatePicker] 是否时间选择器字段 + * @param {boolean} [isForeignKey] 是否外键字段 + * @param {boolean} [isTree] 是否树字段 + * @param {boolean} [multiple] 是否多选字段 + * @param {boolean} [isUnique] 是否唯一字段 + * @param {boolean} [isStatus] 状态字段 + * @param {boolean} [hasJoinTable] 是否要联表 + * @param {boolean} [hasSlots] 是否要插槽 + * @param {string} [leftJoinAliasName] 连表别名 + * @param {boolean} [fileConfigUseDownload] 链接预览 + * @param {string} [fileConfigDownloadText] 链接文本 + * @param {boolean} [fileConfigIsImage] 是否图片 + * @param {boolean} [dictConfigMultiple] 是否多选 + * @param {string} [joinConfigTreeTitle] 树组件标题不能为空 + * @param {string} [joinConfigParentPropertyName] 父属性名称 + * @param {string} [joinConfigParentPropertyType] 父属性.NET类型 + * @param {string} [joinConfigLowerEntityName] 首字母小写实体名称 + * @param {string} [joinConfigFirstDisplayName] 首位外键显示属性名 + * @param {string} [joinConfigLowerFirstDisplayName] 首字母小写首位外键显示属性名 + * @param {string} [joinConfigLowerLinkPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyName] 用于检索的属性名 + * @param {string} [joinConfigLowerSearchPropertyName] 首字母小写外键属性名 + * @param {string} [joinConfigSearchPropertyType] 用于检索的属性.NET类型 + * @param {boolean} [joinConfigUseTable] 是否使用表格 + * @param {boolean} [joinConfigMultiple] 是否多选 + * @param {string} [dateConfigDefault] 默认值 + * @param {string} [nullableNetType] 获取可空类型 + * @param {string} [displayPropertyNames] 显示字段 + * @param {string} [leftJoinPropertyName] 连表属性名称 + * @param {string} [getVxeColumnExtraConfig] 获取列格式化配置方法 + * @param {string} [getFormRules] 获取表单验证规则 + * @param {number} [codeGenTableId] 代码生成表Id + * @param {string} [netType] .NET数据类型 + * @param {string} [dataType] 数据库中类型(物理类型) + * @param {number} [columnLength] 字段数据长度 + * @param {string} [columnComment] 字段描述 + * @param {CodeGenEffectTypeEnum} [effectType] 控件类型 + * @param {string} [config] 控件配置 + * @param {boolean} [isPrimarykey] 主键 + * @param {boolean} [isCommon] 是否通用字段 + * @param {boolean} [isRequired] 是否必填 + * @param {boolean} [isAddUpdate] 增改 + * @param {boolean} [isImport] 导入导出 + * @param {boolean} [isSortable] 是否可排序 + * @param {boolean} [isStatistical] 是否是统计字段 + * @param {boolean} [isQuery] 是否是查询条件 + * @param {string} [queryType] 查询方式 + * @param {boolean} [isTable] 列表显示 + * @param {boolean} [isCopy] 内容复制 + * @param {string} [defaultValue] 默认值 + * @param {CodeGenFromRuleValidEnum} [fromValid] 字段验证规则 + * @param {number} [orderNo] 排序 + * @param {Date} [createTime] 创建时间 + * @param {Date} [updateTime] 更新时间 + * @param {number} [createUserId] 创建者Id + * @param {string} [createUserName] 创建者姓名 + * @param {number} [updateUserId] 修改者Id + * @param {string} [updateUserName] 修改者姓名 + * @param {boolean} [isDelete] 软删除 + * @param {number} [id] 雪花Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenColumnApi + */ + public async apiSysCodeGenColumnDetailGet(dictConfigCode: string, joinConfigConfigId: string, joinConfigEntityName: string, joinConfigTableName: string, joinConfigTableComment: string, joinConfigDisplayPropertyNames: string, joinConfigLinkPropertyName: string, joinConfigLinkPropertyType: string, dateConfigFormat: string, columnName: string, propertyName: string, lowerPropertyName?: string, isDict?: boolean, isEnum?: boolean, isConst?: boolean, isUpload?: boolean, isSwitch?: boolean, isInput?: boolean, isInputNumber?: boolean, isInputTextArea?: boolean, isDatePicker?: boolean, isForeignKey?: boolean, isTree?: boolean, multiple?: boolean, isUnique?: boolean, isStatus?: boolean, hasJoinTable?: boolean, hasSlots?: boolean, leftJoinAliasName?: string, fileConfigUseDownload?: boolean, fileConfigDownloadText?: string, fileConfigIsImage?: boolean, dictConfigMultiple?: boolean, joinConfigTreeTitle?: string, joinConfigParentPropertyName?: string, joinConfigParentPropertyType?: string, joinConfigLowerEntityName?: string, joinConfigFirstDisplayName?: string, joinConfigLowerFirstDisplayName?: string, joinConfigLowerLinkPropertyName?: string, joinConfigSearchPropertyName?: string, joinConfigLowerSearchPropertyName?: string, joinConfigSearchPropertyType?: string, joinConfigUseTable?: boolean, joinConfigMultiple?: boolean, dateConfigDefault?: string, nullableNetType?: string, displayPropertyNames?: string, leftJoinPropertyName?: string, getVxeColumnExtraConfig?: string, getFormRules?: string, codeGenTableId?: number, netType?: string, dataType?: string, columnLength?: number, columnComment?: string, effectType?: CodeGenEffectTypeEnum, config?: string, isPrimarykey?: boolean, isCommon?: boolean, isRequired?: boolean, isAddUpdate?: boolean, isImport?: boolean, isSortable?: boolean, isStatistical?: boolean, isQuery?: boolean, queryType?: string, isTable?: boolean, isCopy?: boolean, defaultValue?: string, fromValid?: CodeGenFromRuleValidEnum, orderNo?: number, createTime?: Date, updateTime?: Date, createUserId?: number, createUserName?: string, updateUserId?: number, updateUserName?: string, isDelete?: boolean, id?: number, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenColumnApiFp(this.configuration).apiSysCodeGenColumnDetailGet(dictConfigCode, joinConfigConfigId, joinConfigEntityName, joinConfigTableName, joinConfigTableComment, joinConfigDisplayPropertyNames, joinConfigLinkPropertyName, joinConfigLinkPropertyType, dateConfigFormat, columnName, propertyName, lowerPropertyName, isDict, isEnum, isConst, isUpload, isSwitch, isInput, isInputNumber, isInputTextArea, isDatePicker, isForeignKey, isTree, multiple, isUnique, isStatus, hasJoinTable, hasSlots, leftJoinAliasName, fileConfigUseDownload, fileConfigDownloadText, fileConfigIsImage, dictConfigMultiple, joinConfigTreeTitle, joinConfigParentPropertyName, joinConfigParentPropertyType, joinConfigLowerEntityName, joinConfigFirstDisplayName, joinConfigLowerFirstDisplayName, joinConfigLowerLinkPropertyName, joinConfigSearchPropertyName, joinConfigLowerSearchPropertyName, joinConfigSearchPropertyType, joinConfigUseTable, joinConfigMultiple, dateConfigDefault, nullableNetType, displayPropertyNames, leftJoinPropertyName, getVxeColumnExtraConfig, getFormRules, codeGenTableId, netType, dataType, columnLength, columnComment, effectType, config, isPrimarykey, isCommon, isRequired, isAddUpdate, isImport, isSortable, isStatistical, isQuery, queryType, isTable, isCopy, defaultValue, fromValid, orderNo, createTime, updateTime, createUserId, createUserName, updateUserId, updateUserName, isDelete, id, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 获取库表信息 + * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenColumnApi + */ + public async apiSysCodeGenColumnEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenColumnApiFp(this.configuration).apiSysCodeGenColumnEntityInfosExcludeSysTableGet(excludeSysTable, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 获取代码生成配置列表 🔖 + * @param {number} id 主键Id + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenColumnApi + */ + public async apiSysCodeGenColumnListGet(id: number, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenColumnApiFp(this.configuration).apiSysCodeGenColumnListGet(id, options).then((request) => request(this.axios, this.basePath)); + } + /** + * + * @summary 更新代码生成配置 🔖 + * @param {Array} [body] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCodeGenColumnApi + */ + public async apiSysCodeGenColumnUpdatePost(body?: Array, options?: AxiosRequestConfig) : Promise> { + return SysCodeGenColumnApiFp(this.configuration).apiSysCodeGenColumnUpdatePost(body, options).then((request) => request(this.axios, this.basePath)); + } +} diff --git a/Web/src/api-services/system/apis/sys-code-gen-config-api.ts b/Web/src/api-services/system/apis/sys-code-gen-config-api.ts deleted file mode 100644 index 89b92b5e..00000000 --- a/Web/src/api-services/system/apis/sys-code-gen-config-api.ts +++ /dev/null @@ -1,1588 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; -import { Configuration } from '../configuration'; -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; -import { AdminNETResultIEnumerableEntityInfo } from '../models'; -import { AdminNETResultListCodeGenConfig } from '../models'; -import { AdminNETResultListColumnOuput } from '../models'; -import { AdminNETResultSysCodeGenConfig } from '../models'; -import { CodeGenConfig } from '../models'; -import { Filter } from '../models'; -import { FilterLogicEnum } from '../models'; -import { FilterOperatorEnum } from '../models'; -import { VerifyRuleItem } from '../models'; -/** - * SysCodeGenConfigApi - axios parameter creator - * @export - */ -export const SysCodeGenConfigApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} entityName - * @param {string} configId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenConfigColumnListEntityNameConfigIdGet: async (entityName: string, configId: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'entityName' is not null or undefined - if (entityName === null || entityName === undefined) { - throw new RequiredError('entityName','Required parameter entityName was null or undefined when calling apiSysCodeGenConfigColumnListEntityNameConfigIdGet.'); - } - // verify required parameter 'configId' is not null or undefined - if (configId === null || configId === undefined) { - throw new RequiredError('configId','Required parameter configId was null or undefined when calling apiSysCodeGenConfigColumnListEntityNameConfigIdGet.'); - } - const localVarPath = `/api/sysCodeGenConfig/columnList/{entityName}/{configId}` - .replace(`{${"entityName"}}`, encodeURIComponent(String(entityName))) - .replace(`{${"configId"}}`, encodeURIComponent(String(configId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} tableName 数据库表名 - * @param {string} busName 业务名(业务代码包名称) - * @param {string} nameSpace 命名空间 - * @param {string} authorName 作者姓名 - * @param {string} generateType 生成方式 - * @param {boolean} generateMenu 是否生成菜单 - * @param {boolean} [isApiService] 是否使用 Api Service - * @param {Array} [codeGenTemplateIds] 模板Id集合 - * @param {string} [leftTab] 左边树形结构表 - * @param {string} [leftKey] 左边关联字段 - * @param {string} [leftPrimaryKey] 左边关联主表字段 - * @param {string} [leftName] 左边树Name - * @param {string} [bottomTab] 下表名称 - * @param {string} [bottomKey] 下表关联字段 - * @param {string} [bottomPrimaryKey] 下表关联主表字段 - * @param {string} [template] 模板 - * @param {string} [tabType] 表类型 - * @param {string} [className] 类名 - * @param {string} [tablePrefix] 是否移除表前缀 - * @param {string} [configId] 库定位器名 - * @param {string} [dbName] 数据库名(保留字段) - * @param {string} [dbType] 数据库类型 - * @param {string} [connectionString] 数据库链接 - * @param {string} [treeName] 树控件名称 - * @param {string} [treeKey] 树控件key - * @param {string} [tableComment] 功能名(数据库表名称) - * @param {string} [menuApplication] 菜单应用分类(应用编码) - * @param {number} [menuPid] 菜单父级 - * @param {string} [menuIcon] 菜单图标 - * @param {string} [pagePath] 页面目录 - * @param {string} [printType] 支持打印类型 - * @param {string} [printName] 打印模版名称 - * @param {number} [page] 当前页码 - * @param {number} [pageSize] 页码容量 - * @param {string} [field] 排序字段 - * @param {string} [order] 排序方向 - * @param {string} [descStr] 降序排序 - * @param {Array} [searchFields] 字段名称集合 - * @param {string} [searchKeyword] 关键字 - * @param {string} [keyword] 模糊查询关键字 - * @param {FilterLogicEnum} [filterLogic] 过滤条件 - * @param {Array} [filterFilters] 筛选过滤条件子项 - * @param {string} [filterField] 字段名称 - * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 - * @param {any} [filterValue] 字段值 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenConfigColumnListGet: async (tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, tabType?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, treeKey?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'tableName' is not null or undefined - if (tableName === null || tableName === undefined) { - throw new RequiredError('tableName','Required parameter tableName was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); - } - // verify required parameter 'busName' is not null or undefined - if (busName === null || busName === undefined) { - throw new RequiredError('busName','Required parameter busName was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); - } - // verify required parameter 'nameSpace' is not null or undefined - if (nameSpace === null || nameSpace === undefined) { - throw new RequiredError('nameSpace','Required parameter nameSpace was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); - } - // verify required parameter 'authorName' is not null or undefined - if (authorName === null || authorName === undefined) { - throw new RequiredError('authorName','Required parameter authorName was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); - } - // verify required parameter 'generateType' is not null or undefined - if (generateType === null || generateType === undefined) { - throw new RequiredError('generateType','Required parameter generateType was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); - } - // verify required parameter 'generateMenu' is not null or undefined - if (generateMenu === null || generateMenu === undefined) { - throw new RequiredError('generateMenu','Required parameter generateMenu was null or undefined when calling apiSysCodeGenConfigColumnListGet.'); - } - const localVarPath = `/api/sysCodeGenConfig/columnList`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - if (tableName !== undefined) { - localVarQueryParameter['TableName'] = tableName; - } - - if (busName !== undefined) { - localVarQueryParameter['BusName'] = busName; - } - - if (nameSpace !== undefined) { - localVarQueryParameter['NameSpace'] = nameSpace; - } - - if (authorName !== undefined) { - localVarQueryParameter['AuthorName'] = authorName; - } - - if (generateType !== undefined) { - localVarQueryParameter['GenerateType'] = generateType; - } - - if (generateMenu !== undefined) { - localVarQueryParameter['GenerateMenu'] = generateMenu; - } - - if (isApiService !== undefined) { - localVarQueryParameter['IsApiService'] = isApiService; - } - - if (codeGenTemplateIds) { - localVarQueryParameter['CodeGenTemplateIds'] = codeGenTemplateIds; - } - - if (leftTab !== undefined) { - localVarQueryParameter['LeftTab'] = leftTab; - } - - if (leftKey !== undefined) { - localVarQueryParameter['LeftKey'] = leftKey; - } - - if (leftPrimaryKey !== undefined) { - localVarQueryParameter['LeftPrimaryKey'] = leftPrimaryKey; - } - - if (leftName !== undefined) { - localVarQueryParameter['LeftName'] = leftName; - } - - if (bottomTab !== undefined) { - localVarQueryParameter['BottomTab'] = bottomTab; - } - - if (bottomKey !== undefined) { - localVarQueryParameter['BottomKey'] = bottomKey; - } - - if (bottomPrimaryKey !== undefined) { - localVarQueryParameter['BottomPrimaryKey'] = bottomPrimaryKey; - } - - if (template !== undefined) { - localVarQueryParameter['Template'] = template; - } - - if (tabType !== undefined) { - localVarQueryParameter['TabType'] = tabType; - } - - if (className !== undefined) { - localVarQueryParameter['ClassName'] = className; - } - - if (tablePrefix !== undefined) { - localVarQueryParameter['TablePrefix'] = tablePrefix; - } - - if (configId !== undefined) { - localVarQueryParameter['ConfigId'] = configId; - } - - if (dbName !== undefined) { - localVarQueryParameter['DbName'] = dbName; - } - - if (dbType !== undefined) { - localVarQueryParameter['DbType'] = dbType; - } - - if (connectionString !== undefined) { - localVarQueryParameter['ConnectionString'] = connectionString; - } - - if (treeName !== undefined) { - localVarQueryParameter['TreeName'] = treeName; - } - - if (treeKey !== undefined) { - localVarQueryParameter['TreeKey'] = treeKey; - } - - if (tableComment !== undefined) { - localVarQueryParameter['TableComment'] = tableComment; - } - - if (menuApplication !== undefined) { - localVarQueryParameter['MenuApplication'] = menuApplication; - } - - if (menuPid !== undefined) { - localVarQueryParameter['MenuPid'] = menuPid; - } - - if (menuIcon !== undefined) { - localVarQueryParameter['MenuIcon'] = menuIcon; - } - - if (pagePath !== undefined) { - localVarQueryParameter['PagePath'] = pagePath; - } - - if (printType !== undefined) { - localVarQueryParameter['PrintType'] = printType; - } - - if (printName !== undefined) { - localVarQueryParameter['PrintName'] = printName; - } - - if (page !== undefined) { - localVarQueryParameter['Page'] = page; - } - - if (pageSize !== undefined) { - localVarQueryParameter['PageSize'] = pageSize; - } - - if (field !== undefined) { - localVarQueryParameter['Field'] = field; - } - - if (order !== undefined) { - localVarQueryParameter['Order'] = order; - } - - if (descStr !== undefined) { - localVarQueryParameter['DescStr'] = descStr; - } - - if (searchFields) { - localVarQueryParameter['Search.Fields'] = searchFields; - } - - if (searchKeyword !== undefined) { - localVarQueryParameter['Search.Keyword'] = searchKeyword; - } - - if (keyword !== undefined) { - localVarQueryParameter['Keyword'] = keyword; - } - - if (filterLogic !== undefined) { - localVarQueryParameter['Filter.Logic'] = filterLogic; - } - - if (filterFilters) { - localVarQueryParameter['Filter.Filters'] = filterFilters; - } - - if (filterField !== undefined) { - localVarQueryParameter['Filter.Field'] = filterField; - } - - if (filterOperator !== undefined) { - localVarQueryParameter['Filter.Operator'] = filterOperator; - } - - if (filterValue !== undefined) { - localVarQueryParameter['Filter.Value'] = filterValue; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取代码生成配置详情 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenConfigDetailGet: async (id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCodeGenConfig/detail`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - if (id !== undefined) { - localVarQueryParameter['Id'] = id; - } - - if (codeGenId !== undefined) { - localVarQueryParameter['CodeGenId'] = codeGenId; - } - - if (columnName !== undefined) { - localVarQueryParameter['ColumnName'] = columnName; - } - - if (propertyName !== undefined) { - localVarQueryParameter['PropertyName'] = propertyName; - } - - if (columnLength !== undefined) { - localVarQueryParameter['ColumnLength'] = columnLength; - } - - if (lowerPropertyName !== undefined) { - localVarQueryParameter['LowerPropertyName'] = lowerPropertyName; - } - - if (columnComment !== undefined) { - localVarQueryParameter['ColumnComment'] = columnComment; - } - - if (netType !== undefined) { - localVarQueryParameter['NetType'] = netType; - } - - if (effectType !== undefined) { - localVarQueryParameter['EffectType'] = effectType; - } - - if (fkConfigId !== undefined) { - localVarQueryParameter['FkConfigId'] = fkConfigId; - } - - if (fkEntityName !== undefined) { - localVarQueryParameter['FkEntityName'] = fkEntityName; - } - - if (fkTableName !== undefined) { - localVarQueryParameter['FkTableName'] = fkTableName; - } - - if (lowerFkEntityName !== undefined) { - localVarQueryParameter['LowerFkEntityName'] = lowerFkEntityName; - } - - if (fkColumnName !== undefined) { - localVarQueryParameter['FkColumnName'] = fkColumnName; - } - - if (fkLinkColumnName !== undefined) { - localVarQueryParameter['FkLinkColumnName'] = fkLinkColumnName; - } - - if (lowerFkColumnName !== undefined) { - localVarQueryParameter['LowerFkColumnName'] = lowerFkColumnName; - } - - if (fkColumnNetType !== undefined) { - localVarQueryParameter['FkColumnNetType'] = fkColumnNetType; - } - - if (dictTypeCode !== undefined) { - localVarQueryParameter['DictTypeCode'] = dictTypeCode; - } - - if (whetherRetract !== undefined) { - localVarQueryParameter['WhetherRetract'] = whetherRetract; - } - - if (whetherRequired !== undefined) { - localVarQueryParameter['WhetherRequired'] = whetherRequired; - } - - if (whetherSortable !== undefined) { - localVarQueryParameter['WhetherSortable'] = whetherSortable; - } - - if (statistical !== undefined) { - localVarQueryParameter['Statistical'] = statistical; - } - - if (isGroupBy !== undefined) { - localVarQueryParameter['IsGroupBy'] = isGroupBy; - } - - if (queryWhether !== undefined) { - localVarQueryParameter['QueryWhether'] = queryWhether; - } - - if (queryType !== undefined) { - localVarQueryParameter['QueryType'] = queryType; - } - - if (whetherTable !== undefined) { - localVarQueryParameter['WhetherTable'] = whetherTable; - } - - if (whetherAddUpdate !== undefined) { - localVarQueryParameter['WhetherAddUpdate'] = whetherAddUpdate; - } - - if (columnKey !== undefined) { - localVarQueryParameter['ColumnKey'] = columnKey; - } - - if (dataType !== undefined) { - localVarQueryParameter['DataType'] = dataType; - } - - if (whetherCommon !== undefined) { - localVarQueryParameter['WhetherCommon'] = whetherCommon; - } - - if (tableNickName !== undefined) { - localVarQueryParameter['TableNickName'] = tableNickName; - } - - if (displayColumn !== undefined) { - localVarQueryParameter['DisplayColumn'] = displayColumn; - } - - if (valueColumn !== undefined) { - localVarQueryParameter['ValueColumn'] = valueColumn; - } - - if (pidColumn !== undefined) { - localVarQueryParameter['PidColumn'] = pidColumn; - } - - if (orderNo !== undefined) { - localVarQueryParameter['OrderNo'] = orderNo; - } - - if (rules !== undefined) { - localVarQueryParameter['Rules'] = rules; - } - - if (defaultValue !== undefined) { - localVarQueryParameter['DefaultValue'] = defaultValue; - } - - if (ruleItems) { - localVarQueryParameter['RuleItems'] = ruleItems; - } - - if (remoteVerify !== undefined) { - localVarQueryParameter['RemoteVerify'] = remoteVerify; - } - - if (anyRule !== undefined) { - localVarQueryParameter['AnyRule'] = anyRule; - } - - if (trigger !== undefined) { - localVarQueryParameter['Trigger'] = trigger; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取库表信息 - * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenConfigEntityInfosExcludeSysTableGet: async (excludeSysTable: boolean, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'excludeSysTable' is not null or undefined - if (excludeSysTable === null || excludeSysTable === undefined) { - throw new RequiredError('excludeSysTable','Required parameter excludeSysTable was null or undefined when calling apiSysCodeGenConfigEntityInfosExcludeSysTableGet.'); - } - const localVarPath = `/api/sysCodeGenConfig/entityInfos/{excludeSysTable}` - .replace(`{${"excludeSysTable"}}`, encodeURIComponent(String(excludeSysTable))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取代码生成配置列表 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenConfigListGet: async (id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCodeGenConfig/list`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - if (id !== undefined) { - localVarQueryParameter['Id'] = id; - } - - if (codeGenId !== undefined) { - localVarQueryParameter['CodeGenId'] = codeGenId; - } - - if (columnName !== undefined) { - localVarQueryParameter['ColumnName'] = columnName; - } - - if (propertyName !== undefined) { - localVarQueryParameter['PropertyName'] = propertyName; - } - - if (columnLength !== undefined) { - localVarQueryParameter['ColumnLength'] = columnLength; - } - - if (lowerPropertyName !== undefined) { - localVarQueryParameter['LowerPropertyName'] = lowerPropertyName; - } - - if (columnComment !== undefined) { - localVarQueryParameter['ColumnComment'] = columnComment; - } - - if (netType !== undefined) { - localVarQueryParameter['NetType'] = netType; - } - - if (effectType !== undefined) { - localVarQueryParameter['EffectType'] = effectType; - } - - if (fkConfigId !== undefined) { - localVarQueryParameter['FkConfigId'] = fkConfigId; - } - - if (fkEntityName !== undefined) { - localVarQueryParameter['FkEntityName'] = fkEntityName; - } - - if (fkTableName !== undefined) { - localVarQueryParameter['FkTableName'] = fkTableName; - } - - if (lowerFkEntityName !== undefined) { - localVarQueryParameter['LowerFkEntityName'] = lowerFkEntityName; - } - - if (fkColumnName !== undefined) { - localVarQueryParameter['FkColumnName'] = fkColumnName; - } - - if (fkLinkColumnName !== undefined) { - localVarQueryParameter['FkLinkColumnName'] = fkLinkColumnName; - } - - if (lowerFkColumnName !== undefined) { - localVarQueryParameter['LowerFkColumnName'] = lowerFkColumnName; - } - - if (fkColumnNetType !== undefined) { - localVarQueryParameter['FkColumnNetType'] = fkColumnNetType; - } - - if (dictTypeCode !== undefined) { - localVarQueryParameter['DictTypeCode'] = dictTypeCode; - } - - if (whetherRetract !== undefined) { - localVarQueryParameter['WhetherRetract'] = whetherRetract; - } - - if (whetherRequired !== undefined) { - localVarQueryParameter['WhetherRequired'] = whetherRequired; - } - - if (whetherSortable !== undefined) { - localVarQueryParameter['WhetherSortable'] = whetherSortable; - } - - if (statistical !== undefined) { - localVarQueryParameter['Statistical'] = statistical; - } - - if (isGroupBy !== undefined) { - localVarQueryParameter['IsGroupBy'] = isGroupBy; - } - - if (queryWhether !== undefined) { - localVarQueryParameter['QueryWhether'] = queryWhether; - } - - if (queryType !== undefined) { - localVarQueryParameter['QueryType'] = queryType; - } - - if (whetherTable !== undefined) { - localVarQueryParameter['WhetherTable'] = whetherTable; - } - - if (whetherAddUpdate !== undefined) { - localVarQueryParameter['WhetherAddUpdate'] = whetherAddUpdate; - } - - if (columnKey !== undefined) { - localVarQueryParameter['ColumnKey'] = columnKey; - } - - if (dataType !== undefined) { - localVarQueryParameter['DataType'] = dataType; - } - - if (whetherCommon !== undefined) { - localVarQueryParameter['WhetherCommon'] = whetherCommon; - } - - if (tableNickName !== undefined) { - localVarQueryParameter['TableNickName'] = tableNickName; - } - - if (displayColumn !== undefined) { - localVarQueryParameter['DisplayColumn'] = displayColumn; - } - - if (valueColumn !== undefined) { - localVarQueryParameter['ValueColumn'] = valueColumn; - } - - if (pidColumn !== undefined) { - localVarQueryParameter['PidColumn'] = pidColumn; - } - - if (orderNo !== undefined) { - localVarQueryParameter['OrderNo'] = orderNo; - } - - if (rules !== undefined) { - localVarQueryParameter['Rules'] = rules; - } - - if (defaultValue !== undefined) { - localVarQueryParameter['DefaultValue'] = defaultValue; - } - - if (ruleItems) { - localVarQueryParameter['RuleItems'] = ruleItems; - } - - if (remoteVerify !== undefined) { - localVarQueryParameter['RemoteVerify'] = remoteVerify; - } - - if (anyRule !== undefined) { - localVarQueryParameter['AnyRule'] = anyRule; - } - - if (trigger !== undefined) { - localVarQueryParameter['Trigger'] = trigger; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 更新代码生成配置 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenConfigUpdatePost: async (body?: Array, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCodeGenConfig/update`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * SysCodeGenConfigApi - functional programming interface - * @export - */ -export const SysCodeGenConfigApiFp = function(configuration?: Configuration) { - return { - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} entityName - * @param {string} configId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName: string, configId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName, configId, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} tableName 数据库表名 - * @param {string} busName 业务名(业务代码包名称) - * @param {string} nameSpace 命名空间 - * @param {string} authorName 作者姓名 - * @param {string} generateType 生成方式 - * @param {boolean} generateMenu 是否生成菜单 - * @param {boolean} [isApiService] 是否使用 Api Service - * @param {Array} [codeGenTemplateIds] 模板Id集合 - * @param {string} [leftTab] 左边树形结构表 - * @param {string} [leftKey] 左边关联字段 - * @param {string} [leftPrimaryKey] 左边关联主表字段 - * @param {string} [leftName] 左边树Name - * @param {string} [bottomTab] 下表名称 - * @param {string} [bottomKey] 下表关联字段 - * @param {string} [bottomPrimaryKey] 下表关联主表字段 - * @param {string} [template] 模板 - * @param {string} [tabType] 表类型 - * @param {string} [className] 类名 - * @param {string} [tablePrefix] 是否移除表前缀 - * @param {string} [configId] 库定位器名 - * @param {string} [dbName] 数据库名(保留字段) - * @param {string} [dbType] 数据库类型 - * @param {string} [connectionString] 数据库链接 - * @param {string} [treeName] 树控件名称 - * @param {string} [treeKey] 树控件key - * @param {string} [tableComment] 功能名(数据库表名称) - * @param {string} [menuApplication] 菜单应用分类(应用编码) - * @param {number} [menuPid] 菜单父级 - * @param {string} [menuIcon] 菜单图标 - * @param {string} [pagePath] 页面目录 - * @param {string} [printType] 支持打印类型 - * @param {string} [printName] 打印模版名称 - * @param {number} [page] 当前页码 - * @param {number} [pageSize] 页码容量 - * @param {string} [field] 排序字段 - * @param {string} [order] 排序方向 - * @param {string} [descStr] 降序排序 - * @param {Array} [searchFields] 字段名称集合 - * @param {string} [searchKeyword] 关键字 - * @param {string} [keyword] 模糊查询关键字 - * @param {FilterLogicEnum} [filterLogic] 过滤条件 - * @param {Array} [filterFilters] 筛选过滤条件子项 - * @param {string} [filterField] 字段名称 - * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 - * @param {any} [filterValue] 字段值 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigColumnListGet(tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, tabType?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, treeKey?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigColumnListGet(tableName, busName, nameSpace, authorName, generateType, generateMenu, isApiService, codeGenTemplateIds, leftTab, leftKey, leftPrimaryKey, leftName, bottomTab, bottomKey, bottomPrimaryKey, template, tabType, className, tablePrefix, configId, dbName, dbType, connectionString, treeName, treeKey, tableComment, menuApplication, menuPid, menuIcon, pagePath, printType, printName, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取代码生成配置详情 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, isGroupBy, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取库表信息 - * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取代码生成配置列表 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, isGroupBy, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 更新代码生成配置 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigUpdatePost(body?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenConfigApiAxiosParamCreator(configuration).apiSysCodeGenConfigUpdatePost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - } -}; - -/** - * SysCodeGenConfigApi - factory interface - * @export - */ -export const SysCodeGenConfigApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - return { - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} entityName - * @param {string} configId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName: string, configId: string, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName, configId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} tableName 数据库表名 - * @param {string} busName 业务名(业务代码包名称) - * @param {string} nameSpace 命名空间 - * @param {string} authorName 作者姓名 - * @param {string} generateType 生成方式 - * @param {boolean} generateMenu 是否生成菜单 - * @param {boolean} [isApiService] 是否使用 Api Service - * @param {Array} [codeGenTemplateIds] 模板Id集合 - * @param {string} [leftTab] 左边树形结构表 - * @param {string} [leftKey] 左边关联字段 - * @param {string} [leftPrimaryKey] 左边关联主表字段 - * @param {string} [leftName] 左边树Name - * @param {string} [bottomTab] 下表名称 - * @param {string} [bottomKey] 下表关联字段 - * @param {string} [bottomPrimaryKey] 下表关联主表字段 - * @param {string} [template] 模板 - * @param {string} [tabType] 表类型 - * @param {string} [className] 类名 - * @param {string} [tablePrefix] 是否移除表前缀 - * @param {string} [configId] 库定位器名 - * @param {string} [dbName] 数据库名(保留字段) - * @param {string} [dbType] 数据库类型 - * @param {string} [connectionString] 数据库链接 - * @param {string} [treeName] 树控件名称 - * @param {string} [treeKey] 树控件key - * @param {string} [tableComment] 功能名(数据库表名称) - * @param {string} [menuApplication] 菜单应用分类(应用编码) - * @param {number} [menuPid] 菜单父级 - * @param {string} [menuIcon] 菜单图标 - * @param {string} [pagePath] 页面目录 - * @param {string} [printType] 支持打印类型 - * @param {string} [printName] 打印模版名称 - * @param {number} [page] 当前页码 - * @param {number} [pageSize] 页码容量 - * @param {string} [field] 排序字段 - * @param {string} [order] 排序方向 - * @param {string} [descStr] 降序排序 - * @param {Array} [searchFields] 字段名称集合 - * @param {string} [searchKeyword] 关键字 - * @param {string} [keyword] 模糊查询关键字 - * @param {FilterLogicEnum} [filterLogic] 过滤条件 - * @param {Array} [filterFilters] 筛选过滤条件子项 - * @param {string} [filterField] 字段名称 - * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 - * @param {any} [filterValue] 字段值 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigColumnListGet(tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, tabType?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, treeKey?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigColumnListGet(tableName, busName, nameSpace, authorName, generateType, generateMenu, isApiService, codeGenTemplateIds, leftTab, leftKey, leftPrimaryKey, leftName, bottomTab, bottomKey, bottomPrimaryKey, template, tabType, className, tablePrefix, configId, dbName, dbType, connectionString, treeName, treeKey, tableComment, menuApplication, menuPid, menuIcon, pagePath, printType, printName, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取代码生成配置详情 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, isGroupBy, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取库表信息 - * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取代码生成配置列表 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, isGroupBy, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 更新代码生成配置 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenConfigUpdatePost(body?: Array, options?: AxiosRequestConfig): Promise> { - return SysCodeGenConfigApiFp(configuration).apiSysCodeGenConfigUpdatePost(body, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * SysCodeGenConfigApi - object-oriented interface - * @export - * @class SysCodeGenConfigApi - * @extends {BaseAPI} - */ -export class SysCodeGenConfigApi extends BaseAPI { - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} entityName - * @param {string} configId - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenConfigApi - */ - public async apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName: string, configId: string, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigColumnListEntityNameConfigIdGet(entityName, configId, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取数据表列(实体属性)集合 - * @param {string} tableName 数据库表名 - * @param {string} busName 业务名(业务代码包名称) - * @param {string} nameSpace 命名空间 - * @param {string} authorName 作者姓名 - * @param {string} generateType 生成方式 - * @param {boolean} generateMenu 是否生成菜单 - * @param {boolean} [isApiService] 是否使用 Api Service - * @param {Array} [codeGenTemplateIds] 模板Id集合 - * @param {string} [leftTab] 左边树形结构表 - * @param {string} [leftKey] 左边关联字段 - * @param {string} [leftPrimaryKey] 左边关联主表字段 - * @param {string} [leftName] 左边树Name - * @param {string} [bottomTab] 下表名称 - * @param {string} [bottomKey] 下表关联字段 - * @param {string} [bottomPrimaryKey] 下表关联主表字段 - * @param {string} [template] 模板 - * @param {string} [tabType] 表类型 - * @param {string} [className] 类名 - * @param {string} [tablePrefix] 是否移除表前缀 - * @param {string} [configId] 库定位器名 - * @param {string} [dbName] 数据库名(保留字段) - * @param {string} [dbType] 数据库类型 - * @param {string} [connectionString] 数据库链接 - * @param {string} [treeName] 树控件名称 - * @param {string} [treeKey] 树控件key - * @param {string} [tableComment] 功能名(数据库表名称) - * @param {string} [menuApplication] 菜单应用分类(应用编码) - * @param {number} [menuPid] 菜单父级 - * @param {string} [menuIcon] 菜单图标 - * @param {string} [pagePath] 页面目录 - * @param {string} [printType] 支持打印类型 - * @param {string} [printName] 打印模版名称 - * @param {number} [page] 当前页码 - * @param {number} [pageSize] 页码容量 - * @param {string} [field] 排序字段 - * @param {string} [order] 排序方向 - * @param {string} [descStr] 降序排序 - * @param {Array} [searchFields] 字段名称集合 - * @param {string} [searchKeyword] 关键字 - * @param {string} [keyword] 模糊查询关键字 - * @param {FilterLogicEnum} [filterLogic] 过滤条件 - * @param {Array} [filterFilters] 筛选过滤条件子项 - * @param {string} [filterField] 字段名称 - * @param {FilterOperatorEnum} [filterOperator] 逻辑运算符 - * @param {any} [filterValue] 字段值 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenConfigApi - */ - public async apiSysCodeGenConfigColumnListGet(tableName: string, busName: string, nameSpace: string, authorName: string, generateType: string, generateMenu: boolean, isApiService?: boolean, codeGenTemplateIds?: Array, leftTab?: string, leftKey?: string, leftPrimaryKey?: string, leftName?: string, bottomTab?: string, bottomKey?: string, bottomPrimaryKey?: string, template?: string, tabType?: string, className?: string, tablePrefix?: string, configId?: string, dbName?: string, dbType?: string, connectionString?: string, treeName?: string, treeKey?: string, tableComment?: string, menuApplication?: string, menuPid?: number, menuIcon?: string, pagePath?: string, printType?: string, printName?: string, page?: number, pageSize?: number, field?: string, order?: string, descStr?: string, searchFields?: Array, searchKeyword?: string, keyword?: string, filterLogic?: FilterLogicEnum, filterFilters?: Array, filterField?: string, filterOperator?: FilterOperatorEnum, filterValue?: any, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigColumnListGet(tableName, busName, nameSpace, authorName, generateType, generateMenu, isApiService, codeGenTemplateIds, leftTab, leftKey, leftPrimaryKey, leftName, bottomTab, bottomKey, bottomPrimaryKey, template, tabType, className, tablePrefix, configId, dbName, dbType, connectionString, treeName, treeKey, tableComment, menuApplication, menuPid, menuIcon, pagePath, printType, printName, page, pageSize, field, order, descStr, searchFields, searchKeyword, keyword, filterLogic, filterFilters, filterField, filterOperator, filterValue, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取代码生成配置详情 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenConfigApi - */ - public async apiSysCodeGenConfigDetailGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigDetailGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, isGroupBy, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取库表信息 - * @param {boolean} excludeSysTable 是否排除带SysTable属性的表 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenConfigApi - */ - public async apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable: boolean, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigEntityInfosExcludeSysTableGet(excludeSysTable, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取代码生成配置列表 🔖 - * @param {number} [id] 主键Id - * @param {number} [codeGenId] 代码生成主表ID - * @param {string} [columnName] 数据库字段名 - * @param {string} [propertyName] 实体属性名 - * @param {number} [columnLength] 字段数据长度 - * @param {string} [lowerPropertyName] 数据库字段名(首字母小写) - * @param {string} [columnComment] 字段描述 - * @param {string} [netType] .NET类型 - * @param {string} [effectType] 作用类型(字典) - * @param {string} [fkConfigId] 外键库标识 - * @param {string} [fkEntityName] 外键实体名称 - * @param {string} [fkTableName] 外键表名称 - * @param {string} [lowerFkEntityName] 外键实体名称(首字母小写) - * @param {string} [fkColumnName] 外键显示字段 - * @param {string} [fkLinkColumnName] 外键链接字段 - * @param {string} [lowerFkColumnName] 外键显示字段(首字母小写) - * @param {string} [fkColumnNetType] 外键显示字段.NET类型 - * @param {string} [dictTypeCode] 字典code - * @param {string} [whetherRetract] 列表是否缩进(字典) - * @param {string} [whetherRequired] 是否必填(字典) - * @param {string} [whetherSortable] 是否可排序(字典) - * @param {string} [statistical] 是否是统计字段 - * @param {string} [isGroupBy] 是否是GroupBy字段 - * @param {string} [queryWhether] 是否是查询条件 - * @param {string} [queryType] 查询方式 - * @param {string} [whetherTable] 列表显示 - * @param {string} [whetherAddUpdate] 增改 - * @param {string} [columnKey] 主外键 - * @param {string} [dataType] 数据库中类型(物理类型) - * @param {string} [whetherCommon] 是否是通用字段 - * @param {string} [tableNickName] 表的别名 Table as XXX - * @param {string} [displayColumn] 显示文本字段 - * @param {string} [valueColumn] 选中值字段 - * @param {string} [pidColumn] 父级字段 - * @param {number} [orderNo] 排序 - * @param {string} [rules] 字段验证规则 - * @param {string} [defaultValue] 默认值 - * @param {Array} [ruleItems] 字段验证集合 - * @param {boolean} [remoteVerify] 是否远程验证 - * @param {boolean} [anyRule] 是否存在验证规则 - * @param {string} [trigger] 验证触发器 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenConfigApi - */ - public async apiSysCodeGenConfigListGet(id?: number, codeGenId?: number, columnName?: string, propertyName?: string, columnLength?: number, lowerPropertyName?: string, columnComment?: string, netType?: string, effectType?: string, fkConfigId?: string, fkEntityName?: string, fkTableName?: string, lowerFkEntityName?: string, fkColumnName?: string, fkLinkColumnName?: string, lowerFkColumnName?: string, fkColumnNetType?: string, dictTypeCode?: string, whetherRetract?: string, whetherRequired?: string, whetherSortable?: string, statistical?: string, isGroupBy?: string, queryWhether?: string, queryType?: string, whetherTable?: string, whetherAddUpdate?: string, columnKey?: string, dataType?: string, whetherCommon?: string, tableNickName?: string, displayColumn?: string, valueColumn?: string, pidColumn?: string, orderNo?: number, rules?: string, defaultValue?: string, ruleItems?: Array, remoteVerify?: boolean, anyRule?: boolean, trigger?: string, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigListGet(id, codeGenId, columnName, propertyName, columnLength, lowerPropertyName, columnComment, netType, effectType, fkConfigId, fkEntityName, fkTableName, lowerFkEntityName, fkColumnName, fkLinkColumnName, lowerFkColumnName, fkColumnNetType, dictTypeCode, whetherRetract, whetherRequired, whetherSortable, statistical, isGroupBy, queryWhether, queryType, whetherTable, whetherAddUpdate, columnKey, dataType, whetherCommon, tableNickName, displayColumn, valueColumn, pidColumn, orderNo, rules, defaultValue, ruleItems, remoteVerify, anyRule, trigger, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 更新代码生成配置 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenConfigApi - */ - public async apiSysCodeGenConfigUpdatePost(body?: Array, options?: AxiosRequestConfig) : Promise> { - return SysCodeGenConfigApiFp(this.configuration).apiSysCodeGenConfigUpdatePost(body, options).then((request) => request(this.axios, this.basePath)); - } -} diff --git a/Web/src/api-services/system/apis/sys-code-gen-template-api.ts b/Web/src/api-services/system/apis/sys-code-gen-template-api.ts deleted file mode 100644 index 56c00349..00000000 --- a/Web/src/api-services/system/apis/sys-code-gen-template-api.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; -import { Configuration } from '../configuration'; -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; -import { AdminNETResultListSysCodeGenTemplate } from '../models'; -/** - * SysCodeGenTemplateApi - axios parameter creator - * @export - */ -export const SysCodeGenTemplateApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary 获取代码生成模板配置列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCodeGenTemplateListGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCodeGenTemplate/list`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * SysCodeGenTemplateApi - functional programming interface - * @export - */ -export const SysCodeGenTemplateApiFp = function(configuration?: Configuration) { - return { - /** - * - * @summary 获取代码生成模板配置列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenTemplateListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCodeGenTemplateApiAxiosParamCreator(configuration).apiSysCodeGenTemplateListGet(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - } -}; - -/** - * SysCodeGenTemplateApi - factory interface - * @export - */ -export const SysCodeGenTemplateApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - return { - /** - * - * @summary 获取代码生成模板配置列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCodeGenTemplateListGet(options?: AxiosRequestConfig): Promise> { - return SysCodeGenTemplateApiFp(configuration).apiSysCodeGenTemplateListGet(options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * SysCodeGenTemplateApi - object-oriented interface - * @export - * @class SysCodeGenTemplateApi - * @extends {BaseAPI} - */ -export class SysCodeGenTemplateApi extends BaseAPI { - /** - * - * @summary 获取代码生成模板配置列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCodeGenTemplateApi - */ - public async apiSysCodeGenTemplateListGet(options?: AxiosRequestConfig) : Promise> { - return SysCodeGenTemplateApiFp(this.configuration).apiSysCodeGenTemplateListGet(options).then((request) => request(this.axios, this.basePath)); - } -} diff --git a/Web/src/api-services/system/apis/sys-common-api.ts b/Web/src/api-services/system/apis/sys-common-api.ts index bd039dd1..897d3a5f 100644 --- a/Web/src/api-services/system/apis/sys-common-api.ts +++ b/Web/src/api-services/system/apis/sys-common-api.ts @@ -31,59 +31,6 @@ import { StressTestInput } from '../models'; */ export const SysCommonApiAxiosParamCreator = function (configuration?: Configuration) { return { - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {string} [groupName] - * @param {boolean} [isAppApi] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysCommonApiListGet: async (groupName?: string, isAppApi?: boolean, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysCommon/apiList`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - if (groupName !== undefined) { - localVarQueryParameter['groupName'] = groupName; - } - - if (isAppApi !== undefined) { - localVarQueryParameter['isAppApi'] = isAppApi; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, /** * * @summary 获取所有移动端接口 🔖 @@ -558,6 +505,49 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); + return { + url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, + options: localVarRequestOptions, + }; + }, + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + apiSysCommonSysAllApiListGet: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/sysCommon/sysAllApiList`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, 'https://example.com'); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + // http bearer authentication required + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; + } + + const query = new URLSearchParams(localVarUrlObj.search); + for (const key in localVarQueryParameter) { + query.set(key, localVarQueryParameter[key]); + } + for (const key in options.params) { + query.set(key, options.params[key]); + } + localVarUrlObj.search = (new URLSearchParams(query)).toString(); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, @@ -572,21 +562,6 @@ export const SysCommonApiAxiosParamCreator = function (configuration?: Configura */ export const SysCommonApiFp = function(configuration?: Configuration) { return { - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {string} [groupName] - * @param {boolean} [isAppApi] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCommonApiListGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonApiListGet(groupName, isAppApi, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, /** * * @summary 获取所有移动端接口 🔖 @@ -726,6 +701,19 @@ export const SysCommonApiFp = function(configuration?: Configuration) { return axios.request(axiosRequestArgs); }; }, + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonSysAllApiListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysCommonApiAxiosParamCreator(configuration).apiSysCommonSysAllApiListGet(options); + return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; + return axios.request(axiosRequestArgs); + }; + }, } }; @@ -735,17 +723,6 @@ export const SysCommonApiFp = function(configuration?: Configuration) { */ export const SysCommonApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {string} [groupName] - * @param {boolean} [isAppApi] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysCommonApiListGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig): Promise> { - return SysCommonApiFp(configuration).apiSysCommonApiListGet(groupName, isAppApi, options).then((request) => request(axios, basePath)); - }, /** * * @summary 获取所有移动端接口 🔖 @@ -845,6 +822,15 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base async apiSysCommonStressTestPost(body?: StressTestInput, options?: AxiosRequestConfig): Promise> { return SysCommonApiFp(configuration).apiSysCommonStressTestPost(body, options).then((request) => request(axios, basePath)); }, + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async apiSysCommonSysAllApiListGet(options?: AxiosRequestConfig): Promise> { + return SysCommonApiFp(configuration).apiSysCommonSysAllApiListGet(options).then((request) => request(axios, basePath)); + }, }; }; @@ -855,18 +841,6 @@ export const SysCommonApiFactory = function (configuration?: Configuration, base * @extends {BaseAPI} */ export class SysCommonApi extends BaseAPI { - /** - * - * @summary 获取所有接口/动态API 🔖 - * @param {string} [groupName] - * @param {boolean} [isAppApi] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysCommonApi - */ - public async apiSysCommonApiListGet(groupName?: string, isAppApi?: boolean, options?: AxiosRequestConfig) : Promise> { - return SysCommonApiFp(this.configuration).apiSysCommonApiListGet(groupName, isAppApi, options).then((request) => request(this.axios, this.basePath)); - } /** * * @summary 获取所有移动端接口 🔖 @@ -976,4 +950,14 @@ export class SysCommonApi extends BaseAPI { public async apiSysCommonStressTestPost(body?: StressTestInput, options?: AxiosRequestConfig) : Promise> { return SysCommonApiFp(this.configuration).apiSysCommonStressTestPost(body, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @summary 获取所有接口/动态API 🔖 + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof SysCommonApi + */ + public async apiSysCommonSysAllApiListGet(options?: AxiosRequestConfig) : Promise> { + return SysCommonApiFp(this.configuration).apiSysCommonSysAllApiListGet(options).then((request) => request(this.axios, this.basePath)); + } } diff --git a/Web/src/api-services/system/apis/sys-config-tenant-api.ts b/Web/src/api-services/system/apis/sys-config-tenant-api.ts deleted file mode 100644 index 537664b5..00000000 --- a/Web/src/api-services/system/apis/sys-config-tenant-api.ts +++ /dev/null @@ -1,891 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; -import { Configuration } from '../configuration'; -// Some imports not used depending on template conditions -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; -import { AddConfigTenantInput } from '../models'; -import { AdminNETResultListString } from '../models'; -import { AdminNETResultListSysConfigTenant } from '../models'; -import { AdminNETResultSqlSugarPagedListSysConfigTenant } from '../models'; -import { AdminNETResultString } from '../models'; -import { AdminNETResultSysConfigTenant } from '../models'; -import { BatchConfigTenantInput } from '../models'; -import { DeleteConfigTenantInput } from '../models'; -import { PageConfigTenantInput } from '../models'; -import { UpdateConfigTenantInput } from '../models'; -/** - * SysConfigTenantApi - axios parameter creator - * @export - */ -export const SysConfigTenantApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * - * @summary 增加配置参数 🔖 - * @param {AddConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantAddPost: async (body?: AddConfigTenantInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/add`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 批量删除配置参数 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantBatchDeletePost: async (body?: Array, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/batchDelete`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 批量更新配置参数值 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantBatchUpdatePost: async (body?: Array, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/batchUpdate`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 根据Code获取配置参数值 🔖 - * @param {string} code - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantConfigValueByCodeCodeGet: async (code: string, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'code' is not null or undefined - if (code === null || code === undefined) { - throw new RequiredError('code','Required parameter code was null or undefined when calling apiSysConfigTenantConfigValueByCodeCodeGet.'); - } - const localVarPath = `/api/sysConfigTenant/configValueByCode/{code}` - .replace(`{${"code"}}`, encodeURIComponent(String(code))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 删除配置参数 🔖 - * @param {DeleteConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantDeletePost: async (body?: DeleteConfigTenantInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/delete`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取配置参数详情 🔖 - * @param {number} id 主键Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantDetailGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { - // verify required parameter 'id' is not null or undefined - if (id === null || id === undefined) { - throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysConfigTenantDetailGet.'); - } - const localVarPath = `/api/sysConfigTenant/detail`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - if (id !== undefined) { - localVarQueryParameter['Id'] = id; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取分组列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantGroupListGet: async (options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/groupList`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取配置参数列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantListPost: async (body?: PageConfigTenantInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/list`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 获取配置参数分页列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantPagePost: async (body?: PageConfigTenantInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/page`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - /** - * - * @summary 更新配置参数 🔖 - * @param {UpdateConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - apiSysConfigTenantUpdatePost: async (body?: UpdateConfigTenantInput, options: AxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/sysConfigTenant/update`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, 'https://example.com'); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication Bearer required - // http bearer authentication required - if (configuration && configuration.accessToken) { - const accessToken = typeof configuration.accessToken === 'function' - ? await configuration.accessToken() - : await configuration.accessToken; - localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; - } - - localVarHeaderParameter['Content-Type'] = 'application/json-patch+json'; - - const query = new URLSearchParams(localVarUrlObj.search); - for (const key in localVarQueryParameter) { - query.set(key, localVarQueryParameter[key]); - } - for (const key in options.params) { - query.set(key, options.params[key]); - } - localVarUrlObj.search = (new URLSearchParams(query)).toString(); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; - localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); - - return { - url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, - options: localVarRequestOptions, - }; - }, - } -}; - -/** - * SysConfigTenantApi - functional programming interface - * @export - */ -export const SysConfigTenantApiFp = function(configuration?: Configuration) { - return { - /** - * - * @summary 增加配置参数 🔖 - * @param {AddConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantAddPost(body?: AddConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantAddPost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 批量删除配置参数 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantBatchDeletePost(body?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantBatchDeletePost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 批量更新配置参数值 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantBatchUpdatePost(body?: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantBatchUpdatePost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 根据Code获取配置参数值 🔖 - * @param {string} code - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantConfigValueByCodeCodeGet(code: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantConfigValueByCodeCodeGet(code, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 删除配置参数 🔖 - * @param {DeleteConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantDeletePost(body?: DeleteConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantDeletePost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取配置参数详情 🔖 - * @param {number} id 主键Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantDetailGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantDetailGet(id, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取分组列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantGroupListGet(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantGroupListGet(options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取配置参数列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantListPost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantListPost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 获取配置参数分页列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantPagePost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantPagePost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - /** - * - * @summary 更新配置参数 🔖 - * @param {UpdateConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantUpdatePost(body?: UpdateConfigTenantInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysConfigTenantApiAxiosParamCreator(configuration).apiSysConfigTenantUpdatePost(body, options); - return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { - const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; - return axios.request(axiosRequestArgs); - }; - }, - } -}; - -/** - * SysConfigTenantApi - factory interface - * @export - */ -export const SysConfigTenantApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - return { - /** - * - * @summary 增加配置参数 🔖 - * @param {AddConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantAddPost(body?: AddConfigTenantInput, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantAddPost(body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 批量删除配置参数 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantBatchDeletePost(body?: Array, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantBatchDeletePost(body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 批量更新配置参数值 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantBatchUpdatePost(body?: Array, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantBatchUpdatePost(body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 根据Code获取配置参数值 🔖 - * @param {string} code - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantConfigValueByCodeCodeGet(code: string, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantConfigValueByCodeCodeGet(code, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 删除配置参数 🔖 - * @param {DeleteConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantDeletePost(body?: DeleteConfigTenantInput, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantDeletePost(body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取配置参数详情 🔖 - * @param {number} id 主键Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantDetailGet(id: number, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantDetailGet(id, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取分组列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantGroupListGet(options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantGroupListGet(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取配置参数列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantListPost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantListPost(body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 获取配置参数分页列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantPagePost(body?: PageConfigTenantInput, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantPagePost(body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary 更新配置参数 🔖 - * @param {UpdateConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async apiSysConfigTenantUpdatePost(body?: UpdateConfigTenantInput, options?: AxiosRequestConfig): Promise> { - return SysConfigTenantApiFp(configuration).apiSysConfigTenantUpdatePost(body, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * SysConfigTenantApi - object-oriented interface - * @export - * @class SysConfigTenantApi - * @extends {BaseAPI} - */ -export class SysConfigTenantApi extends BaseAPI { - /** - * - * @summary 增加配置参数 🔖 - * @param {AddConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantAddPost(body?: AddConfigTenantInput, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantAddPost(body, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 批量删除配置参数 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantBatchDeletePost(body?: Array, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantBatchDeletePost(body, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 批量更新配置参数值 🔖 - * @param {Array} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantBatchUpdatePost(body?: Array, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantBatchUpdatePost(body, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 根据Code获取配置参数值 🔖 - * @param {string} code - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantConfigValueByCodeCodeGet(code: string, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantConfigValueByCodeCodeGet(code, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 删除配置参数 🔖 - * @param {DeleteConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantDeletePost(body?: DeleteConfigTenantInput, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantDeletePost(body, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取配置参数详情 🔖 - * @param {number} id 主键Id - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantDetailGet(id: number, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantDetailGet(id, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取分组列表 🔖 - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantGroupListGet(options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantGroupListGet(options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取配置参数列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantListPost(body?: PageConfigTenantInput, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantListPost(body, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 获取配置参数分页列表 🔖 - * @param {PageConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantPagePost(body?: PageConfigTenantInput, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantPagePost(body, options).then((request) => request(this.axios, this.basePath)); - } - /** - * - * @summary 更新配置参数 🔖 - * @param {UpdateConfigTenantInput} [body] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof SysConfigTenantApi - */ - public async apiSysConfigTenantUpdatePost(body?: UpdateConfigTenantInput, options?: AxiosRequestConfig) : Promise> { - return SysConfigTenantApiFp(this.configuration).apiSysConfigTenantUpdatePost(body, options).then((request) => request(this.axios, this.basePath)); - } -} diff --git a/Web/src/api-services/system/apis/sys-role-api.ts b/Web/src/api-services/system/apis/sys-role-api.ts index 6648fc73..b35e2764 100644 --- a/Web/src/api-services/system/apis/sys-role-api.ts +++ b/Web/src/api-services/system/apis/sys-role-api.ts @@ -34,7 +34,6 @@ import { RoleMenuInput } from '../models'; import { RoleOrgInput } from '../models'; import { RoleTableInput } from '../models'; import { RoleUserInput } from '../models'; -import { StatusEnum } from '../models'; import { UpdateRoleInput } from '../models'; /** * SysRoleApi - axios parameter creator @@ -516,11 +515,10 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati * * @summary 根据角色Id获取菜单Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysRoleOwnMenuListGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise => { + apiSysRoleOwnMenuListGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysRoleOwnMenuListGet.'); @@ -545,10 +543,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; } - if (status !== undefined) { - localVarQueryParameter['Status'] = status; - } - if (id !== undefined) { localVarQueryParameter['Id'] = id; } @@ -573,11 +567,10 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati * * @summary 根据角色Id获取机构Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysRoleOwnOrgListGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise => { + apiSysRoleOwnOrgListGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysRoleOwnOrgListGet.'); @@ -602,10 +595,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; } - if (status !== undefined) { - localVarQueryParameter['Status'] = status; - } - if (id !== undefined) { localVarQueryParameter['Id'] = id; } @@ -678,11 +667,10 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati * * @summary 获取角色接口黑名单集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - apiSysRoleRoleApiListGet: async (id: number, status?: StatusEnum, options: AxiosRequestConfig = {}): Promise => { + apiSysRoleRoleApiListGet: async (id: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new RequiredError('id','Required parameter id was null or undefined when calling apiSysRoleRoleApiListGet.'); @@ -707,10 +695,6 @@ export const SysRoleApiAxiosParamCreator = function (configuration?: Configurati localVarHeaderParameter["Authorization"] = "Bearer " + accessToken; } - if (status !== undefined) { - localVarQueryParameter['Status'] = status; - } - if (id !== undefined) { localVarQueryParameter['Id'] = id; } @@ -1113,12 +1097,11 @@ export const SysRoleApiFp = function(configuration?: Configuration) { * * @summary 根据角色Id获取菜单Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysRoleOwnMenuListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleOwnMenuListGet(id, status, options); + async apiSysRoleOwnMenuListGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleOwnMenuListGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -1128,12 +1111,11 @@ export const SysRoleApiFp = function(configuration?: Configuration) { * * @summary 根据角色Id获取机构Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysRoleOwnOrgListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleOwnOrgListGet(id, status, options); + async apiSysRoleOwnOrgListGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleOwnOrgListGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -1157,12 +1139,11 @@ export const SysRoleApiFp = function(configuration?: Configuration) { * * @summary 获取角色接口黑名单集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysRoleRoleApiListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { - const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleRoleApiListGet(id, status, options); + async apiSysRoleRoleApiListGet(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { + const localVarAxiosArgs = await SysRoleApiAxiosParamCreator(configuration).apiSysRoleRoleApiListGet(id, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); @@ -1347,23 +1328,21 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa * * @summary 根据角色Id获取菜单Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysRoleOwnMenuListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise> { - return SysRoleApiFp(configuration).apiSysRoleOwnMenuListGet(id, status, options).then((request) => request(axios, basePath)); + async apiSysRoleOwnMenuListGet(id: number, options?: AxiosRequestConfig): Promise> { + return SysRoleApiFp(configuration).apiSysRoleOwnMenuListGet(id, options).then((request) => request(axios, basePath)); }, /** * * @summary 根据角色Id获取机构Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysRoleOwnOrgListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise> { - return SysRoleApiFp(configuration).apiSysRoleOwnOrgListGet(id, status, options).then((request) => request(axios, basePath)); + async apiSysRoleOwnOrgListGet(id: number, options?: AxiosRequestConfig): Promise> { + return SysRoleApiFp(configuration).apiSysRoleOwnOrgListGet(id, options).then((request) => request(axios, basePath)); }, /** * @@ -1379,12 +1358,11 @@ export const SysRoleApiFactory = function (configuration?: Configuration, basePa * * @summary 获取角色接口黑名单集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async apiSysRoleRoleApiListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig): Promise> { - return SysRoleApiFp(configuration).apiSysRoleRoleApiListGet(id, status, options).then((request) => request(axios, basePath)); + async apiSysRoleRoleApiListGet(id: number, options?: AxiosRequestConfig): Promise> { + return SysRoleApiFp(configuration).apiSysRoleRoleApiListGet(id, options).then((request) => request(axios, basePath)); }, /** * @@ -1556,25 +1534,23 @@ export class SysRoleApi extends BaseAPI { * * @summary 根据角色Id获取菜单Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysRoleApi */ - public async apiSysRoleOwnMenuListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise> { - return SysRoleApiFp(this.configuration).apiSysRoleOwnMenuListGet(id, status, options).then((request) => request(this.axios, this.basePath)); + public async apiSysRoleOwnMenuListGet(id: number, options?: AxiosRequestConfig) : Promise> { + return SysRoleApiFp(this.configuration).apiSysRoleOwnMenuListGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary 根据角色Id获取机构Id集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysRoleApi */ - public async apiSysRoleOwnOrgListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise> { - return SysRoleApiFp(this.configuration).apiSysRoleOwnOrgListGet(id, status, options).then((request) => request(this.axios, this.basePath)); + public async apiSysRoleOwnOrgListGet(id: number, options?: AxiosRequestConfig) : Promise> { + return SysRoleApiFp(this.configuration).apiSysRoleOwnOrgListGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * @@ -1591,13 +1567,12 @@ export class SysRoleApi extends BaseAPI { * * @summary 获取角色接口黑名单集合 🔖 * @param {number} id 主键Id - * @param {StatusEnum} [status] 状态 * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SysRoleApi */ - public async apiSysRoleRoleApiListGet(id: number, status?: StatusEnum, options?: AxiosRequestConfig) : Promise> { - return SysRoleApiFp(this.configuration).apiSysRoleRoleApiListGet(id, status, options).then((request) => request(this.axios, this.basePath)); + public async apiSysRoleRoleApiListGet(id: number, options?: AxiosRequestConfig) : Promise> { + return SysRoleApiFp(this.configuration).apiSysRoleRoleApiListGet(id, options).then((request) => request(this.axios, this.basePath)); } /** * diff --git a/Web/src/api-services/system/models/add-code-gen-input.ts b/Web/src/api-services/system/models/add-code-gen-input.ts index a26ae712..8f959f49 100644 --- a/Web/src/api-services/system/models/add-code-gen-input.ts +++ b/Web/src/api-services/system/models/add-code-gen-input.ts @@ -12,10 +12,13 @@ * Do not edit the class manually. */ -import { Filter } from './filter'; -import { Search } from './search'; +import { AddSysCodeGenTable } from './add-sys-code-gen-table'; +import { CodeGenMethodEnum } from './code-gen-method-enum'; +import { CodeGenPrintTypeEnum } from './code-gen-print-type-enum'; +import { CodeGenSceneEnum } from './code-gen-scene-enum'; +import { EffectTreeConfigInput } from './effect-tree-config-input'; /** - * + * 代码生成参数类 * * @export * @interface AddCodeGenInput @@ -23,152 +26,114 @@ import { Search } from './search'; export interface AddCodeGenInput { /** - * @type {Search} - * @memberof AddCodeGenInput - */ - search?: Search; - - /** - * 模糊查询关键字 - * - * @type {string} - * @memberof AddCodeGenInput - */ - keyword?: string | null; - - /** - * @type {Filter} - * @memberof AddCodeGenInput - */ - filter?: Filter; - - /** - * 当前页码 + * 雪花Id * * @type {number} * @memberof AddCodeGenInput */ - page?: number; + id?: number; /** - * 页码容量 + * 创建时间 + * + * @type {Date} + * @memberof AddCodeGenInput + */ + createTime?: Date; + + /** + * 更新时间 + * + * @type {Date} + * @memberof AddCodeGenInput + */ + updateTime?: Date | null; + + /** + * 创建者Id * * @type {number} * @memberof AddCodeGenInput */ - pageSize?: number; + createUserId?: number | null; /** - * 排序字段 + * 创建者姓名 * * @type {string} * @memberof AddCodeGenInput */ - field?: string | null; + createUserName?: string | null; /** - * 排序方向 - * - * @type {string} - * @memberof AddCodeGenInput - */ - order?: string | null; - - /** - * 降序排序 - * - * @type {string} - * @memberof AddCodeGenInput - */ - descStr?: string | null; - - /** - * 类名 - * - * @type {string} - * @memberof AddCodeGenInput - */ - className?: string | null; - - /** - * 是否移除表前缀 - * - * @type {string} - * @memberof AddCodeGenInput - */ - tablePrefix?: string | null; - - /** - * 库定位器名 - * - * @type {string} - * @memberof AddCodeGenInput - */ - configId?: string | null; - - /** - * 数据库名(保留字段) - * - * @type {string} - * @memberof AddCodeGenInput - */ - dbName?: string | null; - - /** - * 数据库类型 - * - * @type {string} - * @memberof AddCodeGenInput - */ - dbType?: string | null; - - /** - * 数据库链接 - * - * @type {string} - * @memberof AddCodeGenInput - */ - connectionString?: string | null; - - /** - * 树控件名称 - * - * @type {string} - * @memberof AddCodeGenInput - */ - treeName?: string | null; - - /** - * 树控件key - * - * @type {string} - * @memberof AddCodeGenInput - */ - treeKey?: string | null; - - /** - * 功能名(数据库表名称) - * - * @type {string} - * @memberof AddCodeGenInput - */ - tableComment?: string | null; - - /** - * 菜单应用分类(应用编码) - * - * @type {string} - * @memberof AddCodeGenInput - */ - menuApplication?: string | null; - - /** - * 菜单父级 + * 修改者Id * * @type {number} * @memberof AddCodeGenInput */ - menuPid?: number | null; + updateUserId?: number | null; + + /** + * 修改者姓名 + * + * @type {string} + * @memberof AddCodeGenInput + */ + updateUserName?: string | null; + + /** + * 软删除 + * + * @type {boolean} + * @memberof AddCodeGenInput + */ + isDelete?: boolean; + + /** + * 作者姓名 + * + * @type {string} + * @memberof AddCodeGenInput + */ + authorName?: string | null; + + /** + * 作者邮箱 + * + * @type {string} + * @memberof AddCodeGenInput + */ + email?: string | null; + + /** + * @type {EffectTreeConfigInput} + * @memberof AddCodeGenInput + */ + treeConfig?: EffectTreeConfigInput; + + /** + * 模块名称 + * + * @type {string} + * @memberof AddCodeGenInput + */ + moduleName?: string | null; + + /** + * 是否水平布局 + * + * @type {boolean} + * @memberof AddCodeGenInput + */ + isHorizontal?: boolean; + + /** + * 是否生成菜单 + * + * @type {boolean} + * @memberof AddCodeGenInput + */ + generateMenu?: boolean; /** * 菜单图标 @@ -179,20 +144,12 @@ export interface AddCodeGenInput { menuIcon?: string | null; /** - * 页面目录 + * 菜单编码 * - * @type {string} + * @type {number} * @memberof AddCodeGenInput */ - pagePath?: string | null; - - /** - * 支持打印类型 - * - * @type {string} - * @memberof AddCodeGenInput - */ - printType?: string | null; + menuPid?: number; /** * 打印模版名称 @@ -203,20 +160,40 @@ export interface AddCodeGenInput { printName?: string | null; /** - * 数据库表名 + * 是否使用 Api Service * - * @type {string} + * @type {boolean} * @memberof AddCodeGenInput */ - tableName: string; + isApiService?: boolean; /** - * 业务名(业务代码包名称) + * 关联表 + * + * @type {Array} + * @memberof AddCodeGenInput + */ + tableList: Array; + + /** + * 简拼 * * @type {string} * @memberof AddCodeGenInput */ - busName: string; + pinyin?: string | null; + + /** + * @type {CodeGenMethodEnum} + * @memberof AddCodeGenInput + */ + generateMethod?: CodeGenMethodEnum; + + /** + * @type {CodeGenSceneEnum} + * @memberof AddCodeGenInput + */ + scene?: CodeGenSceneEnum; /** * 命名空间 @@ -227,114 +204,24 @@ export interface AddCodeGenInput { nameSpace: string; /** - * 作者姓名 + * 业务名 * * @type {string} * @memberof AddCodeGenInput */ - authorName: string; + busName: string; /** - * 生成方式 + * 页面目录 * * @type {string} * @memberof AddCodeGenInput */ - generateType: string; + pagePath: string; /** - * 是否生成菜单 - * - * @type {boolean} + * @type {CodeGenPrintTypeEnum} * @memberof AddCodeGenInput */ - generateMenu: boolean; - - /** - * 是否使用 Api Service - * - * @type {boolean} - * @memberof AddCodeGenInput - */ - isApiService?: boolean; - - /** - * 模板Id集合 - * - * @type {Array} - * @memberof AddCodeGenInput - */ - codeGenTemplateIds?: Array | null; - - /** - * 左边树形结构表 - * - * @type {string} - * @memberof AddCodeGenInput - */ - leftTab?: string | null; - - /** - * 左边关联字段 - * - * @type {string} - * @memberof AddCodeGenInput - */ - leftKey?: string | null; - - /** - * 左边关联主表字段 - * - * @type {string} - * @memberof AddCodeGenInput - */ - leftPrimaryKey?: string | null; - - /** - * 左边树Name - * - * @type {string} - * @memberof AddCodeGenInput - */ - leftName?: string | null; - - /** - * 下表名称 - * - * @type {string} - * @memberof AddCodeGenInput - */ - bottomTab?: string | null; - - /** - * 下表关联字段 - * - * @type {string} - * @memberof AddCodeGenInput - */ - bottomKey?: string | null; - - /** - * 下表关联主表字段 - * - * @type {string} - * @memberof AddCodeGenInput - */ - bottomPrimaryKey?: string | null; - - /** - * 模板 - * - * @type {string} - * @memberof AddCodeGenInput - */ - template?: string | null; - - /** - * 表类型 - * - * @type {string} - * @memberof AddCodeGenInput - */ - tabType?: string | null; + printType?: CodeGenPrintTypeEnum; } diff --git a/Web/src/api-services/system/models/add-config-tenant-input.ts b/Web/src/api-services/system/models/add-config-tenant-input.ts deleted file mode 100644 index e7c8ba26..00000000 --- a/Web/src/api-services/system/models/add-config-tenant-input.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { YesNoEnum } from './yes-no-enum'; - /** - * - * - * @export - * @interface AddConfigTenantInput - */ -export interface AddConfigTenantInput { - - /** - * 雪花Id - * - * @type {number} - * @memberof AddConfigTenantInput - */ - id?: number; - - /** - * 创建时间 - * - * @type {Date} - * @memberof AddConfigTenantInput - */ - createTime?: Date; - - /** - * 更新时间 - * - * @type {Date} - * @memberof AddConfigTenantInput - */ - updateTime?: Date | null; - - /** - * 创建者Id - * - * @type {number} - * @memberof AddConfigTenantInput - */ - createUserId?: number | null; - - /** - * 创建者姓名 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - createUserName?: string | null; - - /** - * 修改者Id - * - * @type {number} - * @memberof AddConfigTenantInput - */ - updateUserId?: number | null; - - /** - * 修改者姓名 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - updateUserName?: string | null; - - /** - * 软删除 - * - * @type {boolean} - * @memberof AddConfigTenantInput - */ - isDelete?: boolean; - - /** - * 名称 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - name: string; - - /** - * 编码 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - code?: string | null; - - /** - * 参数值 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - value?: string | null; - - /** - * @type {YesNoEnum} - * @memberof AddConfigTenantInput - */ - sysFlag?: YesNoEnum; - - /** - * 分组编码 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - groupCode?: string | null; - - /** - * 排序 - * - * @type {number} - * @memberof AddConfigTenantInput - */ - orderNo?: number; - - /** - * 备注 - * - * @type {string} - * @memberof AddConfigTenantInput - */ - remark?: string | null; - - /** - * 租户Id - * - * @type {number} - * @memberof AddConfigTenantInput - */ - tenantId?: number | null; -} diff --git a/Web/src/api-services/system/models/add-dict-type-input.ts b/Web/src/api-services/system/models/add-dict-type-input.ts index f075dcc4..8e137434 100644 --- a/Web/src/api-services/system/models/add-dict-type-input.ts +++ b/Web/src/api-services/system/models/add-dict-type-input.ts @@ -125,12 +125,6 @@ export interface AddDictTypeInput { */ status?: StatusEnum; - /** - * @type {YesNoEnum} - * @memberof AddDictTypeInput - */ - isTenant?: YesNoEnum; - /** * @type {YesNoEnum} * @memberof AddDictTypeInput diff --git a/Web/src/api-services/system/models/add-sys-code-gen-column.ts b/Web/src/api-services/system/models/add-sys-code-gen-column.ts new file mode 100644 index 00000000..48debcc3 --- /dev/null +++ b/Web/src/api-services/system/models/add-sys-code-gen-column.ts @@ -0,0 +1,268 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { CodeGenEffectTypeEnum } from './code-gen-effect-type-enum'; +import { CodeGenFromRuleValidEnum } from './code-gen-from-rule-valid-enum'; + /** + * 增加表字段输入参数 + * + * @export + * @interface AddSysCodeGenColumn + */ +export interface AddSysCodeGenColumn { + + /** + * 雪花Id + * + * @type {number} + * @memberof AddSysCodeGenColumn + */ + id?: number; + + /** + * 创建时间 + * + * @type {Date} + * @memberof AddSysCodeGenColumn + */ + createTime?: Date; + + /** + * 更新时间 + * + * @type {Date} + * @memberof AddSysCodeGenColumn + */ + updateTime?: Date | null; + + /** + * 创建者Id + * + * @type {number} + * @memberof AddSysCodeGenColumn + */ + createUserId?: number | null; + + /** + * 创建者姓名 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + createUserName?: string | null; + + /** + * 修改者Id + * + * @type {number} + * @memberof AddSysCodeGenColumn + */ + updateUserId?: number | null; + + /** + * 修改者姓名 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + updateUserName?: string | null; + + /** + * 软删除 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isDelete?: boolean; + + /** + * 字段数据长度 + * + * @type {number} + * @memberof AddSysCodeGenColumn + */ + columnLength?: number | null; + + /** + * 控件配置 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + config?: string | null; + + /** + * 主键 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isPrimarykey?: boolean; + + /** + * 是否通用字段 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isCommon?: boolean; + + /** + * 是否必填 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isRequired?: boolean; + + /** + * 增改 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isAddUpdate?: boolean; + + /** + * 导入导出 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isImport?: boolean; + + /** + * 是否可排序 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isSortable?: boolean; + + /** + * 是否是统计字段 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isStatistical?: boolean; + + /** + * 是否是查询条件 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isQuery?: boolean; + + /** + * 查询方式 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + queryType?: string | null; + + /** + * 列表显示 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isTable?: boolean; + + /** + * 内容复制 + * + * @type {boolean} + * @memberof AddSysCodeGenColumn + */ + isCopy?: boolean; + + /** + * 默认值 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + defaultValue?: string | null; + + /** + * 排序 + * + * @type {number} + * @memberof AddSysCodeGenColumn + */ + orderNo?: number; + + /** + * 代码生成表Id + * + * @type {number} + * @memberof AddSysCodeGenColumn + */ + codeGenTableId: number; + + /** + * 数据库字段名 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + columnName: string; + + /** + * 实体属性名 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + propertyName: string; + + /** + * .NET数据类型 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + netType: string; + + /** + * 数据库中类型(物理类型) + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + dataType: string; + + /** + * 字段描述 + * + * @type {string} + * @memberof AddSysCodeGenColumn + */ + columnComment: string; + + /** + * @type {CodeGenEffectTypeEnum} + * @memberof AddSysCodeGenColumn + */ + effectType?: CodeGenEffectTypeEnum; + + /** + * @type {CodeGenFromRuleValidEnum} + * @memberof AddSysCodeGenColumn + */ + fromValid?: CodeGenFromRuleValidEnum; +} diff --git a/Web/src/api-services/system/models/update-config-tenant-input.ts b/Web/src/api-services/system/models/add-sys-code-gen-table.ts similarity index 57% rename from Web/src/api-services/system/models/update-config-tenant-input.ts rename to Web/src/api-services/system/models/add-sys-code-gen-table.ts index 13d0a25e..0a6e711f 100644 --- a/Web/src/api-services/system/models/update-config-tenant-input.ts +++ b/Web/src/api-services/system/models/add-sys-code-gen-table.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { YesNoEnum } from './yes-no-enum'; +import { AddSysCodeGenColumn } from './add-sys-code-gen-column'; /** - * + * 添加关联表 * * @export - * @interface UpdateConfigTenantInput + * @interface AddSysCodeGenTable */ -export interface UpdateConfigTenantInput { +export interface AddSysCodeGenTable { /** * 雪花Id * * @type {number} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ id?: number; @@ -33,7 +33,7 @@ export interface UpdateConfigTenantInput { * 创建时间 * * @type {Date} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ createTime?: Date; @@ -41,7 +41,7 @@ export interface UpdateConfigTenantInput { * 更新时间 * * @type {Date} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ updateTime?: Date | null; @@ -49,7 +49,7 @@ export interface UpdateConfigTenantInput { * 创建者Id * * @type {number} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ createUserId?: number | null; @@ -57,7 +57,7 @@ export interface UpdateConfigTenantInput { * 创建者姓名 * * @type {string} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ createUserName?: string | null; @@ -65,7 +65,7 @@ export interface UpdateConfigTenantInput { * 修改者Id * * @type {number} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ updateUserId?: number | null; @@ -73,7 +73,7 @@ export interface UpdateConfigTenantInput { * 修改者姓名 * * @type {string} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ updateUserName?: string | null; @@ -81,69 +81,79 @@ export interface UpdateConfigTenantInput { * 软删除 * * @type {boolean} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ isDelete?: boolean; /** - * 名称 + * 上级联表字段 * * @type {string} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ - name: string; + lastLinkPropertyName?: string | null; /** - * 编码 + * 下级联表字段 * * @type {string} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ - code?: string | null; + nextLinkPropertyName?: string | null; /** - * 参数值 + * 字段列表 * - * @type {string} - * @memberof UpdateConfigTenantInput + * @type {Array} + * @memberof AddSysCodeGenTable */ - value?: string | null; + columnList: Array; /** - * @type {YesNoEnum} - * @memberof UpdateConfigTenantInput - */ - sysFlag?: YesNoEnum; - - /** - * 分组编码 - * - * @type {string} - * @memberof UpdateConfigTenantInput - */ - groupCode?: string | null; - - /** - * 排序 + * 代码生成Id * * @type {number} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ - orderNo?: number; + codeGenId: number; /** - * 备注 + * 数据库配置id * * @type {string} - * @memberof UpdateConfigTenantInput + * @memberof AddSysCodeGenTable */ - remark?: string | null; + configId: string; /** - * 租户Id + * 数据库表名 * - * @type {number} - * @memberof UpdateConfigTenantInput + * @type {string} + * @memberof AddSysCodeGenTable */ - tenantId?: number | null; + tableName: string; + + /** + * 表实体名称 + * + * @type {string} + * @memberof AddSysCodeGenTable + */ + entityName: string; + + /** + * 模块名称 + * + * @type {string} + * @memberof AddSysCodeGenTable + */ + moduleName: string; + + /** + * 业务名称 + * + * @type {string} + * @memberof AddSysCodeGenTable + */ + busName: string; } diff --git a/Web/src/api-services/system/models/admin-netresult-list-sys-code-gen-template.ts b/Web/src/api-services/system/models/admin-netresult-list-code-gen-column-config.ts similarity index 67% rename from Web/src/api-services/system/models/admin-netresult-list-sys-code-gen-template.ts rename to Web/src/api-services/system/models/admin-netresult-list-code-gen-column-config.ts index 6d9a24b5..8f1845cc 100644 --- a/Web/src/api-services/system/models/admin-netresult-list-sys-code-gen-template.ts +++ b/Web/src/api-services/system/models/admin-netresult-list-code-gen-column-config.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { SysCodeGenTemplate } from './sys-code-gen-template'; +import { CodeGenColumnConfig } from './code-gen-column-config'; /** * 全局返回结果 * * @export - * @interface AdminNETResultListSysCodeGenTemplate + * @interface AdminNETResultListCodeGenColumnConfig */ -export interface AdminNETResultListSysCodeGenTemplate { +export interface AdminNETResultListCodeGenColumnConfig { /** * 状态码 * * @type {number} - * @memberof AdminNETResultListSysCodeGenTemplate + * @memberof AdminNETResultListCodeGenColumnConfig */ code?: number; @@ -33,7 +33,7 @@ export interface AdminNETResultListSysCodeGenTemplate { * 类型success、warning、error * * @type {string} - * @memberof AdminNETResultListSysCodeGenTemplate + * @memberof AdminNETResultListCodeGenColumnConfig */ type?: string | null; @@ -41,23 +41,23 @@ export interface AdminNETResultListSysCodeGenTemplate { * 错误信息 * * @type {string} - * @memberof AdminNETResultListSysCodeGenTemplate + * @memberof AdminNETResultListCodeGenColumnConfig */ message?: string | null; /** * 数据 * - * @type {Array} - * @memberof AdminNETResultListSysCodeGenTemplate + * @type {Array} + * @memberof AdminNETResultListCodeGenColumnConfig */ - result?: Array | null; + result?: Array | null; /** * 附加数据 * * @type {any} - * @memberof AdminNETResultListSysCodeGenTemplate + * @memberof AdminNETResultListCodeGenColumnConfig */ extras?: any | null; @@ -65,7 +65,7 @@ export interface AdminNETResultListSysCodeGenTemplate { * 时间 * * @type {Date} - * @memberof AdminNETResultListSysCodeGenTemplate + * @memberof AdminNETResultListCodeGenColumnConfig */ time?: Date; } diff --git a/Web/src/api-services/system/models/admin-netresult-list-code-gen-config.ts b/Web/src/api-services/system/models/admin-netresult-list-code-gen-config.ts deleted file mode 100644 index fa9f1cc1..00000000 --- a/Web/src/api-services/system/models/admin-netresult-list-code-gen-config.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { CodeGenConfig } from './code-gen-config'; - /** - * 全局返回结果 - * - * @export - * @interface AdminNETResultListCodeGenConfig - */ -export interface AdminNETResultListCodeGenConfig { - - /** - * 状态码 - * - * @type {number} - * @memberof AdminNETResultListCodeGenConfig - */ - code?: number; - - /** - * 类型success、warning、error - * - * @type {string} - * @memberof AdminNETResultListCodeGenConfig - */ - type?: string | null; - - /** - * 错误信息 - * - * @type {string} - * @memberof AdminNETResultListCodeGenConfig - */ - message?: string | null; - - /** - * 数据 - * - * @type {Array} - * @memberof AdminNETResultListCodeGenConfig - */ - result?: Array | null; - - /** - * 附加数据 - * - * @type {any} - * @memberof AdminNETResultListCodeGenConfig - */ - extras?: any | null; - - /** - * 时间 - * - * @type {Date} - * @memberof AdminNETResultListCodeGenConfig - */ - time?: Date; -} diff --git a/Web/src/api-services/system/models/admin-netresult-list-column-ouput.ts b/Web/src/api-services/system/models/admin-netresult-list-column-output.ts similarity index 71% rename from Web/src/api-services/system/models/admin-netresult-list-column-ouput.ts rename to Web/src/api-services/system/models/admin-netresult-list-column-output.ts index f54f6e0f..96691f45 100644 --- a/Web/src/api-services/system/models/admin-netresult-list-column-ouput.ts +++ b/Web/src/api-services/system/models/admin-netresult-list-column-output.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { ColumnOuput } from './column-ouput'; +import { ColumnOutput } from './column-output'; /** * 全局返回结果 * * @export - * @interface AdminNETResultListColumnOuput + * @interface AdminNETResultListColumnOutput */ -export interface AdminNETResultListColumnOuput { +export interface AdminNETResultListColumnOutput { /** * 状态码 * * @type {number} - * @memberof AdminNETResultListColumnOuput + * @memberof AdminNETResultListColumnOutput */ code?: number; @@ -33,7 +33,7 @@ export interface AdminNETResultListColumnOuput { * 类型success、warning、error * * @type {string} - * @memberof AdminNETResultListColumnOuput + * @memberof AdminNETResultListColumnOutput */ type?: string | null; @@ -41,23 +41,23 @@ export interface AdminNETResultListColumnOuput { * 错误信息 * * @type {string} - * @memberof AdminNETResultListColumnOuput + * @memberof AdminNETResultListColumnOutput */ message?: string | null; /** * 数据 * - * @type {Array} - * @memberof AdminNETResultListColumnOuput + * @type {Array} + * @memberof AdminNETResultListColumnOutput */ - result?: Array | null; + result?: Array | null; /** * 附加数据 * * @type {any} - * @memberof AdminNETResultListColumnOuput + * @memberof AdminNETResultListColumnOutput */ extras?: any | null; @@ -65,7 +65,7 @@ export interface AdminNETResultListColumnOuput { * 时间 * * @type {Date} - * @memberof AdminNETResultListColumnOuput + * @memberof AdminNETResultListColumnOutput */ time?: Date; } diff --git a/Web/src/api-services/system/models/admin-netresult-list-sys-config-tenant.ts b/Web/src/api-services/system/models/admin-netresult-list-sys-code-gen-column.ts similarity index 69% rename from Web/src/api-services/system/models/admin-netresult-list-sys-config-tenant.ts rename to Web/src/api-services/system/models/admin-netresult-list-sys-code-gen-column.ts index e5744e2d..620f4b8a 100644 --- a/Web/src/api-services/system/models/admin-netresult-list-sys-config-tenant.ts +++ b/Web/src/api-services/system/models/admin-netresult-list-sys-code-gen-column.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { SysConfigTenant } from './sys-config-tenant'; +import { SysCodeGenColumn } from './sys-code-gen-column'; /** * 全局返回结果 * * @export - * @interface AdminNETResultListSysConfigTenant + * @interface AdminNETResultListSysCodeGenColumn */ -export interface AdminNETResultListSysConfigTenant { +export interface AdminNETResultListSysCodeGenColumn { /** * 状态码 * * @type {number} - * @memberof AdminNETResultListSysConfigTenant + * @memberof AdminNETResultListSysCodeGenColumn */ code?: number; @@ -33,7 +33,7 @@ export interface AdminNETResultListSysConfigTenant { * 类型success、warning、error * * @type {string} - * @memberof AdminNETResultListSysConfigTenant + * @memberof AdminNETResultListSysCodeGenColumn */ type?: string | null; @@ -41,23 +41,23 @@ export interface AdminNETResultListSysConfigTenant { * 错误信息 * * @type {string} - * @memberof AdminNETResultListSysConfigTenant + * @memberof AdminNETResultListSysCodeGenColumn */ message?: string | null; /** * 数据 * - * @type {Array} - * @memberof AdminNETResultListSysConfigTenant + * @type {Array} + * @memberof AdminNETResultListSysCodeGenColumn */ - result?: Array | null; + result?: Array | null; /** * 附加数据 * * @type {any} - * @memberof AdminNETResultListSysConfigTenant + * @memberof AdminNETResultListSysCodeGenColumn */ extras?: any | null; @@ -65,7 +65,7 @@ export interface AdminNETResultListSysConfigTenant { * 时间 * * @type {Date} - * @memberof AdminNETResultListSysConfigTenant + * @memberof AdminNETResultListSysCodeGenColumn */ time?: Date; } diff --git a/Web/src/api-services/system/models/admin-netresult-sql-sugar-paged-list-sys-config-tenant.ts b/Web/src/api-services/system/models/admin-netresult-sql-sugar-paged-list-sys-config-tenant.ts deleted file mode 100644 index ee44ed5d..00000000 --- a/Web/src/api-services/system/models/admin-netresult-sql-sugar-paged-list-sys-config-tenant.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { SqlSugarPagedListSysConfigTenant } from './sql-sugar-paged-list-sys-config-tenant'; - /** - * 全局返回结果 - * - * @export - * @interface AdminNETResultSqlSugarPagedListSysConfigTenant - */ -export interface AdminNETResultSqlSugarPagedListSysConfigTenant { - - /** - * 状态码 - * - * @type {number} - * @memberof AdminNETResultSqlSugarPagedListSysConfigTenant - */ - code?: number; - - /** - * 类型success、warning、error - * - * @type {string} - * @memberof AdminNETResultSqlSugarPagedListSysConfigTenant - */ - type?: string | null; - - /** - * 错误信息 - * - * @type {string} - * @memberof AdminNETResultSqlSugarPagedListSysConfigTenant - */ - message?: string | null; - - /** - * @type {SqlSugarPagedListSysConfigTenant} - * @memberof AdminNETResultSqlSugarPagedListSysConfigTenant - */ - result?: SqlSugarPagedListSysConfigTenant; - - /** - * 附加数据 - * - * @type {any} - * @memberof AdminNETResultSqlSugarPagedListSysConfigTenant - */ - extras?: any | null; - - /** - * 时间 - * - * @type {Date} - * @memberof AdminNETResultSqlSugarPagedListSysConfigTenant - */ - time?: Date; -} diff --git a/Web/src/api-services/system/models/admin-netresult-sys-code-gen-config.ts b/Web/src/api-services/system/models/admin-netresult-sys-code-gen-column.ts similarity index 70% rename from Web/src/api-services/system/models/admin-netresult-sys-code-gen-config.ts rename to Web/src/api-services/system/models/admin-netresult-sys-code-gen-column.ts index f0e04c09..5efa2f9e 100644 --- a/Web/src/api-services/system/models/admin-netresult-sys-code-gen-config.ts +++ b/Web/src/api-services/system/models/admin-netresult-sys-code-gen-column.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { SysCodeGenConfig } from './sys-code-gen-config'; +import { SysCodeGenColumn } from './sys-code-gen-column'; /** * 全局返回结果 * * @export - * @interface AdminNETResultSysCodeGenConfig + * @interface AdminNETResultSysCodeGenColumn */ -export interface AdminNETResultSysCodeGenConfig { +export interface AdminNETResultSysCodeGenColumn { /** * 状态码 * * @type {number} - * @memberof AdminNETResultSysCodeGenConfig + * @memberof AdminNETResultSysCodeGenColumn */ code?: number; @@ -33,7 +33,7 @@ export interface AdminNETResultSysCodeGenConfig { * 类型success、warning、error * * @type {string} - * @memberof AdminNETResultSysCodeGenConfig + * @memberof AdminNETResultSysCodeGenColumn */ type?: string | null; @@ -41,21 +41,21 @@ export interface AdminNETResultSysCodeGenConfig { * 错误信息 * * @type {string} - * @memberof AdminNETResultSysCodeGenConfig + * @memberof AdminNETResultSysCodeGenColumn */ message?: string | null; /** - * @type {SysCodeGenConfig} - * @memberof AdminNETResultSysCodeGenConfig + * @type {SysCodeGenColumn} + * @memberof AdminNETResultSysCodeGenColumn */ - result?: SysCodeGenConfig; + result?: SysCodeGenColumn; /** * 附加数据 * * @type {any} - * @memberof AdminNETResultSysCodeGenConfig + * @memberof AdminNETResultSysCodeGenColumn */ extras?: any | null; @@ -63,7 +63,7 @@ export interface AdminNETResultSysCodeGenConfig { * 时间 * * @type {Date} - * @memberof AdminNETResultSysCodeGenConfig + * @memberof AdminNETResultSysCodeGenColumn */ time?: Date; } diff --git a/Web/src/api-services/system/models/admin-netresult-sys-config-tenant.ts b/Web/src/api-services/system/models/admin-netresult-sys-code-gen-table.ts similarity index 71% rename from Web/src/api-services/system/models/admin-netresult-sys-config-tenant.ts rename to Web/src/api-services/system/models/admin-netresult-sys-code-gen-table.ts index b8055947..9660d203 100644 --- a/Web/src/api-services/system/models/admin-netresult-sys-config-tenant.ts +++ b/Web/src/api-services/system/models/admin-netresult-sys-code-gen-table.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { SysConfigTenant } from './sys-config-tenant'; +import { SysCodeGenTable } from './sys-code-gen-table'; /** * 全局返回结果 * * @export - * @interface AdminNETResultSysConfigTenant + * @interface AdminNETResultSysCodeGenTable */ -export interface AdminNETResultSysConfigTenant { +export interface AdminNETResultSysCodeGenTable { /** * 状态码 * * @type {number} - * @memberof AdminNETResultSysConfigTenant + * @memberof AdminNETResultSysCodeGenTable */ code?: number; @@ -33,7 +33,7 @@ export interface AdminNETResultSysConfigTenant { * 类型success、warning、error * * @type {string} - * @memberof AdminNETResultSysConfigTenant + * @memberof AdminNETResultSysCodeGenTable */ type?: string | null; @@ -41,21 +41,21 @@ export interface AdminNETResultSysConfigTenant { * 错误信息 * * @type {string} - * @memberof AdminNETResultSysConfigTenant + * @memberof AdminNETResultSysCodeGenTable */ message?: string | null; /** - * @type {SysConfigTenant} - * @memberof AdminNETResultSysConfigTenant + * @type {SysCodeGenTable} + * @memberof AdminNETResultSysCodeGenTable */ - result?: SysConfigTenant; + result?: SysCodeGenTable; /** * 附加数据 * * @type {any} - * @memberof AdminNETResultSysConfigTenant + * @memberof AdminNETResultSysCodeGenTable */ extras?: any | null; @@ -63,7 +63,7 @@ export interface AdminNETResultSysConfigTenant { * 时间 * * @type {Date} - * @memberof AdminNETResultSysConfigTenant + * @memberof AdminNETResultSysCodeGenTable */ time?: Date; } diff --git a/Web/src/api-services/system/models/api-output.ts b/Web/src/api-services/system/models/api-output.ts index 99b33d84..e2d22ecb 100644 --- a/Web/src/api-services/system/models/api-output.ts +++ b/Web/src/api-services/system/models/api-output.ts @@ -22,7 +22,15 @@ import { ApiOutput } from './api-output'; export interface ApiOutput { /** - * 名称(组名、路由名) + * 组名 + * + * @type {string} + * @memberof ApiOutput + */ + groupName?: string | null; + + /** + * 控制器名称 * * @type {string} * @memberof ApiOutput @@ -35,7 +43,15 @@ export interface ApiOutput { * @type {string} * @memberof ApiOutput */ - text?: string | null; + desc?: string | null; + + /** + * 是否是移动端接口 + * + * @type {boolean} + * @memberof ApiOutput + */ + isAppApi?: boolean; /** * 路由 diff --git a/Web/src/api-services/system/models/code-gen-column-config.ts b/Web/src/api-services/system/models/code-gen-column-config.ts new file mode 100644 index 00000000..add8bfa1 --- /dev/null +++ b/Web/src/api-services/system/models/code-gen-column-config.ts @@ -0,0 +1,480 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { CodeGenEffectTypeEnum } from './code-gen-effect-type-enum'; +import { CodeGenFromRuleValidEnum } from './code-gen-from-rule-valid-enum'; +import { EffectDatePickerConfigInput } from './effect-date-picker-config-input'; +import { EffectDictConfigInput } from './effect-dict-config-input'; +import { EffectFileConfigInput } from './effect-file-config-input'; +import { EffectTreeConfigInput } from './effect-tree-config-input'; + /** + * 代码生成详细配置参数 + * + * @export + * @interface CodeGenColumnConfig + */ +export interface CodeGenColumnConfig { + + /** + * 雪花Id + * + * @type {number} + * @memberof CodeGenColumnConfig + */ + id?: number; + + /** + * 创建时间 + * + * @type {Date} + * @memberof CodeGenColumnConfig + */ + createTime?: Date; + + /** + * 更新时间 + * + * @type {Date} + * @memberof CodeGenColumnConfig + */ + updateTime?: Date | null; + + /** + * 创建者Id + * + * @type {number} + * @memberof CodeGenColumnConfig + */ + createUserId?: number | null; + + /** + * 创建者姓名 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + createUserName?: string | null; + + /** + * 修改者Id + * + * @type {number} + * @memberof CodeGenColumnConfig + */ + updateUserId?: number | null; + + /** + * 修改者姓名 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + updateUserName?: string | null; + + /** + * 软删除 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isDelete?: boolean; + + /** + * 代码生成表Id + * + * @type {number} + * @memberof CodeGenColumnConfig + */ + codeGenTableId?: number; + + /** + * 数据库字段名 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + columnName: string; + + /** + * 实体属性名 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + propertyName: string; + + /** + * .NET数据类型 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + netType?: string | null; + + /** + * 数据库中类型(物理类型) + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + dataType?: string | null; + + /** + * 字段数据长度 + * + * @type {number} + * @memberof CodeGenColumnConfig + */ + columnLength?: number | null; + + /** + * 字段描述 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + columnComment?: string | null; + + /** + * @type {CodeGenEffectTypeEnum} + * @memberof CodeGenColumnConfig + */ + effectType?: CodeGenEffectTypeEnum; + + /** + * 控件配置 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + config?: string | null; + + /** + * 主键 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isPrimarykey?: boolean; + + /** + * 是否通用字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isCommon?: boolean; + + /** + * 是否必填 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isRequired?: boolean; + + /** + * 增改 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isAddUpdate?: boolean; + + /** + * 导入导出 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isImport?: boolean; + + /** + * 是否可排序 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isSortable?: boolean; + + /** + * 是否是统计字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isStatistical?: boolean; + + /** + * 是否是查询条件 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isQuery?: boolean; + + /** + * 查询方式 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + queryType?: string | null; + + /** + * 列表显示 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isTable?: boolean; + + /** + * 内容复制 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isCopy?: boolean; + + /** + * 默认值 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + defaultValue?: string | null; + + /** + * @type {CodeGenFromRuleValidEnum} + * @memberof CodeGenColumnConfig + */ + fromValid?: CodeGenFromRuleValidEnum; + + /** + * 排序 + * + * @type {number} + * @memberof CodeGenColumnConfig + */ + orderNo?: number; + + /** + * 首字母小写的属性名 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + lowerPropertyName?: string | null; + + /** + * 是否字典字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isDict?: boolean; + + /** + * 是否枚举字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isEnum?: boolean; + + /** + * 是否常量字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isConst?: boolean; + + /** + * 是否上传字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isUpload?: boolean; + + /** + * 是否开关字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isSwitch?: boolean; + + /** + * 是否输入框字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isInput?: boolean; + + /** + * 是否数字输入框字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isInputNumber?: boolean; + + /** + * 是否文本域字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isInputTextArea?: boolean; + + /** + * 是否时间选择器字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isDatePicker?: boolean; + + /** + * 是否外键字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isForeignKey?: boolean; + + /** + * 是否树字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isTree?: boolean; + + /** + * 是否多选字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + multiple?: boolean; + + /** + * 是否唯一字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isUnique?: boolean; + + /** + * 状态字段 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + isStatus?: boolean; + + /** + * 是否要联表 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + hasJoinTable?: boolean; + + /** + * 是否要插槽 + * + * @type {boolean} + * @memberof CodeGenColumnConfig + */ + hasSlots?: boolean; + + /** + * 连表别名 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + leftJoinAliasName?: string | null; + + /** + * @type {EffectFileConfigInput} + * @memberof CodeGenColumnConfig + */ + fileConfig?: EffectFileConfigInput; + + /** + * @type {EffectDictConfigInput} + * @memberof CodeGenColumnConfig + */ + dictConfig?: EffectDictConfigInput; + + /** + * @type {EffectTreeConfigInput} + * @memberof CodeGenColumnConfig + */ + joinConfig?: EffectTreeConfigInput; + + /** + * @type {EffectDatePickerConfigInput} + * @memberof CodeGenColumnConfig + */ + dateConfig?: EffectDatePickerConfigInput; + + /** + * 获取可空类型 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + nullableNetType?: string | null; + + /** + * 显示字段 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + displayPropertyNames?: string | null; + + /** + * 连表属性名称 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + leftJoinPropertyName?: string | null; + + /** + * 获取列格式化配置方法 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + getVxeColumnExtraConfig?: string | null; + + /** + * 获取表单验证规则 + * + * @type {string} + * @memberof CodeGenColumnConfig + */ + getFormRules?: string | null; +} diff --git a/Web/src/api-services/system/models/code-gen-config.ts b/Web/src/api-services/system/models/code-gen-config.ts deleted file mode 100644 index 21f8c833..00000000 --- a/Web/src/api-services/system/models/code-gen-config.ts +++ /dev/null @@ -1,351 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { VerifyRuleItem } from './verify-rule-item'; - /** - * 代码生成详细配置参数 - * - * @export - * @interface CodeGenConfig - */ -export interface CodeGenConfig { - - /** - * 主键Id - * - * @type {number} - * @memberof CodeGenConfig - */ - id?: number; - - /** - * 代码生成主表ID - * - * @type {number} - * @memberof CodeGenConfig - */ - codeGenId?: number; - - /** - * 数据库字段名 - * - * @type {string} - * @memberof CodeGenConfig - */ - columnName?: string | null; - - /** - * 实体属性名 - * - * @type {string} - * @memberof CodeGenConfig - */ - propertyName?: string | null; - - /** - * 字段数据长度 - * - * @type {number} - * @memberof CodeGenConfig - */ - columnLength?: number; - - /** - * 数据库字段名(首字母小写) - * - * @type {string} - * @memberof CodeGenConfig - */ - lowerPropertyName?: string | null; - - /** - * 字段描述 - * - * @type {string} - * @memberof CodeGenConfig - */ - columnComment?: string | null; - - /** - * .NET类型 - * - * @type {string} - * @memberof CodeGenConfig - */ - netType?: string | null; - - /** - * 作用类型(字典) - * - * @type {string} - * @memberof CodeGenConfig - */ - effectType?: string | null; - - /** - * 外键库标识 - * - * @type {string} - * @memberof CodeGenConfig - */ - fkConfigId?: string | null; - - /** - * 外键实体名称 - * - * @type {string} - * @memberof CodeGenConfig - */ - fkEntityName?: string | null; - - /** - * 外键表名称 - * - * @type {string} - * @memberof CodeGenConfig - */ - fkTableName?: string | null; - - /** - * 外键实体名称(首字母小写) - * - * @type {string} - * @memberof CodeGenConfig - */ - lowerFkEntityName?: string | null; - - /** - * 外键显示字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - fkColumnName?: string | null; - - /** - * 外键链接字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - fkLinkColumnName?: string | null; - - /** - * 外键显示字段(首字母小写) - * - * @type {string} - * @memberof CodeGenConfig - */ - lowerFkColumnName?: string | null; - - /** - * 外键显示字段.NET类型 - * - * @type {string} - * @memberof CodeGenConfig - */ - fkColumnNetType?: string | null; - - /** - * 字典code - * - * @type {string} - * @memberof CodeGenConfig - */ - dictTypeCode?: string | null; - - /** - * 列表是否缩进(字典) - * - * @type {string} - * @memberof CodeGenConfig - */ - whetherRetract?: string | null; - - /** - * 是否必填(字典) - * - * @type {string} - * @memberof CodeGenConfig - */ - whetherRequired?: string | null; - - /** - * 是否可排序(字典) - * - * @type {string} - * @memberof CodeGenConfig - */ - whetherSortable?: string | null; - - /** - * 是否是统计字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - statistical?: string | null; - - /** - * 是否是GroupBy字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - isGroupBy?: string | null; - - /** - * 是否是查询条件 - * - * @type {string} - * @memberof CodeGenConfig - */ - queryWhether?: string | null; - - /** - * 查询方式 - * - * @type {string} - * @memberof CodeGenConfig - */ - queryType?: string | null; - - /** - * 列表显示 - * - * @type {string} - * @memberof CodeGenConfig - */ - whetherTable?: string | null; - - /** - * 增改 - * - * @type {string} - * @memberof CodeGenConfig - */ - whetherAddUpdate?: string | null; - - /** - * 主外键 - * - * @type {string} - * @memberof CodeGenConfig - */ - columnKey?: string | null; - - /** - * 数据库中类型(物理类型) - * - * @type {string} - * @memberof CodeGenConfig - */ - dataType?: string | null; - - /** - * 是否是通用字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - whetherCommon?: string | null; - - /** - * 表的别名 Table as XXX - * - * @type {string} - * @memberof CodeGenConfig - */ - tableNickName?: string | null; - - /** - * 显示文本字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - displayColumn?: string | null; - - /** - * 选中值字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - valueColumn?: string | null; - - /** - * 父级字段 - * - * @type {string} - * @memberof CodeGenConfig - */ - pidColumn?: string | null; - - /** - * 排序 - * - * @type {number} - * @memberof CodeGenConfig - */ - orderNo?: number; - - /** - * 字段验证规则 - * - * @type {string} - * @memberof CodeGenConfig - */ - rules?: string | null; - - /** - * 默认值 - * - * @type {string} - * @memberof CodeGenConfig - */ - defaultValue?: string | null; - - /** - * 字段验证集合 - * - * @type {Array} - * @memberof CodeGenConfig - */ - ruleItems?: Array | null; - - /** - * 是否远程验证 - * - * @type {boolean} - * @memberof CodeGenConfig - */ - remoteVerify?: boolean; - - /** - * 是否存在验证规则 - * - * @type {boolean} - * @memberof CodeGenConfig - */ - anyRule?: boolean; - - /** - * 验证触发器 - * - * @type {string} - * @memberof CodeGenConfig - */ - trigger?: string | null; -} diff --git a/Web/src/api-services/system/models/code-gen-effect-type-enum.ts b/Web/src/api-services/system/models/code-gen-effect-type-enum.ts new file mode 100644 index 00000000..7538715d --- /dev/null +++ b/Web/src/api-services/system/models/code-gen-effect-type-enum.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/** + * 代码生成控件类型枚举
 输入框 Input = 100
 字典选择器 DictSelector = 101
 常量选择器 ConstSelector = 102
 枚举选择器 EnumSelector = 103
 树选择器 ApiTreeSelector = 104
 外键 ForeignKey = 105
 数字输入框 InputNumber = 106
 时间选择 DatePicker = 107
 文本域 InputTextArea = 108
 上传 Upload = 109
 开关 Switch = 110
+ * @export + * @enum {string} + */ +export enum CodeGenEffectTypeEnum { + NUMBER_100 = 100, + NUMBER_101 = 101, + NUMBER_102 = 102, + NUMBER_103 = 103, + NUMBER_104 = 104, + NUMBER_105 = 105, + NUMBER_106 = 106, + NUMBER_107 = 107, + NUMBER_108 = 108, + NUMBER_109 = 109, + NUMBER_110 = 110 +} + diff --git a/Web/src/api-services/system/models/code-gen-from-rule-valid-enum.ts b/Web/src/api-services/system/models/code-gen-from-rule-valid-enum.ts new file mode 100644 index 00000000..adc1b6a2 --- /dev/null +++ b/Web/src/api-services/system/models/code-gen-from-rule-valid-enum.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/** + * 代码生成表单校验类型枚举
 唯一性 Unique = 100
 字符串长度 MaxLength = 101
 数字范围 Range = 102
 身份证号码 IDCard = 103
 邮政编码 PostCode = 104
 手机号码 PhoneNumber = 105
 固话格式 Telephone = 106
 手机或固话类型 PhoneOrTelNumber = 107
 邮箱 EmailAddress = 108
 统一社会信用代码 SocialCreditCode = 109
 网址类型 Url = 110
 中文 Chinese = 111
 中文名 ChineseName = 112
 英文名 EnglishName = 113
 纯大写 Capital = 114
 纯小写 Lowercase = 115
 字母和数字组合 WordWithNumber = 116
 Html 标签格式 Html = 117
 GUID 或者 UUID GUID_OR_UUID = 118
 用户名 Username = 119
 日期类型 Date = 120
 时间类型 Time = 121
 年龄 Age = 122
+ * @export + * @enum {string} + */ +export enum CodeGenFromRuleValidEnum { + NUMBER_100 = 100, + NUMBER_101 = 101, + NUMBER_102 = 102, + NUMBER_103 = 103, + NUMBER_104 = 104, + NUMBER_105 = 105, + NUMBER_106 = 106, + NUMBER_107 = 107, + NUMBER_108 = 108, + NUMBER_109 = 109, + NUMBER_110 = 110, + NUMBER_111 = 111, + NUMBER_112 = 112, + NUMBER_113 = 113, + NUMBER_114 = 114, + NUMBER_115 = 115, + NUMBER_116 = 116, + NUMBER_117 = 117, + NUMBER_118 = 118, + NUMBER_119 = 119, + NUMBER_120 = 120, + NUMBER_121 = 121, + NUMBER_122 = 122 +} + diff --git a/Web/src/api-services/system/models/delete-config-tenant-input.ts b/Web/src/api-services/system/models/code-gen-method-enum.ts similarity index 55% rename from Web/src/api-services/system/models/delete-config-tenant-input.ts rename to Web/src/api-services/system/models/code-gen-method-enum.ts index d0450b8c..a7eb2671 100644 --- a/Web/src/api-services/system/models/delete-config-tenant-input.ts +++ b/Web/src/api-services/system/models/code-gen-method-enum.ts @@ -12,19 +12,17 @@ * Do not edit the class manually. */ - /** - * - * +/** + * 代码生成方式枚举
 下载压缩包 DownloadZip = 100
 下载压缩包(前端) DownloadZipFrontend = 101
 下载压缩包(后端) DownloadZipBackend = 102
 生成到本项目 GenerateToProject = 200
 生成到本项目(前端) GenerateToProjectFrontend = 201
 生成到本项目(后端) GenerateToProjectBackend = 202
* @export - * @interface DeleteConfigTenantInput + * @enum {string} */ -export interface DeleteConfigTenantInput { - - /** - * 主键Id - * - * @type {number} - * @memberof DeleteConfigTenantInput - */ - id: number; +export enum CodeGenMethodEnum { + NUMBER_100 = 100, + NUMBER_101 = 101, + NUMBER_102 = 102, + NUMBER_200 = 200, + NUMBER_201 = 201, + NUMBER_202 = 202 } + diff --git a/Web/src/api-services/system/models/code-gen-type-enum.ts b/Web/src/api-services/system/models/code-gen-print-type-enum.ts similarity index 79% rename from Web/src/api-services/system/models/code-gen-type-enum.ts rename to Web/src/api-services/system/models/code-gen-print-type-enum.ts index ece64cad..22ba5e79 100644 --- a/Web/src/api-services/system/models/code-gen-type-enum.ts +++ b/Web/src/api-services/system/models/code-gen-print-type-enum.ts @@ -13,13 +13,12 @@ */ /** - * 代码生成类型枚举
 前端 Frontend = 1
 后端 Backend = 2
 种子数据 SeedData = 3
+ * 代码生成打印类型枚举
 不需要 Off = 1
 绑定打印模版 Custom = 2
* @export * @enum {string} */ -export enum CodeGenTypeEnum { +export enum CodeGenPrintTypeEnum { NUMBER_1 = 1, - NUMBER_2 = 2, - NUMBER_3 = 3 + NUMBER_2 = 2 } diff --git a/Web/src/api-services/system/models/code-gen-scene-enum.ts b/Web/src/api-services/system/models/code-gen-scene-enum.ts new file mode 100644 index 00000000..8fe9e2f2 --- /dev/null +++ b/Web/src/api-services/system/models/code-gen-scene-enum.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/** + * 代码生成模板枚举
 单表 SingleTable = 1000
 单表树组件 TreeSingleTable = 1010
 主从表 MasterSlaveTables = 2000
 主从表树组件 TreeMasterSlaveTables = 2010
 关系对照 TableRelationship = 3000
 关系对照树组件 TreeTableRelationship = 3010
 表种子数据 TableSeedData = -2000
 表实体 TableEntity = -1000
+ * @export + * @enum {string} + */ +export enum CodeGenSceneEnum { + NUMBER_1000 = 1000, + NUMBER_1010 = 1010, + NUMBER_2000 = 2000, + NUMBER_2010 = 2010, + NUMBER_3000 = 3000, + NUMBER_3010 = 3010, + NUMBER_MINUS_2000 = -2000, + NUMBER_MINUS_1000 = -1000 +} + diff --git a/Web/src/api-services/system/models/column-ouput.ts b/Web/src/api-services/system/models/column-output.ts similarity index 79% rename from Web/src/api-services/system/models/column-ouput.ts rename to Web/src/api-services/system/models/column-output.ts index 4b3f1680..cef9821c 100644 --- a/Web/src/api-services/system/models/column-ouput.ts +++ b/Web/src/api-services/system/models/column-output.ts @@ -16,31 +16,39 @@ * 数据库表列 * * @export - * @interface ColumnOuput + * @interface ColumnOutput */ -export interface ColumnOuput { - - /** - * 字段名 - * - * @type {string} - * @memberof ColumnOuput - */ - columnName?: string | null; +export interface ColumnOutput { /** * 实体的Property名 * * @type {string} - * @memberof ColumnOuput + * @memberof ColumnOutput */ propertyName?: string | null; + /** + * .NET字段类型 + * + * @type {string} + * @memberof ColumnOutput + */ + netType?: string | null; + + /** + * 字段名 + * + * @type {string} + * @memberof ColumnOutput + */ + columnName?: string | null; + /** * 字段数据长度 * * @type {number} - * @memberof ColumnOuput + * @memberof ColumnOutput */ columnLength?: number; @@ -48,7 +56,7 @@ export interface ColumnOuput { * 数据库中类型 * * @type {string} - * @memberof ColumnOuput + * @memberof ColumnOutput */ dataType?: string | null; @@ -56,47 +64,39 @@ export interface ColumnOuput { * 是否为主键 * * @type {boolean} - * @memberof ColumnOuput + * @memberof ColumnOutput */ isPrimarykey?: boolean; + /** + * 是否为外键 + * + * @type {boolean} + * @memberof ColumnOutput + */ + isForeignKey?: boolean; + /** * 是否允许为空 * * @type {boolean} - * @memberof ColumnOuput + * @memberof ColumnOutput */ isNullable?: boolean; - /** - * .NET字段类型 - * - * @type {string} - * @memberof ColumnOuput - */ - netType?: string | null; - /** * 字段描述 * * @type {string} - * @memberof ColumnOuput + * @memberof ColumnOutput */ columnComment?: string | null; - /** - * 主外键 - * - * @type {string} - * @memberof ColumnOuput - */ - columnKey?: string | null; - /** * 默认值 * * @type {string} - * @memberof ColumnOuput + * @memberof ColumnOutput */ defaultValue?: string | null; } diff --git a/Web/src/api-services/system/models/delete-code-gen-input.ts b/Web/src/api-services/system/models/default-column-config-input.ts similarity index 67% rename from Web/src/api-services/system/models/delete-code-gen-input.ts rename to Web/src/api-services/system/models/default-column-config-input.ts index d58dc41e..7509e8af 100644 --- a/Web/src/api-services/system/models/delete-code-gen-input.ts +++ b/Web/src/api-services/system/models/default-column-config-input.ts @@ -13,18 +13,26 @@ */ /** - * + * 获取默认列配置输入参数 * * @export - * @interface DeleteCodeGenInput + * @interface DefaultColumnConfigInput */ -export interface DeleteCodeGenInput { +export interface DefaultColumnConfigInput { /** - * 代码生成器Id + * 数据库配置id * - * @type {number} - * @memberof DeleteCodeGenInput + * @type {string} + * @memberof DefaultColumnConfigInput */ - id: number; + configId?: string | null; + + /** + * 数据库表名 + * + * @type {string} + * @memberof DefaultColumnConfigInput + */ + tableName: string; } diff --git a/Web/src/api-services/system/models/batch-config-tenant-input.ts b/Web/src/api-services/system/models/effect-date-picker-config-input.ts similarity index 74% rename from Web/src/api-services/system/models/batch-config-tenant-input.ts rename to Web/src/api-services/system/models/effect-date-picker-config-input.ts index c9520ac7..64368015 100644 --- a/Web/src/api-services/system/models/batch-config-tenant-input.ts +++ b/Web/src/api-services/system/models/effect-date-picker-config-input.ts @@ -13,26 +13,26 @@ */ /** - * 批量配置参数输入 + * 时间控件配置信息类 * * @export - * @interface BatchConfigTenantInput + * @interface EffectDatePickerConfigInput */ -export interface BatchConfigTenantInput { +export interface EffectDatePickerConfigInput { /** - * 编码 + * 格式 * * @type {string} - * @memberof BatchConfigTenantInput + * @memberof EffectDatePickerConfigInput */ - code?: string | null; + format: string; /** - * 属性值 + * 默认值 * * @type {string} - * @memberof BatchConfigTenantInput + * @memberof EffectDatePickerConfigInput */ - value?: string | null; + _default?: string | null; } diff --git a/Web/src/api-services/system/models/table-unique-config-item.ts b/Web/src/api-services/system/models/effect-dict-config-input.ts similarity index 72% rename from Web/src/api-services/system/models/table-unique-config-item.ts rename to Web/src/api-services/system/models/effect-dict-config-input.ts index 77ccd469..3700838d 100644 --- a/Web/src/api-services/system/models/table-unique-config-item.ts +++ b/Web/src/api-services/system/models/effect-dict-config-input.ts @@ -13,26 +13,26 @@ */ /** - * 表唯一配置项 + * 字典控件配置信息类 * * @export - * @interface TableUniqueConfigItem + * @interface EffectDictConfigInput */ -export interface TableUniqueConfigItem { +export interface EffectDictConfigInput { /** - * 字段列表 - * - * @type {Array} - * @memberof TableUniqueConfigItem - */ - columns?: Array | null; - - /** - * 描述信息 + * 字典编码 * * @type {string} - * @memberof TableUniqueConfigItem + * @memberof EffectDictConfigInput */ - message?: string | null; + code: string; + + /** + * 是否多选 + * + * @type {boolean} + * @memberof EffectDictConfigInput + */ + multiple?: boolean; } diff --git a/Web/src/api-services/system/models/sys-code-gen-template-relation.ts b/Web/src/api-services/system/models/effect-file-config-input.ts similarity index 64% rename from Web/src/api-services/system/models/sys-code-gen-template-relation.ts rename to Web/src/api-services/system/models/effect-file-config-input.ts index 7c58f915..351bb979 100644 --- a/Web/src/api-services/system/models/sys-code-gen-template-relation.ts +++ b/Web/src/api-services/system/models/effect-file-config-input.ts @@ -13,34 +13,34 @@ */ /** - * 代码生成模板关系表 + * 文件控件配置信息类 * * @export - * @interface SysCodeGenTemplateRelation + * @interface EffectFileConfigInput */ -export interface SysCodeGenTemplateRelation { +export interface EffectFileConfigInput { /** - * 雪花Id + * 链接预览 * - * @type {number} - * @memberof SysCodeGenTemplateRelation + * @type {boolean} + * @memberof EffectFileConfigInput */ - id?: number; + useDownload?: boolean; /** - * 代码生成Id + * 链接文本 * - * @type {number} - * @memberof SysCodeGenTemplateRelation + * @type {string} + * @memberof EffectFileConfigInput */ - codeGenId: number; + downloadText?: string | null; /** - * 模板Id + * 是否图片 * - * @type {number} - * @memberof SysCodeGenTemplateRelation + * @type {boolean} + * @memberof EffectFileConfigInput */ - templateId: number; + isImage?: boolean; } diff --git a/Web/src/api-services/system/models/effect-tree-config-input.ts b/Web/src/api-services/system/models/effect-tree-config-input.ts new file mode 100644 index 00000000..eba055df --- /dev/null +++ b/Web/src/api-services/system/models/effect-tree-config-input.ts @@ -0,0 +1,134 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * 树控件配置信息类 + * + * @export + * @interface EffectTreeConfigInput + */ +export interface EffectTreeConfigInput { + + /** + * 外键库标识 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + configId: string; + + /** + * 外键实体名称 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + entityName: string; + + /** + * 外键表名称 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + tableName: string; + + /** + * 表注释 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + tableComment: string; + + /** + * 外键显示属性名(多选) + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + displayPropertyNames: string; + + /** + * 外键属性名 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + linkPropertyName: string; + + /** + * 外键显示属性.NET类型 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + linkPropertyType: string; + + /** + * 用于检索的属性名 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + searchPropertyName?: string | null; + + /** + * 用于检索的属性.NET类型 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + searchPropertyType?: string | null; + + /** + * 是否使用表格 + * + * @type {boolean} + * @memberof EffectTreeConfigInput + */ + useTable?: boolean; + + /** + * 是否多选 + * + * @type {boolean} + * @memberof EffectTreeConfigInput + */ + multiple?: boolean; + + /** + * 树组件标题不能为空 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + treeTitle?: string | null; + + /** + * 父属性名称 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + parentPropertyName?: string | null; + + /** + * 父属性.NET类型 + * + * @type {string} + * @memberof EffectTreeConfigInput + */ + parentPropertyType?: string | null; +} diff --git a/Web/src/api-services/system/models/index.ts b/Web/src/api-services/system/models/index.ts index 273d7aef..3041111f 100644 --- a/Web/src/api-services/system/models/index.ts +++ b/Web/src/api-services/system/models/index.ts @@ -1,7 +1,6 @@ export * from './account-type-enum'; export * from './add-code-gen-input'; export * from './add-config-input'; -export * from './add-config-tenant-input'; export * from './add-dict-data-input'; export * from './add-dict-type-input'; export * from './add-job-detail-input'; @@ -21,6 +20,8 @@ export * from './add-role-input'; export * from './add-schedule-input'; export * from './add-serial-input'; export * from './add-subscribe-message-template-input'; +export * from './add-sys-code-gen-column'; +export * from './add-sys-code-gen-table'; export * from './add-sys-ldap-input'; export * from './add-tenant-input'; export * from './add-user-input'; @@ -47,8 +48,8 @@ export * from './admin-netresult-int32'; export * from './admin-netresult-int64'; export * from './admin-netresult-jobject'; export * from './admin-netresult-list-api-output'; -export * from './admin-netresult-list-code-gen-config'; -export * from './admin-netresult-list-column-ouput'; +export * from './admin-netresult-list-code-gen-column-config'; +export * from './admin-netresult-list-column-output'; export * from './admin-netresult-list-const-output'; export * from './admin-netresult-list-data-init-item-output'; export * from './admin-netresult-list-database-output'; @@ -72,9 +73,8 @@ export * from './admin-netresult-list-role-table-output'; export * from './admin-netresult-list-select-list-item'; export * from './admin-netresult-list-stat-log-output'; export * from './admin-netresult-list-string'; -export * from './admin-netresult-list-sys-code-gen-template'; +export * from './admin-netresult-list-sys-code-gen-column'; export * from './admin-netresult-list-sys-config'; -export * from './admin-netresult-list-sys-config-tenant'; export * from './admin-netresult-list-sys-dict-data'; export * from './admin-netresult-list-sys-dict-type'; export * from './admin-netresult-list-sys-file'; @@ -112,7 +112,6 @@ export * from './admin-netresult-sql-sugar-paged-list-page-serial-output'; export * from './admin-netresult-sql-sugar-paged-list-report-config-output'; export * from './admin-netresult-sql-sugar-paged-list-sys-code-gen'; export * from './admin-netresult-sql-sugar-paged-list-sys-config'; -export * from './admin-netresult-sql-sugar-paged-list-sys-config-tenant'; export * from './admin-netresult-sql-sugar-paged-list-sys-dict-data'; export * from './admin-netresult-sql-sugar-paged-list-sys-dict-type'; export * from './admin-netresult-sql-sugar-paged-list-sys-file'; @@ -136,9 +135,9 @@ export * from './admin-netresult-sql-sugar-paged-list-user-output'; export * from './admin-netresult-stress-test-harness-result'; export * from './admin-netresult-string'; export * from './admin-netresult-sys-code-gen'; -export * from './admin-netresult-sys-code-gen-config'; +export * from './admin-netresult-sys-code-gen-column'; +export * from './admin-netresult-sys-code-gen-table'; export * from './admin-netresult-sys-config'; -export * from './admin-netresult-sys-config-tenant'; export * from './admin-netresult-sys-dict-data'; export * from './admin-netresult-sys-dict-type'; export * from './admin-netresult-sys-file'; @@ -173,7 +172,6 @@ export * from './base-id-input'; export * from './base-proc-input'; export * from './base-status-input'; export * from './batch-config-input'; -export * from './batch-config-tenant-input'; export * from './board-info'; export * from './calendar'; export * from './calendar-algorithm-type'; @@ -187,10 +185,14 @@ export * from './chat-list-input'; export * from './chat-list-output'; export * from './chat-output'; export * from './cluster-status'; -export * from './code-gen-config'; -export * from './code-gen-type-enum'; +export * from './code-gen-column-config'; +export * from './code-gen-effect-type-enum'; +export * from './code-gen-from-rule-valid-enum'; +export * from './code-gen-method-enum'; +export * from './code-gen-print-type-enum'; +export * from './code-gen-scene-enum'; export * from './column-custom-output'; -export * from './column-ouput'; +export * from './column-output'; export * from './column-relation'; export * from './compare-info'; export * from './const-output'; @@ -225,9 +227,8 @@ export * from './db-output'; export * from './db-table-info'; export * from './db-table-input'; export * from './db-type'; -export * from './delete-code-gen-input'; +export * from './default-column-config-input'; export * from './delete-config-input'; -export * from './delete-config-tenant-input'; export * from './delete-db-column-input'; export * from './delete-db-table-input'; export * from './delete-dict-data-input'; @@ -253,6 +254,10 @@ export * from './dict-data-input'; export * from './dict-type-input'; export * from './digit-shapes'; export * from './disk-info'; +export * from './effect-date-picker-config-input'; +export * from './effect-dict-config-input'; +export * from './effect-file-config-input'; +export * from './effect-tree-config-input'; export * from './end-point'; export * from './entity-column-info'; export * from './entity-info'; @@ -361,7 +366,6 @@ export * from './open-access-output'; export * from './order-by-type'; export * from './page-code-gen-input'; export * from './page-config-input'; -export * from './page-config-tenant-input'; export * from './page-dict-data-input'; export * from './page-dict-type-input'; export * from './page-ex-log-input'; @@ -452,7 +456,6 @@ export * from './sql-sugar-paged-list-page-serial-output'; export * from './sql-sugar-paged-list-report-config-output'; export * from './sql-sugar-paged-list-sys-code-gen'; export * from './sql-sugar-paged-list-sys-config'; -export * from './sql-sugar-paged-list-sys-config-tenant'; export * from './sql-sugar-paged-list-sys-dict-data'; export * from './sql-sugar-paged-list-sys-dict-type'; export * from './sql-sugar-paged-list-sys-file'; @@ -483,11 +486,9 @@ export * from './sugar-index-attribute'; export * from './swagger-submit-url-body'; export * from './sync-sys-ldap-input'; export * from './sys-code-gen'; -export * from './sys-code-gen-config'; -export * from './sys-code-gen-template'; -export * from './sys-code-gen-template-relation'; +export * from './sys-code-gen-column'; +export * from './sys-code-gen-table'; export * from './sys-config'; -export * from './sys-config-tenant'; export * from './sys-dict-data'; export * from './sys-dict-type'; export * from './sys-file'; @@ -535,7 +536,6 @@ export * from './system-hardware-info'; export * from './system-runtime-info'; export * from './table-column-output'; export * from './table-output'; -export * from './table-unique-config-item'; export * from './tenant-id-input'; export * from './tenant-input'; export * from './tenant-output'; @@ -544,13 +544,13 @@ export * from './tenant-user-input'; export * from './text-info'; export * from './tianditu-input'; export * from './tree-node'; +export * from './tree-with-table-config-input'; export * from './trigger-status'; export * from './type'; export * from './type-attributes'; export * from './type-info'; export * from './update-code-gen-input'; export * from './update-config-input'; -export * from './update-config-tenant-input'; export * from './update-db-column-input'; export * from './update-db-table-input'; export * from './update-dict-data-input'; @@ -580,7 +580,6 @@ export * from './upload-logo-tenant-id-body'; export * from './user-menu-input'; export * from './user-output'; export * from './user-role-input'; -export * from './verify-rule-item'; export * from './visual-column'; export * from './visual-db-table'; export * from './visual-table'; diff --git a/Web/src/api-services/system/models/page-code-gen-input.ts b/Web/src/api-services/system/models/page-code-gen-input.ts index 146ec9bb..b47083c6 100644 --- a/Web/src/api-services/system/models/page-code-gen-input.ts +++ b/Web/src/api-services/system/models/page-code-gen-input.ts @@ -83,103 +83,7 @@ export interface PageCodeGenInput { descStr?: string | null; /** - * 作者姓名 - * - * @type {string} - * @memberof PageCodeGenInput - */ - authorName?: string | null; - - /** - * 类名 - * - * @type {string} - * @memberof PageCodeGenInput - */ - className?: string | null; - - /** - * 是否移除表前缀 - * - * @type {string} - * @memberof PageCodeGenInput - */ - tablePrefix?: string | null; - - /** - * 库定位器名 - * - * @type {string} - * @memberof PageCodeGenInput - */ - configId?: string | null; - - /** - * 数据库名(保留字段) - * - * @type {string} - * @memberof PageCodeGenInput - */ - dbName?: string | null; - - /** - * 数据库类型 - * - * @type {string} - * @memberof PageCodeGenInput - */ - dbType?: string | null; - - /** - * 数据库链接 - * - * @type {string} - * @memberof PageCodeGenInput - */ - connectionString?: string | null; - - /** - * 生成方式 - * - * @type {string} - * @memberof PageCodeGenInput - */ - generateType?: string | null; - - /** - * 数据库表名 - * - * @type {string} - * @memberof PageCodeGenInput - */ - tableName?: string | null; - - /** - * 树控件名称 - * - * @type {string} - * @memberof PageCodeGenInput - */ - treeName?: string | null; - - /** - * 树控件key - * - * @type {string} - * @memberof PageCodeGenInput - */ - treeKey?: string | null; - - /** - * 命名空间 - * - * @type {string} - * @memberof PageCodeGenInput - */ - nameSpace?: string | null; - - /** - * 业务名(业务代码包名称) + * 业务名 * * @type {string} * @memberof PageCodeGenInput @@ -187,74 +91,10 @@ export interface PageCodeGenInput { busName?: string | null; /** - * 功能名(数据库表名称) + * 表名 * * @type {string} * @memberof PageCodeGenInput */ - tableComment?: string | null; - - /** - * 菜单应用分类(应用编码) - * - * @type {string} - * @memberof PageCodeGenInput - */ - menuApplication?: string | null; - - /** - * 是否生成菜单 - * - * @type {boolean} - * @memberof PageCodeGenInput - */ - generateMenu?: boolean; - - /** - * 菜单父级 - * - * @type {number} - * @memberof PageCodeGenInput - */ - menuPid?: number | null; - - /** - * 菜单图标 - * - * @type {string} - * @memberof PageCodeGenInput - */ - menuIcon?: string | null; - - /** - * 页面目录 - * - * @type {string} - * @memberof PageCodeGenInput - */ - pagePath?: string | null; - - /** - * 支持打印类型 - * - * @type {string} - * @memberof PageCodeGenInput - */ - printType?: string | null; - - /** - * 打印模版名称 - * - * @type {string} - * @memberof PageCodeGenInput - */ - printName?: string | null; - - /** - * 是否使用 Api Service - * - * @type {boolean} - * @memberof PageCodeGenInput - */ - isApiService?: boolean; + tableName?: string | null; } diff --git a/Web/src/api-services/system/models/page-config-tenant-input.ts b/Web/src/api-services/system/models/page-config-tenant-input.ts deleted file mode 100644 index 28da10f7..00000000 --- a/Web/src/api-services/system/models/page-config-tenant-input.ts +++ /dev/null @@ -1,108 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { Filter } from './filter'; -import { Search } from './search'; - /** - * - * - * @export - * @interface PageConfigTenantInput - */ -export interface PageConfigTenantInput { - - /** - * @type {Search} - * @memberof PageConfigTenantInput - */ - search?: Search; - - /** - * 模糊查询关键字 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - keyword?: string | null; - - /** - * @type {Filter} - * @memberof PageConfigTenantInput - */ - filter?: Filter; - - /** - * 当前页码 - * - * @type {number} - * @memberof PageConfigTenantInput - */ - page?: number; - - /** - * 页码容量 - * - * @type {number} - * @memberof PageConfigTenantInput - */ - pageSize?: number; - - /** - * 排序字段 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - field?: string | null; - - /** - * 排序方向 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - order?: string | null; - - /** - * 降序排序 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - descStr?: string | null; - - /** - * 名称 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - name?: string | null; - - /** - * 编码 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - code?: string | null; - - /** - * 分组编码 - * - * @type {string} - * @memberof PageConfigTenantInput - */ - groupCode?: string | null; -} diff --git a/Web/src/api-services/system/models/sql-sugar-paged-list-sys-config-tenant.ts b/Web/src/api-services/system/models/sql-sugar-paged-list-sys-config-tenant.ts deleted file mode 100644 index 69fc2d26..00000000 --- a/Web/src/api-services/system/models/sql-sugar-paged-list-sys-config-tenant.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { SysConfigTenant } from './sys-config-tenant'; - /** - * 分页泛型集合 - * - * @export - * @interface SqlSugarPagedListSysConfigTenant - */ -export interface SqlSugarPagedListSysConfigTenant { - - /** - * 页码 - * - * @type {number} - * @memberof SqlSugarPagedListSysConfigTenant - */ - page?: number; - - /** - * 页容量 - * - * @type {number} - * @memberof SqlSugarPagedListSysConfigTenant - */ - pageSize?: number; - - /** - * 总条数 - * - * @type {number} - * @memberof SqlSugarPagedListSysConfigTenant - */ - total?: number; - - /** - * 总页数 - * - * @type {number} - * @memberof SqlSugarPagedListSysConfigTenant - */ - totalPages?: number; - - /** - * 当前页集合 - * - * @type {Array} - * @memberof SqlSugarPagedListSysConfigTenant - */ - items?: Array | null; - - /** - * 是否有上一页 - * - * @type {boolean} - * @memberof SqlSugarPagedListSysConfigTenant - */ - hasPrevPage?: boolean; - - /** - * 是否有下一页 - * - * @type {boolean} - * @memberof SqlSugarPagedListSysConfigTenant - */ - hasNextPage?: boolean; - - /** - * 统计数据 - * - * @type {any} - * @memberof SqlSugarPagedListSysConfigTenant - */ - totalInfo?: any | null; -} diff --git a/Web/src/api-services/system/models/sys-code-gen-column.ts b/Web/src/api-services/system/models/sys-code-gen-column.ts new file mode 100644 index 00000000..6dd53b0f --- /dev/null +++ b/Web/src/api-services/system/models/sys-code-gen-column.ts @@ -0,0 +1,268 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +import { CodeGenEffectTypeEnum } from './code-gen-effect-type-enum'; +import { CodeGenFromRuleValidEnum } from './code-gen-from-rule-valid-enum'; + /** + * 代码生成表字段配置表 + * + * @export + * @interface SysCodeGenColumn + */ +export interface SysCodeGenColumn { + + /** + * 雪花Id + * + * @type {number} + * @memberof SysCodeGenColumn + */ + id?: number; + + /** + * 创建时间 + * + * @type {Date} + * @memberof SysCodeGenColumn + */ + createTime?: Date; + + /** + * 更新时间 + * + * @type {Date} + * @memberof SysCodeGenColumn + */ + updateTime?: Date | null; + + /** + * 创建者Id + * + * @type {number} + * @memberof SysCodeGenColumn + */ + createUserId?: number | null; + + /** + * 创建者姓名 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + createUserName?: string | null; + + /** + * 修改者Id + * + * @type {number} + * @memberof SysCodeGenColumn + */ + updateUserId?: number | null; + + /** + * 修改者姓名 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + updateUserName?: string | null; + + /** + * 软删除 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isDelete?: boolean; + + /** + * 代码生成表Id + * + * @type {number} + * @memberof SysCodeGenColumn + */ + codeGenTableId?: number; + + /** + * 数据库字段名 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + columnName: string; + + /** + * 实体属性名 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + propertyName: string; + + /** + * .NET数据类型 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + netType?: string | null; + + /** + * 数据库中类型(物理类型) + * + * @type {string} + * @memberof SysCodeGenColumn + */ + dataType?: string | null; + + /** + * 字段数据长度 + * + * @type {number} + * @memberof SysCodeGenColumn + */ + columnLength?: number | null; + + /** + * 字段描述 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + columnComment?: string | null; + + /** + * @type {CodeGenEffectTypeEnum} + * @memberof SysCodeGenColumn + */ + effectType?: CodeGenEffectTypeEnum; + + /** + * 控件配置 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + config?: string | null; + + /** + * 主键 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isPrimarykey?: boolean; + + /** + * 是否通用字段 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isCommon?: boolean; + + /** + * 是否必填 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isRequired?: boolean; + + /** + * 增改 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isAddUpdate?: boolean; + + /** + * 导入导出 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isImport?: boolean; + + /** + * 是否可排序 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isSortable?: boolean; + + /** + * 是否是统计字段 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isStatistical?: boolean; + + /** + * 是否是查询条件 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isQuery?: boolean; + + /** + * 查询方式 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + queryType?: string | null; + + /** + * 列表显示 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isTable?: boolean; + + /** + * 内容复制 + * + * @type {boolean} + * @memberof SysCodeGenColumn + */ + isCopy?: boolean; + + /** + * 默认值 + * + * @type {string} + * @memberof SysCodeGenColumn + */ + defaultValue?: string | null; + + /** + * @type {CodeGenFromRuleValidEnum} + * @memberof SysCodeGenColumn + */ + fromValid?: CodeGenFromRuleValidEnum; + + /** + * 排序 + * + * @type {number} + * @memberof SysCodeGenColumn + */ + orderNo?: number; +} diff --git a/Web/src/api-services/system/models/sys-code-gen-config.ts b/Web/src/api-services/system/models/sys-code-gen-config.ts deleted file mode 100644 index 25ebbd88..00000000 --- a/Web/src/api-services/system/models/sys-code-gen-config.ts +++ /dev/null @@ -1,342 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - /** - * 代码生成字段配置表 - * - * @export - * @interface SysCodeGenConfig - */ -export interface SysCodeGenConfig { - - /** - * 雪花Id - * - * @type {number} - * @memberof SysCodeGenConfig - */ - id?: number; - - /** - * 创建时间 - * - * @type {Date} - * @memberof SysCodeGenConfig - */ - createTime?: Date; - - /** - * 更新时间 - * - * @type {Date} - * @memberof SysCodeGenConfig - */ - updateTime?: Date | null; - - /** - * 创建者Id - * - * @type {number} - * @memberof SysCodeGenConfig - */ - createUserId?: number | null; - - /** - * 创建者姓名 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - createUserName?: string | null; - - /** - * 修改者Id - * - * @type {number} - * @memberof SysCodeGenConfig - */ - updateUserId?: number | null; - - /** - * 修改者姓名 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - updateUserName?: string | null; - - /** - * 软删除 - * - * @type {boolean} - * @memberof SysCodeGenConfig - */ - isDelete?: boolean; - - /** - * 代码生成主表Id - * - * @type {number} - * @memberof SysCodeGenConfig - */ - codeGenId?: number; - - /** - * 数据库字段名 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - columnName: string; - - /** - * 实体属性名 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - propertyName: string; - - /** - * 字段数据长度 - * - * @type {number} - * @memberof SysCodeGenConfig - */ - columnLength?: number; - - /** - * 字段描述 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - columnComment?: string | null; - - /** - * .NET数据类型 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - netType?: string | null; - - /** - * 作用类型(字典) - * - * @type {string} - * @memberof SysCodeGenConfig - */ - effectType?: string | null; - - /** - * 外键库标识 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - fkConfigId?: string | null; - - /** - * 外键实体名称 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - fkEntityName?: string | null; - - /** - * 外键表名称 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - fkTableName?: string | null; - - /** - * 外键显示字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - fkColumnName?: string | null; - - /** - * 外键链接字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - fkLinkColumnName?: string | null; - - /** - * 外键显示字段.NET类型 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - fkColumnNetType?: string | null; - - /** - * 字典编码 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - dictTypeCode?: string | null; - - /** - * 是否缩进列表(字典) - * - * @type {string} - * @memberof SysCodeGenConfig - */ - whetherRetract?: string | null; - - /** - * 是否必填(字典) - * - * @type {string} - * @memberof SysCodeGenConfig - */ - whetherRequired?: string | null; - - /** - * 是否可排序(字典) - * - * @type {string} - * @memberof SysCodeGenConfig - */ - whetherSortable?: string | null; - - /** - * 是否是统计字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - statistical?: string | null; - - /** - * 是否是分组字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - isGroupBy?: string | null; - - /** - * 是否是查询条件 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - queryWhether?: string | null; - - /** - * 查询方式 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - queryType?: string | null; - - /** - * 列表显示 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - whetherTable?: string | null; - - /** - * 增改 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - whetherAddUpdate?: string | null; - - /** - * 主键 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - columnKey?: string | null; - - /** - * 数据库中类型(物理类型) - * - * @type {string} - * @memberof SysCodeGenConfig - */ - dataType?: string | null; - - /** - * 是否通用字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - whetherCommon?: string | null; - - /** - * 显示文本字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - displayColumn?: string | null; - - /** - * 选中值字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - valueColumn?: string | null; - - /** - * 父级字段 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - pidColumn?: string | null; - - /** - * 排序 - * - * @type {number} - * @memberof SysCodeGenConfig - */ - orderNo?: number; - - /** - * 字段验证规则 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - rules?: string | null; - - /** - * 默认值 - * - * @type {string} - * @memberof SysCodeGenConfig - */ - defaultValue?: string | null; -} diff --git a/Web/src/api-services/system/models/sys-config-tenant.ts b/Web/src/api-services/system/models/sys-code-gen-table.ts similarity index 57% rename from Web/src/api-services/system/models/sys-config-tenant.ts rename to Web/src/api-services/system/models/sys-code-gen-table.ts index c1a773c0..cb8e0dee 100644 --- a/Web/src/api-services/system/models/sys-config-tenant.ts +++ b/Web/src/api-services/system/models/sys-code-gen-table.ts @@ -12,20 +12,20 @@ * Do not edit the class manually. */ -import { YesNoEnum } from './yes-no-enum'; +import { SysCodeGenColumn } from './sys-code-gen-column'; /** - * 系统租户配置参数表 + * 代码生成关联表 * * @export - * @interface SysConfigTenant + * @interface SysCodeGenTable */ -export interface SysConfigTenant { +export interface SysCodeGenTable { /** * 雪花Id * * @type {number} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ id?: number; @@ -33,7 +33,7 @@ export interface SysConfigTenant { * 创建时间 * * @type {Date} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ createTime?: Date; @@ -41,7 +41,7 @@ export interface SysConfigTenant { * 更新时间 * * @type {Date} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ updateTime?: Date | null; @@ -49,7 +49,7 @@ export interface SysConfigTenant { * 创建者Id * * @type {number} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ createUserId?: number | null; @@ -57,7 +57,7 @@ export interface SysConfigTenant { * 创建者姓名 * * @type {string} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ createUserName?: string | null; @@ -65,7 +65,7 @@ export interface SysConfigTenant { * 修改者Id * * @type {number} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ updateUserId?: number | null; @@ -73,7 +73,7 @@ export interface SysConfigTenant { * 修改者姓名 * * @type {string} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ updateUserName?: string | null; @@ -81,69 +81,79 @@ export interface SysConfigTenant { * 软删除 * * @type {boolean} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ isDelete?: boolean; /** - * 名称 - * - * @type {string} - * @memberof SysConfigTenant - */ - name: string; - - /** - * 编码 - * - * @type {string} - * @memberof SysConfigTenant - */ - code?: string | null; - - /** - * 参数值 - * - * @type {string} - * @memberof SysConfigTenant - */ - value?: string | null; - - /** - * @type {YesNoEnum} - * @memberof SysConfigTenant - */ - sysFlag?: YesNoEnum; - - /** - * 分组编码 - * - * @type {string} - * @memberof SysConfigTenant - */ - groupCode?: string | null; - - /** - * 排序 + * 代码生成Id * * @type {number} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ - orderNo?: number; + codeGenId: number; /** - * 备注 + * 数据库配置id * * @type {string} - * @memberof SysConfigTenant + * @memberof SysCodeGenTable */ - remark?: string | null; + configId?: string | null; /** - * 租户Id + * 数据库表名 * - * @type {number} - * @memberof SysConfigTenant + * @type {string} + * @memberof SysCodeGenTable */ - tenantId?: number | null; + tableName?: string | null; + + /** + * 表实体名称 + * + * @type {string} + * @memberof SysCodeGenTable + */ + entityName?: string | null; + + /** + * 模块名称 + * + * @type {string} + * @memberof SysCodeGenTable + */ + moduleName?: string | null; + + /** + * 业务名 + * + * @type {string} + * @memberof SysCodeGenTable + */ + busName?: string | null; + + /** + * 上级联表字段 + * + * @type {string} + * @memberof SysCodeGenTable + */ + lastLinkPropertyName?: string | null; + + /** + * 下级联表字段 + * + * @type {string} + * @memberof SysCodeGenTable + */ + nextLinkPropertyName?: string | null; + + /** + * 关联字段 + * + * @type {Array} + * @memberof SysCodeGenTable + */ + columnList?: Array | null; } diff --git a/Web/src/api-services/system/models/sys-code-gen-template.ts b/Web/src/api-services/system/models/sys-code-gen-template.ts deleted file mode 100644 index 67079890..00000000 --- a/Web/src/api-services/system/models/sys-code-gen-template.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -import { CodeGenTypeEnum } from './code-gen-type-enum'; -import { YesNoEnum } from './yes-no-enum'; - /** - * 代码生成模板配置表 - * - * @export - * @interface SysCodeGenTemplate - */ -export interface SysCodeGenTemplate { - - /** - * 雪花Id - * - * @type {number} - * @memberof SysCodeGenTemplate - */ - id?: number; - - /** - * 创建时间 - * - * @type {Date} - * @memberof SysCodeGenTemplate - */ - createTime?: Date; - - /** - * 更新时间 - * - * @type {Date} - * @memberof SysCodeGenTemplate - */ - updateTime?: Date | null; - - /** - * 创建者Id - * - * @type {number} - * @memberof SysCodeGenTemplate - */ - createUserId?: number | null; - - /** - * 创建者姓名 - * - * @type {string} - * @memberof SysCodeGenTemplate - */ - createUserName?: string | null; - - /** - * 修改者Id - * - * @type {number} - * @memberof SysCodeGenTemplate - */ - updateUserId?: number | null; - - /** - * 修改者姓名 - * - * @type {string} - * @memberof SysCodeGenTemplate - */ - updateUserName?: string | null; - - /** - * 软删除 - * - * @type {boolean} - * @memberof SysCodeGenTemplate - */ - isDelete?: boolean; - - /** - * 模板文件名 - * - * @type {string} - * @memberof SysCodeGenTemplate - */ - name: string; - - /** - * @type {CodeGenTypeEnum} - * @memberof SysCodeGenTemplate - */ - type?: CodeGenTypeEnum; - - /** - * @type {YesNoEnum} - * @memberof SysCodeGenTemplate - */ - sysFlag?: YesNoEnum; - - /** - * 是否默认 - * - * @type {boolean} - * @memberof SysCodeGenTemplate - */ - isDefault?: boolean | null; - - /** - * 输出位置 - * - * @type {string} - * @memberof SysCodeGenTemplate - */ - outputFile: string; - - /** - * 描述 - * - * @type {string} - * @memberof SysCodeGenTemplate - */ - describe: string; - - /** - * 排序 - * - * @type {number} - * @memberof SysCodeGenTemplate - */ - orderNo?: number; -} diff --git a/Web/src/api-services/system/models/sys-code-gen.ts b/Web/src/api-services/system/models/sys-code-gen.ts index 559b19fe..c8888112 100644 --- a/Web/src/api-services/system/models/sys-code-gen.ts +++ b/Web/src/api-services/system/models/sys-code-gen.ts @@ -12,9 +12,11 @@ * Do not edit the class manually. */ -import { DbType } from './db-type'; -import { SysCodeGenTemplateRelation } from './sys-code-gen-template-relation'; -import { TableUniqueConfigItem } from './table-unique-config-item'; +import { CodeGenMethodEnum } from './code-gen-method-enum'; +import { CodeGenPrintTypeEnum } from './code-gen-print-type-enum'; +import { CodeGenSceneEnum } from './code-gen-scene-enum'; +import { SysCodeGenTable } from './sys-code-gen-table'; +import { TreeWithTableConfigInput } from './tree-with-table-config-input'; /** * 代码生成表 * @@ -96,66 +98,30 @@ export interface SysCodeGen { authorName?: string | null; /** - * 是否移除表前缀 + * 作者邮箱 * * @type {string} * @memberof SysCodeGen */ - tablePrefix?: string | null; + email?: string | null; /** - * 生成方式 - * - * @type {string} + * @type {CodeGenMethodEnum} * @memberof SysCodeGen */ - generateType?: string | null; + generateMethod?: CodeGenMethodEnum; /** - * 库定位器名 - * - * @type {string} + * @type {CodeGenSceneEnum} * @memberof SysCodeGen */ - configId?: string | null; + scene?: CodeGenSceneEnum; /** - * 数据库名(保留字段) - * - * @type {string} + * @type {TreeWithTableConfigInput} * @memberof SysCodeGen */ - dbName?: string | null; - - /** - * @type {DbType} - * @memberof SysCodeGen - */ - dbType?: DbType; - - /** - * 数据库链接 - * - * @type {string} - * @memberof SysCodeGen - */ - connectionString?: string | null; - - /** - * 数据库表名 - * - * @type {string} - * @memberof SysCodeGen - */ - tableName?: string | null; - - /** - * 树控件名称 - * - * @type {string} - * @memberof SysCodeGen - */ - treeName?: string | null; + treeConfig?: TreeWithTableConfigInput; /** * 命名空间 @@ -174,12 +140,20 @@ export interface SysCodeGen { busName?: string | null; /** - * 表唯一字段配置 + * 模块名称 * * @type {string} * @memberof SysCodeGen */ - tableUniqueConfig?: string | null; + moduleName?: string | null; + + /** + * 是否水平布局 + * + * @type {boolean} + * @memberof SysCodeGen + */ + isHorizontal?: boolean; /** * 是否生成菜单 @@ -203,7 +177,7 @@ export interface SysCodeGen { * @type {number} * @memberof SysCodeGen */ - menuPid?: number | null; + menuPid?: number; /** * 页面目录 @@ -214,12 +188,10 @@ export interface SysCodeGen { pagePath?: string | null; /** - * 支持打印类型 - * - * @type {string} + * @type {CodeGenPrintTypeEnum} * @memberof SysCodeGen */ - printType?: string | null; + printType?: CodeGenPrintTypeEnum; /** * 打印模版名称 @@ -229,86 +201,6 @@ export interface SysCodeGen { */ printName?: string | null; - /** - * 左边树形结构表 - * - * @type {string} - * @memberof SysCodeGen - */ - leftTab?: string | null; - - /** - * 左边关联字段 - * - * @type {string} - * @memberof SysCodeGen - */ - leftKey?: string | null; - - /** - * 左边关联主表字段 - * - * @type {string} - * @memberof SysCodeGen - */ - leftPrimaryKey?: string | null; - - /** - * 左边树名称 - * - * @type {string} - * @memberof SysCodeGen - */ - leftName?: string | null; - - /** - * 下表名称 - * - * @type {string} - * @memberof SysCodeGen - */ - bottomTab?: string | null; - - /** - * 下表关联字段 - * - * @type {string} - * @memberof SysCodeGen - */ - bottomKey?: string | null; - - /** - * 下表关联主表字段 - * - * @type {string} - * @memberof SysCodeGen - */ - bottomPrimaryKey?: string | null; - - /** - * 模板文件夹 - * - * @type {string} - * @memberof SysCodeGen - */ - template?: string | null; - - /** - * 表类型 - * - * @type {string} - * @memberof SysCodeGen - */ - tabType?: string | null; - - /** - * 树控件PidKey字段 - * - * @type {string} - * @memberof SysCodeGen - */ - treeKey?: string | null; - /** * 是否使用 Api Service * @@ -318,18 +210,18 @@ export interface SysCodeGen { isApiService?: boolean; /** - * 模板关系:SysCodeGenTemplateRelation表中的CodeGenId,注意禁止给CodeGenTemplateRelations手动赋值 + * 关联表 * - * @type {Array} + * @type {Array} * @memberof SysCodeGen */ - codeGenTemplateRelations?: Array | null; + tableList?: Array | null; /** - * 表唯一字段列表 + * 简拼 * - * @type {Array} + * @type {string} * @memberof SysCodeGen */ - tableUniqueList?: Array | null; + pinyin?: string | null; } diff --git a/Web/src/api-services/system/models/sys-dict-type.ts b/Web/src/api-services/system/models/sys-dict-type.ts index 39bd002c..2409df37 100644 --- a/Web/src/api-services/system/models/sys-dict-type.ts +++ b/Web/src/api-services/system/models/sys-dict-type.ts @@ -131,12 +131,6 @@ export interface SysDictType { */ sysFlag?: YesNoEnum; - /** - * @type {YesNoEnum} - * @memberof SysDictType - */ - isTenant?: YesNoEnum; - /** * @type {YesNoEnum} * @memberof SysDictType diff --git a/Web/src/api-services/system/models/sys-file.ts b/Web/src/api-services/system/models/sys-file.ts index 3648ce18..344bfdc3 100644 --- a/Web/src/api-services/system/models/sys-file.ts +++ b/Web/src/api-services/system/models/sys-file.ts @@ -85,7 +85,7 @@ export interface SysFile { isDelete?: boolean; /** - * 创建者部门Id + * 创建者机构Id * * @type {number} * @memberof SysFile @@ -93,7 +93,7 @@ export interface SysFile { createOrgId?: number | null; /** - * 创建者部门名称 + * 创建者机构名称 * * @type {string} * @memberof SysFile diff --git a/Web/src/api-services/system/models/sys-wechat-refund.ts b/Web/src/api-services/system/models/sys-wechat-refund.ts index f6e8563a..ec62679b 100644 --- a/Web/src/api-services/system/models/sys-wechat-refund.ts +++ b/Web/src/api-services/system/models/sys-wechat-refund.ts @@ -13,7 +13,7 @@ */ /** - * 微信退款表 + * 系统微信退款表 * * @export * @interface SysWechatRefund diff --git a/Web/src/api-services/system/models/table-output.ts b/Web/src/api-services/system/models/table-output.ts index 299ebc71..d9cc8946 100644 --- a/Web/src/api-services/system/models/table-output.ts +++ b/Web/src/api-services/system/models/table-output.ts @@ -69,7 +69,7 @@ export interface TableOutput { tableComment?: string | null; /** - * 表字段个数 + * 字段个数 * * @type {number} * @memberof TableOutput @@ -77,7 +77,7 @@ export interface TableOutput { columnCount?: number; /** - * 程序集名称 + * 所属程序集名称 * * @type {string} * @memberof TableOutput diff --git a/Web/src/api-services/system/models/tree-with-table-config-input.ts b/Web/src/api-services/system/models/tree-with-table-config-input.ts new file mode 100644 index 00000000..0b4d161e --- /dev/null +++ b/Web/src/api-services/system/models/tree-with-table-config-input.ts @@ -0,0 +1,134 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Admin.NET 通用权限开发平台 + * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! + * + * OpenAPI spec version: 1.0.0 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + /** + * 单表带树组件模板配置输入参数 + * + * @export + * @interface TreeWithTableConfigInput + */ +export interface TreeWithTableConfigInput { + + /** + * 外键库标识 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + configId: string; + + /** + * 外键实体名称 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + entityName: string; + + /** + * 外键表名称 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + tableName: string; + + /** + * 表注释 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + tableComment: string; + + /** + * 外键显示属性名(多选) + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + displayPropertyNames: string; + + /** + * 外键属性名 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + linkPropertyName: string; + + /** + * 外键显示属性.NET类型 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + linkPropertyType: string; + + /** + * 用于检索的属性名 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + searchPropertyName?: string | null; + + /** + * 用于检索的属性.NET类型 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + searchPropertyType?: string | null; + + /** + * 是否使用表格 + * + * @type {boolean} + * @memberof TreeWithTableConfigInput + */ + useTable?: boolean; + + /** + * 是否多选 + * + * @type {boolean} + * @memberof TreeWithTableConfigInput + */ + multiple?: boolean; + + /** + * 父属性名称 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + parentPropertyName?: string | null; + + /** + * 父属性.NET类型 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + parentPropertyType?: string | null; + + /** + * 树标题 + * + * @type {string} + * @memberof TreeWithTableConfigInput + */ + treeTitle: string; +} diff --git a/Web/src/api-services/system/models/update-code-gen-input.ts b/Web/src/api-services/system/models/update-code-gen-input.ts index 06eeaa67..db2ed970 100644 --- a/Web/src/api-services/system/models/update-code-gen-input.ts +++ b/Web/src/api-services/system/models/update-code-gen-input.ts @@ -12,8 +12,11 @@ * Do not edit the class manually. */ -import { Filter } from './filter'; -import { Search } from './search'; +import { AddSysCodeGenTable } from './add-sys-code-gen-table'; +import { CodeGenMethodEnum } from './code-gen-method-enum'; +import { CodeGenPrintTypeEnum } from './code-gen-print-type-enum'; +import { CodeGenSceneEnum } from './code-gen-scene-enum'; +import { EffectTreeConfigInput } from './effect-tree-config-input'; /** * * @@ -23,152 +26,106 @@ import { Search } from './search'; export interface UpdateCodeGenInput { /** - * @type {Search} - * @memberof UpdateCodeGenInput - */ - search?: Search; - - /** - * 模糊查询关键字 + * 创建时间 * - * @type {string} + * @type {Date} * @memberof UpdateCodeGenInput */ - keyword?: string | null; + createTime?: Date; /** - * @type {Filter} + * 更新时间 + * + * @type {Date} * @memberof UpdateCodeGenInput */ - filter?: Filter; + updateTime?: Date | null; /** - * 当前页码 + * 创建者Id * * @type {number} * @memberof UpdateCodeGenInput */ - page?: number; + createUserId?: number | null; /** - * 页码容量 + * 创建者姓名 + * + * @type {string} + * @memberof UpdateCodeGenInput + */ + createUserName?: string | null; + + /** + * 修改者Id * * @type {number} * @memberof UpdateCodeGenInput */ - pageSize?: number; + updateUserId?: number | null; /** - * 排序字段 + * 修改者姓名 * * @type {string} * @memberof UpdateCodeGenInput */ - field?: string | null; + updateUserName?: string | null; /** - * 排序方向 + * 软删除 + * + * @type {boolean} + * @memberof UpdateCodeGenInput + */ + isDelete?: boolean; + + /** + * 作者姓名 * * @type {string} * @memberof UpdateCodeGenInput */ - order?: string | null; + authorName?: string | null; /** - * 降序排序 + * 作者邮箱 * * @type {string} * @memberof UpdateCodeGenInput */ - descStr?: string | null; + email?: string | null; /** - * 类名 + * @type {EffectTreeConfigInput} + * @memberof UpdateCodeGenInput + */ + treeConfig?: EffectTreeConfigInput; + + /** + * 模块名称 * * @type {string} * @memberof UpdateCodeGenInput */ - className?: string | null; + moduleName?: string | null; /** - * 是否移除表前缀 + * 是否水平布局 * - * @type {string} + * @type {boolean} * @memberof UpdateCodeGenInput */ - tablePrefix?: string | null; + isHorizontal?: boolean; /** - * 库定位器名 + * 是否生成菜单 * - * @type {string} + * @type {boolean} * @memberof UpdateCodeGenInput */ - configId?: string | null; - - /** - * 数据库名(保留字段) - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - dbName?: string | null; - - /** - * 数据库类型 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - dbType?: string | null; - - /** - * 数据库链接 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - connectionString?: string | null; - - /** - * 树控件名称 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - treeName?: string | null; - - /** - * 树控件key - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - treeKey?: string | null; - - /** - * 功能名(数据库表名称) - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - tableComment?: string | null; - - /** - * 菜单应用分类(应用编码) - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - menuApplication?: string | null; - - /** - * 菜单父级 - * - * @type {number} - * @memberof UpdateCodeGenInput - */ - menuPid?: number | null; + generateMenu?: boolean; /** * 菜单图标 @@ -179,20 +136,12 @@ export interface UpdateCodeGenInput { menuIcon?: string | null; /** - * 页面目录 + * 菜单编码 * - * @type {string} + * @type {number} * @memberof UpdateCodeGenInput */ - pagePath?: string | null; - - /** - * 支持打印类型 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - printType?: string | null; + menuPid?: number; /** * 打印模版名称 @@ -203,20 +152,40 @@ export interface UpdateCodeGenInput { printName?: string | null; /** - * 数据库表名 + * 是否使用 Api Service * - * @type {string} + * @type {boolean} * @memberof UpdateCodeGenInput */ - tableName: string; + isApiService?: boolean; /** - * 业务名(业务代码包名称) + * 关联表 + * + * @type {Array} + * @memberof UpdateCodeGenInput + */ + tableList: Array; + + /** + * 简拼 * * @type {string} * @memberof UpdateCodeGenInput */ - busName: string; + pinyin?: string | null; + + /** + * @type {CodeGenMethodEnum} + * @memberof UpdateCodeGenInput + */ + generateMethod?: CodeGenMethodEnum; + + /** + * @type {CodeGenSceneEnum} + * @memberof UpdateCodeGenInput + */ + scene?: CodeGenSceneEnum; /** * 命名空间 @@ -227,116 +196,26 @@ export interface UpdateCodeGenInput { nameSpace: string; /** - * 作者姓名 + * 业务名 * * @type {string} * @memberof UpdateCodeGenInput */ - authorName: string; + busName: string; /** - * 生成方式 + * 页面目录 * * @type {string} * @memberof UpdateCodeGenInput */ - generateType: string; + pagePath: string; /** - * 是否生成菜单 - * - * @type {boolean} + * @type {CodeGenPrintTypeEnum} * @memberof UpdateCodeGenInput */ - generateMenu: boolean; - - /** - * 是否使用 Api Service - * - * @type {boolean} - * @memberof UpdateCodeGenInput - */ - isApiService?: boolean; - - /** - * 模板Id集合 - * - * @type {Array} - * @memberof UpdateCodeGenInput - */ - codeGenTemplateIds?: Array | null; - - /** - * 左边树形结构表 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - leftTab?: string | null; - - /** - * 左边关联字段 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - leftKey?: string | null; - - /** - * 左边关联主表字段 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - leftPrimaryKey?: string | null; - - /** - * 左边树Name - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - leftName?: string | null; - - /** - * 下表名称 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - bottomTab?: string | null; - - /** - * 下表关联字段 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - bottomKey?: string | null; - - /** - * 下表关联主表字段 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - bottomPrimaryKey?: string | null; - - /** - * 模板 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - template?: string | null; - - /** - * 表类型 - * - * @type {string} - * @memberof UpdateCodeGenInput - */ - tabType?: string | null; + printType?: CodeGenPrintTypeEnum; /** * 代码生成器Id diff --git a/Web/src/api-services/system/models/update-dict-type-input.ts b/Web/src/api-services/system/models/update-dict-type-input.ts index 605fdc45..c92daaaa 100644 --- a/Web/src/api-services/system/models/update-dict-type-input.ts +++ b/Web/src/api-services/system/models/update-dict-type-input.ts @@ -125,12 +125,6 @@ export interface UpdateDictTypeInput { */ status?: StatusEnum; - /** - * @type {YesNoEnum} - * @memberof UpdateDictTypeInput - */ - isTenant?: YesNoEnum; - /** * @type {YesNoEnum} * @memberof UpdateDictTypeInput diff --git a/Web/src/api-services/system/models/upload-file-from-base64-input.ts b/Web/src/api-services/system/models/upload-file-from-base64-input.ts index c990762d..182744b8 100644 --- a/Web/src/api-services/system/models/upload-file-from-base64-input.ts +++ b/Web/src/api-services/system/models/upload-file-from-base64-input.ts @@ -67,4 +67,12 @@ export interface UploadFileFromBase64Input { * @memberof UploadFileFromBase64Input */ isPublic?: boolean; + + /** + * 业务Id + * + * @type {number} + * @memberof UploadFileFromBase64Input + */ + dataId?: number | null; } diff --git a/Web/src/api-services/system/models/verify-rule-item.ts b/Web/src/api-services/system/models/verify-rule-item.ts deleted file mode 100644 index 611ae8ba..00000000 --- a/Web/src/api-services/system/models/verify-rule-item.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Admin.NET 通用权限开发平台 - * 让 .NET 开发更简单、更通用、更流行。整合最新技术,模块插件式开发,前后端分离,开箱即用。
👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动!任何基于本项目二次开发而产生的一切法律纠纷和责任,我们不承担任何责任! - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - /** - * 验证规则选项 - * - * @export - * @interface VerifyRuleItem - */ -export interface VerifyRuleItem { - - /** - * 编码 - * - * @type {number} - * @memberof VerifyRuleItem - */ - key?: number; - - /** - * 验证类型 - * - * @type {string} - * @memberof VerifyRuleItem - */ - type?: string | null; - - /** - * 验证错误消息 - * - * @type {string} - * @memberof VerifyRuleItem - */ - message?: string | null; - - /** - * 最小值 - * - * @type {string} - * @memberof VerifyRuleItem - */ - min?: string | null; - - /** - * 最大值 - * - * @type {string} - * @memberof VerifyRuleItem - */ - max?: string | null; - - /** - * 正则表达式 - * - * @type {string} - * @memberof VerifyRuleItem - */ - pattern?: string | null; - - /** - * 数据类型(搭配正则) - * - * @type {string} - * @memberof VerifyRuleItem - */ - dataType?: string | null; -}