using DataType = FreeSql.DataType; namespace NetAdmin.Infrastructure; /// /// 全局静态类 /// public static class GlobalStatic { /// /// 产品版本 /// public static readonly string ProductVersion = FileVersionInfo.GetVersionInfo(Assembly.GetEntryAssembly()!.Location).ProductVersion; /// /// 调试模式 /// public static bool DebugMode => #if DEBUG true #else false #endif ; /// /// 日志记录器忽略的API编号 /// public static string[] LoggerIgnoreApiIds => []; /// /// 系统内部密钥 /// public static string SecretKey => "{6C4922D3-499A-46db-BFC4-0B51A9C4395F}"; /// /// SQL 随机排序语法 /// /// NotImplementedException public static string SqlRandomSorting => App.GetOptions().DbType switch { DataType.MySql => "RAND()" , DataType.SqlServer => "NEWID()" , DataType.PostgreSQL => "RANDOM()" , DataType.Oracle => "DBMS_RANDOM.value" , DataType.Sqlite => "RANDOM()" , DataType.OdbcOracle => throw new NotImplementedException() , DataType.OdbcSqlServer => throw new NotImplementedException() , DataType.OdbcMySql => throw new NotImplementedException() , DataType.OdbcPostgreSQL => throw new NotImplementedException() , DataType.Odbc => throw new NotImplementedException() , DataType.OdbcDameng => throw new NotImplementedException() , DataType.MsAccess => throw new NotImplementedException() , DataType.Dameng => throw new NotImplementedException() , DataType.OdbcKingbaseES => throw new NotImplementedException() , DataType.ShenTong => throw new NotImplementedException() , DataType.KingbaseES => throw new NotImplementedException() , DataType.Firebird => throw new NotImplementedException() , DataType.Custom => throw new NotImplementedException() , DataType.ClickHouse => throw new NotImplementedException() , DataType.GBase => throw new NotImplementedException() , DataType.QuestDb => throw new NotImplementedException() , DataType.Xugu => throw new NotImplementedException() , DataType.CustomOracle => throw new NotImplementedException() , DataType.CustomSqlServer => throw new NotImplementedException() , DataType.CustomMySql => throw new NotImplementedException() , DataType.CustomPostgreSQL => throw new NotImplementedException() , _ => throw new NotImplementedException() }; /// /// Json序列化选项 /// public static JsonSerializerOptions JsonSerializerOptions { get; set; } }