Ai
2 Star 0 Fork 0

g_boot/chkboot-common

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
snowflake.go 336 Bytes
Copy Edit Raw Blame History
flyfly authored 2023-12-01 16:43 +08:00 . fix: 添加字段填充功能
package libUtils
import (
"github.com/bwmarrin/snowflake"
)
var snowflakeNode *snowflake.Node
func init(){
snowflakeNode, _ = snowflake.NewNode(1)
}
//雪花id
func SnowflakeId() int64 {
return snowflakeNode.Generate().Int64()
}
//雪花id字符串型
func SnowflakeIdStr() string {
return snowflakeNode.Generate().String()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/g_boot/chkboot-common.git
git@gitee.com:g_boot/chkboot-common.git
g_boot
chkboot-common
chkboot-common
v1.0.1

Search