uniugm/admin/apps/game/boot.go

27 lines
531 B
Go
Raw Normal View History

2025-04-18 17:17:23 +08:00
package game
import (
"admin/apps/game/server"
"admin/apps/game/service"
"admin/internal/global"
"admin/lib/node"
)
func initFun(app *node.Application) error {
2025-04-22 15:46:48 +08:00
svc := service.New(global.GLOB_DB) // 初始化应用服务
srv := server.New(svc) // 初始化http服务
srv.Route(global.GLOB_API_ENGINE) // 初始化http服务路由
2025-04-18 17:17:23 +08:00
return nil
}
func New() *node.ApplicationDescInfo {
2025-04-22 15:46:48 +08:00
app := node.NewApplicationDescInfo("game", initFun)
2025-04-18 17:17:23 +08:00
return app
}
func must(err error) {
if err != nil {
panic(err)
}
}