修复比赛场id重复问题

This commit is contained in:
sk 2024-09-29 09:55:34 +08:00
parent a18dabeaeb
commit bcdcc1cc47
2 changed files with 10 additions and 1 deletions

9
common/id.go Normal file
View File

@ -0,0 +1,9 @@
package common
import "github.com/bwmarrin/snowflake"
var IdNode, _ = snowflake.NewNode(int64(GetSelfSrvId()))
func GetId() int64 {
return IdNode.Generate().Int64()
}

View File

@ -20,7 +20,7 @@ import (
)
func getSortId() int64 {
return time.Now().UnixMilli()
return common.GetId()
}
type TmPlayer struct {