This repository has been archived on 2026-01-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Game/Server/gatewaytt/handler/http_handler/unique_id.go

17 lines
339 B
Go

package http_handler
import (
"common/utils"
"gateway/handler/http_handler/helper/render"
"github.com/gin-gonic/gin"
)
type UniqueIDResp struct {
ID string `json:"id"`
}
// GenSnowflake 生成雪花ID
func GenSnowflake(c *gin.Context) {
render.Json(c, render.OK, &UniqueIDResp{ID: utils.SnowflakeInstance().Generate().String()})
}