uniugm/admin/apps/game/boot.go
2025-04-24 20:39:31 +08:00

30 lines
567 B
Go

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