update http
This commit is contained in:
@@ -7,7 +7,9 @@ import (
|
||||
"quyun/v2/app/commands"
|
||||
"quyun/v2/app/errorx"
|
||||
"quyun/v2/app/http/super"
|
||||
"quyun/v2/app/http/tenant"
|
||||
"quyun/v2/app/jobs"
|
||||
"quyun/v2/app/middlewares"
|
||||
"quyun/v2/app/services"
|
||||
"quyun/v2/database"
|
||||
_ "quyun/v2/docs"
|
||||
@@ -48,7 +50,9 @@ func Command() atom.Option {
|
||||
With(
|
||||
jobs.Provide,
|
||||
services.Provide,
|
||||
middlewares.Provide,
|
||||
super.Provide,
|
||||
tenant.Provide,
|
||||
// {Provider: api.Provide},
|
||||
// {Provider: web.Provide},
|
||||
),
|
||||
@@ -81,9 +85,9 @@ func Serve(cmd *cobra.Command, args []string) error {
|
||||
Data: []byte{},
|
||||
}))
|
||||
|
||||
rootGroup := svc.Http.Engine.Group("")
|
||||
for _, route := range svc.Routes {
|
||||
route.Register(rootGroup)
|
||||
group := svc.Http.Engine.Group(route.Path(), route.Middlewares()...).Name(route.Name())
|
||||
route.Register(group)
|
||||
}
|
||||
|
||||
return svc.Http.Serve(ctx)
|
||||
|
||||
Reference in New Issue
Block a user