namespace ZR.Model.System.Generate { /// /// 代码生成表 /// [SugarTable("gen_table", "代码生成表")] [Tenant("0")] public class GenTable : SysBase { /// /// 表id /// [SugarColumn(IsPrimaryKey = true, IsIdentity = true)] public long TableId { get; set; } /// /// 数据库名 /// [SugarColumn(Length = 50)] public string DbName { get; set; } /// /// 表名 /// [SugarColumn(Length = 150)] public string TableName { get; set; } /// /// 表描述 /// [SugarColumn(Length = 150)] public string TableComment { get; set; } /// /// 关联父表的表名 /// [SugarColumn(Length = 150)] public string SubTableName { get; set; } /// /// 本表关联父表的外键名 /// [SugarColumn(Length = 150)] public string SubTableFkName { get; set; } /// /// csharp类名 /// public string ClassName { get; set; } /// /// 使用的模板(crud单表操作 tree树表操作 sub主子表操作) /// [SugarColumn(Length = 50, DefaultValue = "crud")] public string TplCategory { get; set; } /// /// 基本命名空间前缀 /// [SugarColumn(Length = 100)] public string BaseNameSpace { get; set; } /// /// 生成模块名 /// [SugarColumn(Length = 50)] public string ModuleName { get; set; } /// /// 生成业务名 /// [SugarColumn(Length = 50)] public string BusinessName { get; set; } /// /// 生成功能名 /// public string FunctionName { get; set; } /// /// 生成作者名 /// public string FunctionAuthor { get; set; } /// /// 生成代码方式(0zip压缩包 1自定义路径) /// [SugarColumn(Length = 1, DefaultValue = "0")] public string GenType { get; set; } /// /// 代码生成保存路径 /// [SugarColumn(Length = 200, DefaultValue = "/")] public string GenPath { get; set; } /// /// 其他生成选项 /// [SugarColumn(IsJson = true)] public CodeOptions Options { get; set; } #region 表额外字段 /// /// 表列信息 /// [SugarColumn(IsIgnore = true)] public List Columns { get; set; } /// /// 字表信息 /// [SugarColumn(IsIgnore = true)] public GenTable SubTable { get; set; } #endregion } public class CodeOptions { public long ParentMenuId { get; set; } public string SortType { get; set; } = "asc"; public string SortField { get; set; } = string.Empty; public string TreeCode { get; set; } = string.Empty; public string TreeName { get; set; } = string.Empty; public string TreeParentCode { get; set; } = string.Empty; public string PermissionPrefix { get; set; } = string.Empty; /// /// 额外参数字符串 /// public int[] CheckedBtn { get; set; } = new int[] { 1, 2, 3 }; /// /// 列大小 12,24 /// public int ColNum { get; set; } = 12; /// /// 是否生成仓储层 /// public int GenerateRepo { get; set; } /// /// 自动生成菜单 /// public bool GenerateMenu { get; set; } /// /// 操作按钮样式 /// public int OperBtnStyle { get; set; } = 1; /// /// 是否使用雪花id /// public bool UseSnowflakeId { get; set; } = false; /// /// 是否启用日志(编辑、删除)自动记录日志 /// public bool EnableLog { get; set; } /// /// 前端模板 1、element ui 2、element plus /// public int FrontTpl { get; set; } = 2; } }