Ver código fonte

😁1、增加读写分离/主从库配置示例 2、升级Furion v4.9.1.20

zuohuaijun 2 anos atrás
pai
commit
9ecb943663

+ 10 - 0
Admin.NET/Admin.NET.Application/Configuration/Database.json

@@ -9,6 +9,16 @@
         //"ConfigId": "1300000000001", // 默认库标识-禁止修改
         "DbType": "Sqlite", // MySql、SqlServer、Sqlite、Oracle、PostgreSQL、Dm、Kdbndp、Oscar、MySqlConnector、Access、OpenGauss、QuestDB、HG、ClickHouse、GBase、Odbc、Custom
         "ConnectionString": "DataSource=./Admin.NET.db", // 库连接字符串
+        //"SlaveConnectionConfigs": [ // 读写分离/主从
+        //	{
+        //		"HitRate": 10,
+        //		"ConnectionString": "DataSource=./Admin.NET1.db"
+        //	},
+        //	{
+        //		"HitRate": 10,
+        //		"ConnectionString": "DataSource=./Admin.NET2.db"
+        //	}
+        //],
         "DbSettings": {
           "EnableInitDb": true, // 启用库初始化
           "EnableDiffLog": false, // 启用库表差异日志

+ 4 - 4
Admin.NET/Admin.NET.Core/Admin.NET.Core.csproj

@@ -21,15 +21,15 @@
     <PackageReference Include="AspNet.Security.OAuth.Gitee" Version="6.0.15" />
     <PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
     <PackageReference Include="AspNetCoreRateLimit" Version="5.0.0" />
-    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.19" />
-    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.1.19" />
-    <PackageReference Include="Furion.Pure" Version="4.9.1.19" />
+    <PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.20" />
+    <PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.1.20" />
+    <PackageReference Include="Furion.Pure" Version="4.9.1.20" />
     <PackageReference Include="IPTools.China" Version="1.6.0" />
     <PackageReference Include="Lazy.Captcha.Core" Version="2.0.6" />
     <PackageReference Include="Magicodes.IE.Excel" Version="2.7.4.5" />
     <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.4.5" />
     <PackageReference Include="MailKit" Version="4.3.0" />
-    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.25" />
+    <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.26" />
     <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.0.25" />
     <PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.25" />
     <PackageReference Include="NEST" Version="7.17.5" />

+ 6 - 6
Admin.NET/Admin.NET.Core/Option/DbConnectionOptions.cs

@@ -40,23 +40,23 @@ public sealed class DbConnectionOptions : IConfigurableOptions<DbConnectionOptio
 public sealed class DbConnectionConfig : ConnectionConfig
 {
     /// <summary>
-    /// 数据库
+    /// 数据库
     /// </summary>
     public DbSettings DbSettings { get; set; }
 
     /// <summary>
-    /// 表
+    /// 表
     /// </summary>
     public TableSettings TableSettings { get; set; }
 
     /// <summary>
-    /// 种子
+    /// 种子
     /// </summary>
     public SeedSettings SeedSettings { get; set; }
 }
 
 /// <summary>
-/// 数据库
+/// 数据库
 /// </summary>
 public sealed class DbSettings
 {
@@ -77,7 +77,7 @@ public sealed class DbSettings
 }
 
 /// <summary>
-/// 表
+/// 表
 /// </summary>
 public sealed class TableSettings
 {
@@ -93,7 +93,7 @@ public sealed class TableSettings
 }
 
 /// <summary>
-/// 种子
+/// 种子
 /// </summary>
 public sealed class SeedSettings
 {

+ 19 - 19
Admin.NET/Admin.NET.Web.Entry/web.config

@@ -1,22 +1,22 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
-	<system.webServer>
-		<security>
-			<requestFiltering>
-				<requestLimits maxAllowedContentLength="1073741824" maxQueryString="1073741824" />
-			</requestFiltering>
-		</security>
-		<handlers>
-			<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
-		</handlers>
-		<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout">
-			<handlerSettings>
-				<handlerSetting name="experimentalEnableShadowCopy" value="true" />
-				<handlerSetting name="shadowCopyDirectory" value="../ShadowCopyDirectory/" />
-				<!-- Only enable handler logging if you encounter issues-->
-				<!--<handlerSetting name="debugFile" value=".\logs\aspnetcore-debug.log" />-->
-				<!--<handlerSetting name="debugLevel" value="FILE,TRACE" />-->
-			</handlerSettings>
-		</aspNetCore>
-	</system.webServer>
+  <system.webServer>
+    <security>
+      <requestFiltering>
+        <requestLimits maxAllowedContentLength="1073741824" maxQueryString="1073741824" />
+      </requestFiltering>
+    </security>
+    <handlers>
+      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
+    </handlers>
+    <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
+      <handlerSettings>
+        <handlerSetting name="experimentalEnableShadowCopy" value="true" />
+        <handlerSetting name="shadowCopyDirectory" value="../ShadowCopyDirectory/" />
+        <!-- Only enable handler logging if you encounter issues-->
+        <!--<handlerSetting name="debugFile" value=".\logs\aspnetcore-debug.log" />-->
+        <!--<handlerSetting name="debugLevel" value="FILE,TRACE" />-->
+      </handlerSettings>
+    </aspNetCore>
+  </system.webServer>
 </configuration>