uniugm/admin/apps/game/boot.go
2025-04-22 15:46:48 +08:00

27 lines
531 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 := service.New(global.GLOB_DB) // 初始化应用服务
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)
}
}