package hero_section import ( "web-qudo-be/app/module/hero_section/controller" "web-qudo-be/app/module/hero_section/repository" "web-qudo-be/app/module/hero_section/service" "github.com/gofiber/fiber/v2" "go.uber.org/fx" ) type HeroSectionRouter struct { App fiber.Router Controller *controller.Controller } var NewHeroSectionModule = fx.Options( fx.Provide(repository.NewHeroSectionRepository), fx.Provide(service.NewHeroSectionService), fx.Provide(controller.NewController), fx.Provide(NewHeroSectionRouter), ) func NewHeroSectionRouter(fiber *fiber.App, controller *controller.Controller) *HeroSectionRouter { return &HeroSectionRouter{ App: fiber, Controller: controller, } } func (_i *HeroSectionRouter) RegisterHeroSectionRoutes() { heroController := _i.Controller.HeroSection _i.App.Route("/hero-section", func(router fiber.Router) { router.Get("/", heroController.Get) router.Post("/", heroController.Create) router.Put("/:id", heroController.Update) router.Delete("/:id", heroController.Delete) }) }