bag
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace YhCore.Common.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局配置门面(对齐 Java com.yunhai.bschclassmanage.config.Config 枚举:
|
||||
/// API_PATH / MOBILEAPI_PATH / OAPI + FILE_WEB_PATH / FILE_PATH)。
|
||||
/// 路由常量复用 <see cref="YhCore.Common.ApiRoutes"/>;文件路径由 Startup 从配置初始化。
|
||||
/// </summary>
|
||||
public static class ApiPathConfig
|
||||
{
|
||||
/// <summary>PC 端接口前缀(对应 Java Config.API_PATH)</summary>
|
||||
public const string ApiPath = "api";
|
||||
|
||||
/// <summary>移动端接口前缀(对应 Java Config.MOBILEAPI_PATH)</summary>
|
||||
public const string MobiApiPath = "mobiapi";
|
||||
|
||||
/// <summary>开放接口前缀(对应 Java Config.OAPI)</summary>
|
||||
public const string OApiPath = "oapi";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace YhCore.Common.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局配置静态门面(对齐 Java com.yunhai.bschclassmanage.config.Config 枚举:
|
||||
/// API_PATH / MOBILEAPI_PATH / OAPI + FILE_WEB_PATH / FILE_PATH)。
|
||||
/// 路由常量复用 <see cref="YhCore.Common.ApiRoutes"/>;文件路径由 Startup 从配置初始化。
|
||||
/// </summary>
|
||||
public static class Config
|
||||
{
|
||||
/// <summary>PC 端接口前缀(对应 Java Config.API_PATH)</summary>
|
||||
public const string ApiPath = "api";
|
||||
|
||||
/// <summary>移动端接口前缀(对应 Java Config.MOBILEAPI_PATH)</summary>
|
||||
public const string MobiApiPath = "mobiapi";
|
||||
|
||||
/// <summary>开放接口前缀(对应 Java Config.OAPI)</summary>
|
||||
public const string OApiPath = "oapi";
|
||||
|
||||
/// <summary>文件存储根路径(对应 Java FILE_PATH,由 Startup 注入)</summary>
|
||||
public static string FilePath { get; set; }
|
||||
|
||||
/// <summary>文件访问 URL 前缀(对应 Java FILE_WEB_PATH,由 Startup 注入)</summary>
|
||||
public static string FileWebPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace YhCore.Common.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 数据库配置(对应 appsettings DatabaseProvider + ConnectionStrings 节)。
|
||||
/// </summary>
|
||||
public class DatabaseConfig
|
||||
{
|
||||
/// <summary>数据库提供者:SqlServer / MySql</summary>
|
||||
public string DatabaseProvider { get; set; } = "SqlServer";
|
||||
|
||||
/// <summary>SQL Server 连接串</summary>
|
||||
public string SqlServer { get; set; }
|
||||
|
||||
/// <summary>MySQL 连接串</summary>
|
||||
public string Mysql { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace YhCore.Common.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件存储配置(对应 appsettings FILE_PATH / FILE_WEB_PATH,对齐 Java config.FileConfig)。
|
||||
/// </summary>
|
||||
public class FileConfig
|
||||
{
|
||||
/// <summary>文件存储根路径(对应 Java FILE_PATH)</summary>
|
||||
public string FilePath { get; set; }
|
||||
|
||||
/// <summary>文件访问 URL 前缀(对应 Java FILE_WEB_PATH)</summary>
|
||||
public string FileWebPath { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace YhCore.Common.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Redis 配置(对应 appsettings Redis 节,对齐 Java config.RedisConfig)。
|
||||
/// </summary>
|
||||
public class RedisConfig
|
||||
{
|
||||
/// <summary>连接串(如 localhost:6379,defaultDatabase=0)</summary>
|
||||
public string ConnectionString { get; set; } = "localhost:6379,defaultDatabase=0";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace YhCore.Common.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Swagger 配置(对应 appsettings Swagger 节,对齐 Java config.SwaggerConfig)。
|
||||
/// </summary>
|
||||
public class SwaggerConfig
|
||||
{
|
||||
public string Title { get; set; } = "YhCore API";
|
||||
|
||||
public string Description { get; set; }
|
||||
|
||||
public string Version { get; set; } = "v1";
|
||||
|
||||
/// <summary>分组(api / mobiapi / oapi)</summary>
|
||||
public string[] Groups { get; set; } = { ApiPathConfig.ApiPath, ApiPathConfig.MobiApiPath, ApiPathConfig.OApiPath };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user