MIke 3 年之前
父節點
當前提交
1af1f08d70
共有 3 個文件被更改,包括 36 次插入6 次删除
  1. 18 2
      Config/ConfigurationManager.cs
  2. 14 0
      Config/NotificationSettings.cs
  3. 4 4
      WingServerCommon.csproj

+ 18 - 2
Config/ConfigurationManager.cs

@@ -39,6 +39,12 @@ namespace WingServerCommon.Config
         /// </summary>
         /// <value></value>
         public static RemedicalSettings? RemedicalSettings { get; private set; }
+        /// <summary>
+        /// Notification Service Settings is from configuration file
+        /// </summary>
+        /// <value></value>
+        public static NotificationSettings? NotificationSettings { get; private set; }
+
         static ConfigurationManager()
         {
             var configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "appsettings.json");
@@ -73,10 +79,10 @@ namespace WingServerCommon.Config
             LogSettings = new LogSettings(debugMode);
             LoadRemedicalConfig();
             LoadStorageConfig();
-
+            LoadNotificationConfig();
             //TODO others      
         }
-        
+
         /// <summary>
         /// load  remedical config
         /// </summary>
@@ -88,6 +94,16 @@ namespace WingServerCommon.Config
             };
         }
 
+        private static void LoadNotificationConfig()
+        {
+            NotificationSettings = new NotificationSettings();
+            var port = GetParammeter<IntParameter>("Notification", "Port")?.Value;
+            if (port != null)
+            {
+                NotificationSettings.Port = port.Value;
+            }
+        }
+
         /// <summary>
         /// 加载 存储服务 配置
         /// </summary>

+ 14 - 0
Config/NotificationSettings.cs

@@ -0,0 +1,14 @@
+namespace WingServerCommon.Config
+{
+    /// <summary>
+    /// 通知设置
+    /// </summary>
+    public class NotificationSettings
+    {
+        /// <summary>
+        /// 监听端口
+        /// </summary>
+        /// <value></value>
+        public int Port { get; set; } = 8992;
+    }
+}

+ 4 - 4
WingServerCommon.csproj

@@ -4,12 +4,12 @@
     <TargetFramework>net6.0</TargetFramework>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>1.0.0.16</Version>
-    <AssemblyVersion>1.0.0.16</AssemblyVersion>
-    <FileVersion>1.0.0.16</FileVersion>
+    <Version>1.0.0.18</Version>
+    <AssemblyVersion>1.0.0.18</AssemblyVersion>
+    <FileVersion>1.0.0.18</FileVersion>
   </PropertyGroup>
  <ItemGroup>
-    <PackageReference Include="JsonRpcLite" Version="*" />
+ <PackageReference Include="JsonRpcLite" Version="*" />
     <PackageReference Include="Serilog" Version="2.10.0" />
     <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
     <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />