Support custom snowid

This commit is contained in:
sunkaixuan
2023-02-27 16:15:47 +08:00
parent 1f25df6651
commit 6a18ca31a5
2 changed files with 5 additions and 0 deletions

View File

@@ -71,6 +71,10 @@ namespace SqlSugar.DistributedSystem.Snowflake
}
public virtual long NextId()
{
if (StaticConfig.CustomSnowFlakeFunc != null)
{
return StaticConfig.CustomSnowFlakeFunc();
}
lock(_lock)
{
var timestamp = TimeGen();

View File

@@ -9,5 +9,6 @@ namespace SqlSugar
public static Func<string,string> Encode { get; set; }
public static Func<string,string> Decode{ get; set; }
public const string CodeFirst_BigString = "varcharmax,longtext,text,clob";
public static Func<long> CustomSnowFlakeFunc;
}
}