refactor: Clean up unused imports and update service/controller references in core.go
This commit is contained in:
parent
8481397014
commit
8789d2c72b
|
|
@ -4,12 +4,14 @@ import (
|
||||||
"github.com/Caknoooo/go-gin-clean-starter/config"
|
"github.com/Caknoooo/go-gin-clean-starter/config"
|
||||||
authRepo "github.com/Caknoooo/go-gin-clean-starter/modules/auth/repository"
|
authRepo "github.com/Caknoooo/go-gin-clean-starter/modules/auth/repository"
|
||||||
"github.com/Caknoooo/go-gin-clean-starter/modules/auth/service"
|
"github.com/Caknoooo/go-gin-clean-starter/modules/auth/service"
|
||||||
productController "github.com/Caknoooo/go-gin-clean-starter/modules/product/controller"
|
|
||||||
productRepo "github.com/Caknoooo/go-gin-clean-starter/modules/product/repository"
|
// productController "github.com/Caknoooo/go-gin-clean-starter/modules/product/controller"
|
||||||
productService "github.com/Caknoooo/go-gin-clean-starter/modules/product/service"
|
// productRepo "github.com/Caknoooo/go-gin-clean-starter/modules/product/repository"
|
||||||
tenantController "github.com/Caknoooo/go-gin-clean-starter/modules/tenant/controller"
|
// productService "github.com/Caknoooo/go-gin-clean-starter/modules/product/service"
|
||||||
tenantRepo "github.com/Caknoooo/go-gin-clean-starter/modules/tenant/repository"
|
logsController "github.com/Caknoooo/go-gin-clean-starter/modules/logs/controller"
|
||||||
tenantService "github.com/Caknoooo/go-gin-clean-starter/modules/tenant/service"
|
roleController "github.com/Caknoooo/go-gin-clean-starter/modules/role/controller"
|
||||||
|
roleRepo "github.com/Caknoooo/go-gin-clean-starter/modules/role/repository"
|
||||||
|
roleService "github.com/Caknoooo/go-gin-clean-starter/modules/role/service"
|
||||||
"github.com/Caknoooo/go-gin-clean-starter/modules/user/controller"
|
"github.com/Caknoooo/go-gin-clean-starter/modules/user/controller"
|
||||||
"github.com/Caknoooo/go-gin-clean-starter/modules/user/repository"
|
"github.com/Caknoooo/go-gin-clean-starter/modules/user/repository"
|
||||||
userService "github.com/Caknoooo/go-gin-clean-starter/modules/user/service"
|
userService "github.com/Caknoooo/go-gin-clean-starter/modules/user/service"
|
||||||
|
|
@ -37,29 +39,39 @@ func RegisterDependencies(injector *do.Injector) {
|
||||||
|
|
||||||
// Repository
|
// Repository
|
||||||
userRepository := repository.NewUserRepository(db)
|
userRepository := repository.NewUserRepository(db)
|
||||||
tenantRepository := tenantRepo.NewTenantRepository(db)
|
|
||||||
refreshTokenRepository := authRepo.NewRefreshTokenRepository(db)
|
refreshTokenRepository := authRepo.NewRefreshTokenRepository(db)
|
||||||
productRepository := productRepo.NewProductRepository(db)
|
// productRepository := productRepo.NewProductRepository(db)
|
||||||
|
roleRepository := roleRepo.NewRoleRepository(db)
|
||||||
|
|
||||||
// Service
|
// Service
|
||||||
userService := userService.NewUserService(userRepository, refreshTokenRepository, jwtService, db)
|
userServ := userService.NewUserService(userRepository, refreshTokenRepository, jwtService, db)
|
||||||
tenantService := tenantService.NewTenantService(tenantRepository, db)
|
// productService := productService.NewProductService(productRepository, db)
|
||||||
productService := productService.NewProductService(productRepository, db)
|
roleService := roleService.NewRoleService(roleRepository, refreshTokenRepository, jwtService, db)
|
||||||
|
|
||||||
// Controller
|
// Controller
|
||||||
do.Provide(
|
do.Provide(
|
||||||
injector, func(i *do.Injector) (controller.UserController, error) {
|
injector, func(i *do.Injector) (controller.UserController, error) {
|
||||||
return controller.NewUserController(i, userService), nil
|
return controller.NewUserController(i, userServ), nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
do.Provide(
|
do.Provide(
|
||||||
injector, func(i *do.Injector) (tenantController.TenantController, error) {
|
injector, func(i *do.Injector) (userService.UserService, error) {
|
||||||
return tenantController.NewTenantController(i, tenantService), nil
|
return userServ, nil
|
||||||
|
},
|
||||||
|
)
|
||||||
|
// do.Provide(
|
||||||
|
// injector, func(i *do.Injector) (productController.ProductController, error) {
|
||||||
|
// return productController.NewProductController(i, productService), nil
|
||||||
|
// },
|
||||||
|
// )
|
||||||
|
do.Provide(
|
||||||
|
injector, func(i *do.Injector) (roleController.RoleController, error) {
|
||||||
|
return roleController.NewRoleController(i, roleService), nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
do.Provide(
|
do.Provide(
|
||||||
injector, func(i *do.Injector) (productController.ProductController, error) {
|
injector, func(i *do.Injector) (logsController.LogsController, error) {
|
||||||
return productController.NewProductController(i, productService), nil
|
return logsController.NewLogsController(i), nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue