将go Httpserver.Run() 挪到 routeregister方法

This commit is contained in:
Cold
2025-12-19 17:57:46 +08:00
committed by 张斌
parent 5d22d07a3b
commit 2a31e3faac
2 changed files with 13 additions and 13 deletions

View File

@@ -44,7 +44,6 @@ func init() {
Httpserver.SetOpenApiPath("/api.json")
Httpserver.SetDumpRouterMap(true) //关闭打印路由注册信息
Httpserver.BindMiddlewareDefault(ghttp.MiddlewareHandlerResponse)
go Httpserver.Run()
Httpclient.SetDiscovery(gsvc.GetRegistry())
}
func RouteRegister(controllers []interface{}) {
@@ -59,6 +58,7 @@ func RouteRegister(controllers []interface{}) {
group.Bind(t)
})
}
go Httpserver.Run()
}
func doRequest(ctx context.Context, method string, url string, target any, data ...any) (err error) {
err = utils.ValidStructPtr(target)