feat 模块删除bind函数

This commit is contained in:
2026-02-06 22:51:47 +08:00
parent 44ebbe4449
commit 5a0f4b71d4
6 changed files with 22 additions and 83 deletions

View File

@@ -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
}