restructure

This commit is contained in:
yanghao05
2023-04-20 12:11:34 +08:00
parent 6757e00d73
commit 5b8eca5d87
120 changed files with 546 additions and 7303 deletions

24
services/http.go Normal file
View File

@@ -0,0 +1,24 @@
package http
import (
"github.com/rogeecn/atom/container"
"github.com/rogeecn/atom/providers/http"
"go.uber.org/dig"
)
type Http struct {
dig.In
Service http.Service
Routes []http.Route `group:"route"`
}
func ServeHttp() error {
return container.Container.Invoke(func(http Http) error {
for _, route := range http.Routes {
route.Register()
}
return http.Service.Serve()
})
}