1 Star 0 Fork 0

cherryRed/distributeid

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
servicecontext.go 461 Bytes
Copy Edit Raw Blame History
chenyi authored 2023-10-22 20:54 . mod log level
package svc
import (
"gitee.com/cherryred/distributeid/internal/common/snowflake"
"gitee.com/cherryred/distributeid/internal/config"
"github.com/zeromicro/go-zero/core/logx"
)
type ServiceContext struct {
Config config.Config
Distributor *snowflake.Snowflake
}
func NewServiceContext(c config.Config) *ServiceContext {
logx.SetLevel(logx.DebugLevel)
return &ServiceContext{
Config: c,
Distributor: snowflake.NewSnowflake(c.NodeId),
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cherryred/distributeid.git
git@gitee.com:cherryred/distributeid.git
cherryred
distributeid
distributeid
a4da07ae73f4

Search