添加项目文件。
This commit is contained in:
72
common/Tnb.Common/Configuration/FileVariable.cs
Normal file
72
common/Tnb.Common/Configuration/FileVariable.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// 配置文件.
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class FileVariable
|
||||
{
|
||||
public static string SystemPath = KeyVariable.SystemPath;
|
||||
|
||||
/// <summary>
|
||||
/// 用户头像存储路径.
|
||||
/// </summary>
|
||||
public static string UserAvatarFilePath = Path.Combine(SystemPath, "UserAvatar");
|
||||
|
||||
/// <summary>
|
||||
/// 临时文件存储路径.
|
||||
/// </summary>
|
||||
public static string TemporaryFilePath = Path.Combine(SystemPath, "TemporaryFile");
|
||||
|
||||
/// <summary>
|
||||
/// 备份数据存储路径.
|
||||
/// </summary>
|
||||
public static string DataBackupFilePath = Path.Combine(SystemPath, "DataBackupFile");
|
||||
|
||||
/// <summary>
|
||||
/// IM内容文件存储路径.
|
||||
/// </summary>
|
||||
public static string IMContentFilePath = Path.Combine(SystemPath, "IMContentFile");
|
||||
|
||||
/// <summary>
|
||||
/// 系统文件存储路径.
|
||||
/// </summary>
|
||||
public static string SystemFilePath = Path.Combine(SystemPath, "SystemFile");
|
||||
|
||||
/// <summary>
|
||||
/// 微信公众号资源存储路径.
|
||||
/// </summary>
|
||||
public static string MPMaterialFilePath = Path.Combine(SystemPath, "MPMaterial");
|
||||
|
||||
/// <summary>
|
||||
/// 文档管理存储路径.
|
||||
/// </summary>
|
||||
public static string DocumentFilePath = Path.Combine(SystemPath, "DocumentFile");
|
||||
|
||||
/// <summary>
|
||||
/// 生成代码路径.
|
||||
/// </summary>
|
||||
public static string GenerateCodePath = Path.Combine(SystemPath, "CodeGenerate");
|
||||
|
||||
/// <summary>
|
||||
/// 文件在线预览存储PDF.
|
||||
/// </summary>
|
||||
public static string DocumentPreviewFilePath = Path.Combine(SystemPath, "DocumentPreview");
|
||||
|
||||
/// <summary>
|
||||
/// 邮件文件存储路径.
|
||||
/// </summary>
|
||||
public static string EmailFilePath = Path.Combine(SystemPath, "EmailFile");
|
||||
|
||||
/// <summary>
|
||||
/// 大屏图片路径.
|
||||
/// </summary>
|
||||
public static string BiVisualPath = Path.Combine(SystemPath, "BiVisualPath");
|
||||
|
||||
/// <summary>
|
||||
/// 模板路径.
|
||||
/// </summary>
|
||||
public static string TemplateFilePath = Path.Combine(SystemPath, "TemplateFile");
|
||||
}
|
||||
140
common/Tnb.Common/Configuration/KeyVariable.cs
Normal file
140
common/Tnb.Common/Configuration/KeyVariable.cs
Normal file
@@ -0,0 +1,140 @@
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Options;
|
||||
using JNPF.DependencyInjection;
|
||||
using SqlSugar;
|
||||
|
||||
namespace JNPF.Common.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Key常量.
|
||||
/// </summary>
|
||||
[SuppressSniffer]
|
||||
public class KeyVariable
|
||||
{
|
||||
private static readonly TenantOptions _tenant = App.GetConfig<TenantOptions>("Tenant", true);
|
||||
|
||||
private static readonly AppOptions _jnfp = App.GetConfig<AppOptions>("JNPF_App", true);
|
||||
|
||||
private static readonly OssOptions Oss = App.GetConfig<OssOptions>("OSS", true);
|
||||
|
||||
/// <summary>
|
||||
/// 多租户模式.
|
||||
/// </summary>
|
||||
public static bool MultiTenancy
|
||||
{
|
||||
get
|
||||
{
|
||||
return _tenant.MultiTenancy;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 系统文件路径.
|
||||
/// </summary>
|
||||
public static string SystemPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Oss.Provider.Equals(OSSProviderType.Invalid) ? (string.IsNullOrEmpty(_jnfp.SystemPath) ? Directory.GetCurrentDirectory() : _jnfp.SystemPath) : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 命名空间.
|
||||
/// </summary>
|
||||
public static List<string> AreasName
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(_jnfp.CodeAreasName.ToString()) ? new List<string>() : _jnfp.CodeAreasName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许上传图片类型.
|
||||
/// </summary>
|
||||
public static List<string> AllowImageType
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(_jnfp.AllowUploadImageType.ToString()) ? new List<string>() : _jnfp.AllowUploadImageType;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 允许上传文件类型.
|
||||
/// </summary>
|
||||
public static List<string> AllowUploadFileType
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(_jnfp.AllowUploadFileType.ToString()) ? new List<string>() : _jnfp.AllowUploadFileType;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 微信允许上传文件类型.
|
||||
/// </summary>
|
||||
public static List<string> WeChatUploadFileType
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(_jnfp.WeChatUploadFileType.ToString()) ? new List<string>() : _jnfp.WeChatUploadFileType;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 过滤上传文件名称特殊字符.
|
||||
/// </summary>
|
||||
public static List<string> SpecialString
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(_jnfp.SpecialString.ToString()) ? new List<string>() : _jnfp.SpecialString;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MinIO桶.
|
||||
/// </summary>
|
||||
public static string BucketName
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(Oss.BucketName) ? string.Empty : Oss.BucketName;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文件储存类型.
|
||||
/// </summary>
|
||||
public static OSSProviderType FileStoreType
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(Oss.Provider.ToString()) ? OSSProviderType.Invalid : Oss.Provider;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// App版本.
|
||||
/// </summary>
|
||||
public static string AppVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(App.Configuration["JNPF_APP:AppVersion"]) ? string.Empty : App.Configuration["JNPF_APP:AppVersion"];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 文件储存类型.
|
||||
/// </summary>
|
||||
public static string AppUpdateContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(App.Configuration["JNPF_APP:AppUpdateContent"]) ? string.Empty : App.Configuration["JNPF_APP:AppUpdateContent"];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user