diff --git a/id/snowflake.go b/id/snowflake.go index 32007e8..d59f9b8 100644 --- a/id/snowflake.go +++ b/id/snowflake.go @@ -59,3 +59,8 @@ func NewSnowflakeID(workerId int64) (int64, error) { return node.Generate(), nil } + +func GenerateSnowflakeID(workerId int64) int64 { + id, _ := NewSnowflakeID(workerId) + return id +} diff --git a/id/sonyflake.go b/id/sonyflake.go index 18a675c..4941a86 100644 --- a/id/sonyflake.go +++ b/id/sonyflake.go @@ -23,3 +23,8 @@ func NewSonyflakeID() (uint64, error) { return sf.NextID() } + +func GenerateSonyflakeID() uint64 { + id, _ := NewSonyflakeID() + return id +} diff --git a/tag.bat b/tag.bat index f6aaba5..f018f25 100644 --- a/tag.bat +++ b/tag.bat @@ -5,7 +5,7 @@ git tag geoip/v1.1.5 git tag translator/v1.1.2 git tag copierutil/v0.0.5 git tag jwtutil/v0.0.2 -git tag id/v0.0.1 +git tag id/v0.0.2 git tag slug/v0.0.1 git tag entgo/v1.1.30