109 lines
3.1 KiB
C#
109 lines
3.1 KiB
C#
namespace MiaoYu.Core.CodeGenerator.Abstractions;
|
||
|
||
/// <summary>
|
||
/// 数据源配置
|
||
/// </summary>
|
||
public class DataSourceConfig
|
||
{
|
||
/// <summary>
|
||
/// 数据库标识(如:Admin, MiaoYuChat, LiveForum)
|
||
/// </summary>
|
||
public string DatabaseKey { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 显示名称
|
||
/// </summary>
|
||
public string DisplayName { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 实体项目命名空间
|
||
/// </summary>
|
||
public string EntityNamespace { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 服务层命名空间
|
||
/// </summary>
|
||
public string ServiceNamespace { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 控制器命名空间
|
||
/// </summary>
|
||
public string ControllerNamespace { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 客户端服务命名空间
|
||
/// </summary>
|
||
public string ClientServiceNamespace { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 实体类路径模板(支持占位符:{RootPath}, {Namespace}, {EntityName}, {EntityNamePlural}, {TableName})
|
||
/// </summary>
|
||
public string ModelPathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 服务层路径模板
|
||
/// </summary>
|
||
public string ServicePathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 控制器路径模板
|
||
/// </summary>
|
||
public string ControllerPathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 前端Index页面路径模板
|
||
/// </summary>
|
||
public string ClientIndexPathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 前端Info页面路径模板
|
||
/// </summary>
|
||
public string ClientInfoPathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 前端Service路径模板
|
||
/// </summary>
|
||
public string ClientServicePathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 前端菜单路径模板(支持占位符:{TableName}, {TableNameLower})
|
||
/// </summary>
|
||
public string MenuPathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 前端路由路径模板(支持占位符:{TableName}, {TableNameLower})
|
||
/// </summary>
|
||
public string RouterPathTemplate { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 代码生成模板目录
|
||
/// </summary>
|
||
public string TemplatePath { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 实体类命名规则(保持原名 or 驼峰转换)
|
||
/// </summary>
|
||
public EntityNamingStrategy NamingStrategy { get; set; }
|
||
|
||
/// <summary>
|
||
/// 排序权重(数字越小越靠前)
|
||
/// </summary>
|
||
public int Order { get; set; }
|
||
|
||
/// <summary>
|
||
/// 是否启用实体类名前缀(用于避免多数据源同名表冲突)
|
||
/// </summary>
|
||
public bool EnableEntityPrefix { get; set; } = false;
|
||
|
||
/// <summary>
|
||
/// 实体类名前缀(如:Chat、Forum)
|
||
/// </summary>
|
||
public string EntityPrefix { get; set; } = string.Empty;
|
||
|
||
/// <summary>
|
||
/// 是否使用复数形式的路径(如 /Users/ vs /User/)
|
||
/// </summary>
|
||
public bool UsesPluralPath { get; set; } = true;
|
||
}
|
||
|