修复比赛场id重复问题
This commit is contained in:
parent
a18dabeaeb
commit
bcdcc1cc47
|
@ -0,0 +1,9 @@
|
||||||
|
package common
|
||||||
|
|
||||||
|
import "github.com/bwmarrin/snowflake"
|
||||||
|
|
||||||
|
var IdNode, _ = snowflake.NewNode(int64(GetSelfSrvId()))
|
||||||
|
|
||||||
|
func GetId() int64 {
|
||||||
|
return IdNode.Generate().Int64()
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func getSortId() int64 {
|
func getSortId() int64 {
|
||||||
return time.Now().UnixMilli()
|
return common.GetId()
|
||||||
}
|
}
|
||||||
|
|
||||||
type TmPlayer struct {
|
type TmPlayer struct {
|
||||||
|
|
Loading…
Reference in New Issue