From be97676f278532b9f29d91a29f4813769165a578 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期四, 18 七月 2024 13:44:27 +0800 Subject: [PATCH] service.xhs --- Service/HStation.Service.Xhs.Core/00-core/ConfigHelper.cs | 37 +++++++++++++++---------------------- 1 files changed, 15 insertions(+), 22 deletions(-) diff --git a/Service/HStation.Service.Xhs.Core/00-core/ConfigHelper.cs b/Service/HStation.Service.Xhs.Core/00-core/ConfigHelper.cs index 8adb3ac..b9bc8df 100644 --- a/Service/HStation.Service.Xhs.Core/00-core/ConfigHelper.cs +++ b/Service/HStation.Service.Xhs.Core/00-core/ConfigHelper.cs @@ -1,37 +1,30 @@ -锘縰sing HStation.Settings; -using SqlSugar; - -namespace HStation.Xhs +锘縩amespace HStation.Xhs { public class ConfigHelper { /// <summary> /// 榛樿杩炴帴閰嶇疆 /// </summary> - public static ConnectionConfig DefaultConnectionConfig + internal static ConnectionConfig DefaultConnectionConfig { get { - //SnowFlakeSingle.WorkId = Settings.SqlSugar.SnowFlakeWorkId; 涓嶅悓鏈哄櫒閰嶇疆鐨勫敮涓�鏁板瓧; // 鍗曟湇鍔″櫒涓嶉渶瑕佹寚瀹� - return new ConnectionConfig() + ConnectionConfig connectConfig = null; + switch (XhsParasHelper.Xhs.DataBase.DbType) { - DbType = SqlSugar.DbType.PostgreSQL,//鏁版嵁搴撶被鍨� - ConnectionString = XhsParasHelper.Xhs.DataBase.PostgreSql.ConnectString, - IsAutoCloseConnection = true,//鏄惁鑷姩鍏抽棴 - MoreSettings = new ConnMoreSettings() - { - //PgSqlIsAutoToLower = false //鏁版嵁搴撳瓨鍦ㄥぇ鍐欏瓧娈电殑 锛岄渶瑕佹妸杩欎釜璁句负false 锛屽苟涓斿疄浣撳拰瀛楁鍚嶇О瑕佷竴鏍� - }, - AopEvents = new AopEvents - { - OnLogExecuting = (sql, p) => + case DbType.PostgreSql: { - // var sqlString = UtilMethods.GetNativeSql(sql, p); - //LogHelper.Debug(sqlString); - // Console.WriteLine(sql); + connectConfig = PostgreSqlConnectionConfig; } - } - }; + break; + case DbType.SQLite: + { + connectConfig = SQLiteConnectionConfig; + } + break; + default: break; + } + return connectConfig; } } -- Gitblit v1.9.3