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 LowerColumnName =>
string.IsNullOrWhiteSpace(ColumnName) ? null : ColumnName[..1].ToLower() + ColumnName[1..];
///
/// 字段描述
///
public string ColumnComment { get; set; }
///
/// .NET类型
///
public string NetType { get; set; }
///
/// 作用类型(字典)
///
public string EffectType { 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 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 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 == "fk")
{
str = LowerFkEntityName + "_FK_" + LowerFkColumnName;
}
else if (EffectType == "Upload")
{
str = "sysFile_FK_" + LowerColumnName;
}
return str;
}
}
///
/// 显示文本字段
///
public string DisplayColumn { get; set; }
///
/// 选中值字段
///
public string ValueColumn { get; set; }
///
/// 父级字段
///
public string PidColumn { get; set; }
}