mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-26 13:43:10 +08:00
Support custom snowid
This commit is contained in:
@@ -71,6 +71,10 @@ namespace SqlSugar.DistributedSystem.Snowflake
|
||||
}
|
||||
public virtual long NextId()
|
||||
{
|
||||
if (StaticConfig.CustomSnowFlakeFunc != null)
|
||||
{
|
||||
return StaticConfig.CustomSnowFlakeFunc();
|
||||
}
|
||||
lock(_lock)
|
||||
{
|
||||
var timestamp = TimeGen();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user