HuanMengAdmin/admin-server/MiaoYu.Core.CodeGenerator/Abstractions/DataSourceConfig.cs
2025-11-08 02:39:31 +08:00

84 lines
2.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>
/// 实体类路径模板(支持占位符:{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>
/// 代码生成模板目录
/// </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;
}