✨ codeFirst实体建表
This commit is contained in:
@@ -1,38 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using SqlSugar;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ZR.Model.System.Generate
|
||||
{
|
||||
/// <summary>
|
||||
/// 代码生成表
|
||||
/// </summary>
|
||||
[SqlSugar.SugarTable("gen_table")]
|
||||
[SqlSugar.Tenant("0")]
|
||||
[SugarTable("gen_table", "代码生成表")]
|
||||
[Tenant("0")]
|
||||
public class GenTable : SysBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 表id
|
||||
/// </summary>
|
||||
[SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public int TableId { get; set; }
|
||||
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
|
||||
public long TableId { get; set; }
|
||||
/// <summary>
|
||||
/// 数据库名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string DbName { get; set; }
|
||||
/// <summary>
|
||||
/// 表名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string TableName { get; set; }
|
||||
/// <summary>
|
||||
/// 表描述
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string TableComment { get; set; }
|
||||
/// <summary>
|
||||
/// 关联父表的表名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string SubTableName { get; set; }
|
||||
/// <summary>
|
||||
/// 本表关联父表的外键名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 150)]
|
||||
public string SubTableFkName { get; set; }
|
||||
/// <summary>
|
||||
/// csharp类名
|
||||
@@ -41,18 +47,22 @@ namespace ZR.Model.System.Generate
|
||||
/// <summary>
|
||||
/// 使用的模板(crud单表操作 tree树表操作 sub主子表操作)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50, DefaultValue = "crud")]
|
||||
public string TplCategory { get; set; }
|
||||
/// <summary>
|
||||
/// 基本命名空间前缀
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 100)]
|
||||
public string BaseNameSpace { get; set; }
|
||||
/// <summary>
|
||||
/// 生成模块名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string ModuleName { get; set; }
|
||||
/// <summary>
|
||||
/// 生成业务名
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 50)]
|
||||
public string BusinessName { get; set; }
|
||||
/// <summary>
|
||||
/// 生成功能名
|
||||
@@ -65,23 +75,30 @@ namespace ZR.Model.System.Generate
|
||||
/// <summary>
|
||||
/// 生成代码方式(0zip压缩包 1自定义路径)
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 1, DefaultValue = "0")]
|
||||
public string GenType { get; set; }
|
||||
/// <summary>
|
||||
/// 代码生成保存路径
|
||||
/// </summary>
|
||||
[SugarColumn(Length = 200, DefaultValue = "/")]
|
||||
public string GenPath { get; set; }
|
||||
/// <summary>
|
||||
/// 其他生成选项
|
||||
/// </summary>
|
||||
[SqlSugar.SugarColumn(IsJson = true, ColumnDataType = "nvarchar(4000)")]
|
||||
[SugarColumn(IsJson = true)]
|
||||
public Options Options { get; set; }
|
||||
|
||||
#region 表额外字段
|
||||
/** 表列信息 */
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
/// <summary>
|
||||
/// 表列信息
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<GenTableColumn> Columns { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 字表信息
|
||||
/// </summary>
|
||||
[SqlSugar.SugarColumn(IsIgnore = true)]
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public GenTable SubTable { get; set; }
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user