feat 改名

This commit is contained in:
2025-12-15 11:29:27 +08:00
parent f511364984
commit 4983638c19
27 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package app
import (
"common/log"
"common/utils"
"gateway/config"
"math/rand"
)
// ModuleBase 基础模块,或者一些零散的模块
type ModuleBase struct {
}
func (p *ModuleBase) Init() error {
// 配置
if err := config.LoadConfig(); err != nil {
return err
}
cfg := config.Get()
// 日志
log.Init(cfg.Log.Debug, cfg.Log.MaxSize, cfg.Log.MaxBackups, cfg.Log.MaxAge, cfg.Log.Level)
// 雪花
utils.InitSnowflake(int64(rand.Intn(1000)))
return nil
}
func (p *ModuleBase) Start() error {
return nil
}
func (p *ModuleBase) Stop() error {
return nil
}