29 lines
1.0 KiB
Go
29 lines
1.0 KiB
Go
// Code generated by Wire. DO NOT EDIT.
|
|
|
|
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
|
|
//go:build !wireinject
|
|
// +build !wireinject
|
|
|
|
package wire
|
|
|
|
import (
|
|
"github.com/dungnt11/todoms_golang/internal/controllers"
|
|
"github.com/dungnt11/todoms_golang/internal/repositories"
|
|
"github.com/dungnt11/todoms_golang/internal/services"
|
|
)
|
|
|
|
// Injectors from injector.go:
|
|
|
|
// InitializeControllers khởi tạo tất cả các controllers
|
|
func InitializeControllers() (*controllers.Controllers, error) {
|
|
db := ProvideDB()
|
|
userRepository := repositories.NewUserRepository(db)
|
|
userService := services.NewUserService(userRepository)
|
|
userController := controllers.NewUserController(userService)
|
|
productRepository := repositories.NewProductRepository(db)
|
|
productService := services.NewProductService(productRepository)
|
|
productController := controllers.NewProductController(productService)
|
|
controllersControllers := controllers.NewControllers(userController, productController)
|
|
return controllersControllers, nil
|
|
}
|