namespace IStation
{
internal class ConfigHelper
{
///
/// 默认连接配置
///
internal static ConnectionConfig DefaultConnectionConfig
{
get
{
//SnowFlakeSingle.WorkId = Settings.SqlSugar.SnowFlakeWorkId; 不同机器配置的唯一数字; // 单服务器不需要指定
return new ConnectionConfig()
{
DbType = SqlSugar.DbType.PostgreSQL,//数据库类型
ConnectionString = Settings.SZJTParasHelper.SZJT.DataBase.ConnectString,
IsAutoCloseConnection = true,//是否自动关闭
MoreSettings = new ConnMoreSettings()
{
//PgSqlIsAutoToLower = false //数据库存在大写字段的 ,需要把这个设为false ,并且实体和字段名称要一样
},
AopEvents = new AopEvents
{
OnLogExecuting = (sql, p) =>
{
// Console.WriteLine(sql);
}
}
};
}
}
///
/// 缓存保持时间 (分钟)
///
public static int CacheKeepTime
{
get
{
return MemoryCacheParasHelper.MemoryCache.KeepTime;
}
}
///
/// 缓存随机时间 (秒)
///
public static int CacheRandomTime
{
get
{
return RandomHelper.Random(0, MemoryCacheParasHelper.MemoryCache.RandomTime);
}
}
}
}