29 lines
602 B
Go
29 lines
602 B
Go
|
package mockpro
|
||
|
|
||
|
import (
|
||
|
internalGlobal "admin/apps/mockpro/internal/global"
|
||
|
"admin/apps/mockpro/server"
|
||
|
"admin/apps/mockpro/service"
|
||
|
"admin/internal/global"
|
||
|
"admin/lib/node"
|
||
|
)
|
||
|
|
||
|
func initFun(app *node.Application) error {
|
||
|
internalGlobal.GLOB_DB = global.GLOB_DB
|
||
|
svc := service.New(global.GLOB_DB)
|
||
|
server.New(svc) // 初始化http服务
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func New() *node.ApplicationDescInfo {
|
||
|
app := node.NewApplicationDescInfo("mock_project", initFun).
|
||
|
WithOptions(node.WithAppBootFlag(internalGlobal.GLOB_BOOT_FLAGS))
|
||
|
return app
|
||
|
}
|
||
|
|
||
|
func must(err error) {
|
||
|
if err != nil {
|
||
|
panic(err)
|
||
|
}
|
||
|
}
|