feat 废弃jwt

This commit is contained in:
2026-02-06 22:22:43 +08:00
parent 5dc5391b07
commit 44ebbe4449
7 changed files with 756 additions and 123 deletions

32
module/base.go Normal file
View File

@@ -0,0 +1,32 @@
package module
import (
"git.hlsq.asia/mmorpg/service-common/config"
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/utils"
"math/rand"
)
// Base 基础模块
type Base struct {
DefaultModule
log *config.LogConfig
}
func (m *Base) Init() error {
// 日志
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
}