Quellcode durchsuchen

添加配置信息,denny

Jeremy vor 1 Jahr
Ursprung
Commit
9ec12479d4
1 geänderte Dateien mit 133 neuen und 0 gelöschten Zeilen
  1. 133 0
      Config/EnvironmentConfigs.cs

+ 133 - 0
Config/EnvironmentConfigs.cs

@@ -10,6 +10,7 @@ namespace WingServerCommon.Config
         public static General General { get; } = new General();
         public static Rtmp Rtmp { get; } = new Rtmp();
         public static Rtc Rtc { get; } = new Rtc();
+        public static Storage Storage { get; } = new Storage();
     }
 
     public class BaseEnvironment
@@ -39,6 +40,23 @@ namespace WingServerCommon.Config
                 return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "LiveProtocol").Value;
             }
         }
+
+        /// <summary>
+        /// General read live config
+        /// </summary>
+        public T LiveProtocolDetail<T>()
+        {
+            var t = default(T);
+            if (LiveProtocol.ToLower() == "rtmp")
+            {
+                t = (T)Enum.Parse(typeof(T), EnvironmentConfigs.Rtmp.RTMPType);
+            }
+            else
+            {
+                t = (T)Enum.Parse(typeof(T), EnvironmentConfigs.Rtc.RTCType);
+            }
+            return t;
+        }
     }
 
     /// <summary>
@@ -156,5 +174,120 @@ namespace WingServerCommon.Config
             }
         }
     }
+
+    /// <summary>
+    /// Storage
+    /// </summary>
+    public class Storage : BaseEnvironment
+    {
+        public Storage() : base()
+        {
+        }
+
+        public int AutoSliceSizeForUpload
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<IntParameter>(_name, "AutoSliceSizeForUpload").Value;
+            }
+        }
+
+        public int ManualDivisionForUpload
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<IntParameter>(_name, "ManualDivisionForUpload").Value;
+            }
+        }
+
+        public string OtherNodes
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "OtherNodes").Value;
+            }
+        }
+
+        public string ServerHost
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "ServerHost").Value;
+            }
+        }
+
+        public string StorageServer
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "StorageServer").Value;
+            }
+        }
+        public string AppId
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "AppId").Value;
+            }
+        }
+
+        public string Sercret
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "Sercret").Value;
+            }
+        }
+
+        public string CFSServerUrl
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "CFSServerUrl").Value;
+            }
+        }
+
+        public string CDNServerUrl
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "CDNServerUrl").Value;
+            }
+        }
+        public string VCSStorageDisk
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "VCSStorageDisk").Value;
+            }
+        }
+    }
+
+    /// <summary>
+    /// Gateway
+    /// </summary>
+    public class Gateway : BaseEnvironment
+    {
+        public Gateway() : base()
+        {
+        }
+
+        public string Host
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "Host").Value;
+            }
+        }
+
+        public string Domains
+        {
+            get
+            {
+                return EnvironmentConfigManager.GetParammeter<StringParameter>(_name, "Domains").Value;
+            }
+        }
+    }
+    
 }