first commit

This commit is contained in:
2025-03-21 11:05:42 +08:00
commit 7dffc94035
1717 changed files with 724764 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package snowflake
import (
"github.com/bwmarrin/snowflake"
)
var node *snowflake.Node
func Init() error {
n, err := snowflake.NewNode(1)
if err != nil {
return err
}
node = n
return nil
}
func GetId() int64 {
return node.Generate().Int64()
}