From 6b3981c3bc1c3fcc8d0a76094ea251a8b22e46bc Mon Sep 17 00:00:00 2001 From: Rogee Date: Wed, 17 Dec 2025 23:43:55 +0800 Subject: [PATCH] feat: modify http --- templates/project/app/commands/http/http.go.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/project/app/commands/http/http.go.tpl b/templates/project/app/commands/http/http.go.tpl index ee8290a..4640352 100644 --- a/templates/project/app/commands/http/http.go.tpl +++ b/templates/project/app/commands/http/http.go.tpl @@ -9,6 +9,7 @@ import ( "{{.ModuleName}}/app/commands" "{{.ModuleName}}/app/errorx" "{{.ModuleName}}/app/jobs" + "{{.ModuleName}}/app/middlewares" _ "{{.ModuleName}}/docs" "{{.ModuleName}}/providers/app" "{{.ModuleName}}/providers/http" @@ -40,6 +41,7 @@ func Command() atom.Option { atom.Providers( defaultProviders(). With( + middlewares.Provide, jobs.Provide, ), ), @@ -70,8 +72,8 @@ func Serve(cmd *cobra.Command, args []string) error { Data: []byte{}, })) - group := svc.Http.Engine.Group("") for _, route := range svc.Routes { + group := svc.Http.Engine.Group(route.Path(), route.Middlewares()...).Name(route.Name()) route.Register(group) }