feat 模块删除bind函数
This commit is contained in:
@@ -10,23 +10,13 @@ import (
|
||||
// Base 基础模块
|
||||
type Base struct {
|
||||
DefaultModule
|
||||
log *config.LogConfig
|
||||
Log *config.LogConfig
|
||||
}
|
||||
|
||||
func (m *Base) Init() error {
|
||||
// 日志
|
||||
log.Init(m.log)
|
||||
log.Init(m.Log)
|
||||
// 雪花
|
||||
utils.InitSnowflake(int64(rand.Intn(1000)))
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Base) Bind(data ...any) Module {
|
||||
if data == nil || len(data) == 0 {
|
||||
return m
|
||||
}
|
||||
if l, ok := data[0].(*config.LogConfig); ok {
|
||||
m.log = l
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user