feat app 模块

This commit is contained in:
2026-01-16 22:07:09 +08:00
parent 05f6e0a716
commit 93c0d20eba
6 changed files with 243 additions and 102 deletions

View File

@@ -2,6 +2,7 @@ package app
import (
"git.hlsq.asia/mmorpg/service-common/log"
"git.hlsq.asia/mmorpg/service-common/module"
"git.hlsq.asia/mmorpg/service-common/utils"
"git.hlsq.asia/mmorpg/service-robot/config"
"math/rand"
@@ -11,7 +12,7 @@ import (
type ModuleBase struct {
}
func (p *ModuleBase) init() error {
func (m *ModuleBase) Init() error {
// 配置
if err := config.LoadConfig(); err != nil {
return err
@@ -24,10 +25,14 @@ func (p *ModuleBase) init() error {
return nil
}
func (p *ModuleBase) start() error {
func (m *ModuleBase) Start() error {
return nil
}
func (p *ModuleBase) stop() error {
func (m *ModuleBase) Stop() error {
return nil
}
func (m *ModuleBase) Bind(_ ...any) module.Module {
return m
}