add static route module

This commit is contained in:
yanghao05
2023-01-30 19:33:24 +08:00
parent 2553252049
commit 591543d2a8
6 changed files with 35 additions and 1 deletions

0
modules/resources/.keep Normal file
View File

View File

@@ -0,0 +1,15 @@
package container
import (
"atom/container"
"atom/modules/resources/routes"
"log"
"go.uber.org/dig"
)
func init() {
if err := container.Container.Provide(routes.NewRoute, dig.Group("route")); err != nil {
log.Fatal(err)
}
}

View File

@@ -0,0 +1,18 @@
package routes
import (
"atom/contracts"
"atom/providers/http"
)
type Route struct {
svc *http.Service
}
func NewRoute(svc *http.Service) contracts.Route {
return &Route{svc: svc}
}
func (r *Route) Register() {
// r.svc.Engine.Static("/resources/form-generator", "./resources/form-generator")
}