using JNPF.Common.Enums; using JNPF.Common.Options; using JNPF.DependencyInjection; using SqlSugar; namespace JNPF.Common.Configuration; /// /// Key常量. /// [SuppressSniffer] public class KeyVariable { private static readonly TenantOptions _tenant = App.GetConfig("Tenant", true); private static readonly AppOptions _jnfp = App.GetConfig("JNPF_App", true); private static readonly OssOptions Oss = App.GetConfig("OSS", true); /// /// 多租户模式. /// public static bool MultiTenancy { get { return _tenant.MultiTenancy; } } /// /// 多租户模式. /// public static string MultiTenancyType { get { return _tenant.MultiTenancyType; } } /// /// 系统文件路径. /// public static string SystemPath { get { return Oss.Provider.Equals(OSSProviderType.Invalid) ? (string.IsNullOrEmpty(_jnfp.SystemPath) ? Directory.GetCurrentDirectory() : _jnfp.SystemPath) : string.Empty; } } /// /// 命名空间. /// public static List AreasName { get { return string.IsNullOrEmpty(_jnfp.CodeAreasName.ToString()) ? new List() : _jnfp.CodeAreasName; } } /// /// 允许上传图片类型. /// public static List AllowImageType { get { return string.IsNullOrEmpty(_jnfp.AllowUploadImageType.ToString()) ? new List() : _jnfp.AllowUploadImageType; } } /// /// 允许上传文件类型. /// public static List AllowUploadFileType { get { return string.IsNullOrEmpty(_jnfp.AllowUploadFileType.ToString()) ? new List() : _jnfp.AllowUploadFileType; } } /// /// 微信允许上传文件类型. /// public static List WeChatUploadFileType { get { return string.IsNullOrEmpty(_jnfp.WeChatUploadFileType.ToString()) ? new List() : _jnfp.WeChatUploadFileType; } } /// /// 过滤上传文件名称特殊字符. /// public static List SpecialString { get { return string.IsNullOrEmpty(_jnfp.SpecialString.ToString()) ? new List() : _jnfp.SpecialString; } } /// /// MinIO桶. /// public static string BucketName { get { return string.IsNullOrEmpty(Oss.BucketName) ? string.Empty : Oss.BucketName; } } /// /// 文件储存类型. /// public static OSSProviderType FileStoreType { get { return string.IsNullOrEmpty(Oss.Provider.ToString()) ? OSSProviderType.Invalid : Oss.Provider; } } /// /// App版本. /// public static string AppVersion { get { return string.IsNullOrEmpty(App.Configuration["JNPF_APP:AppVersion"]) ? string.Empty : App.Configuration["JNPF_APP:AppVersion"]; } } /// /// 文件储存类型. /// public static string AppUpdateContent { get { return string.IsNullOrEmpty(App.Configuration["JNPF_APP:AppUpdateContent"]) ? string.Empty : App.Configuration["JNPF_APP:AppUpdateContent"]; } } }