2023-12-03 03:47:23 +08:00
|
|
|
package controller
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/divyam234/teldrive/pkg/database"
|
|
|
|
"github.com/divyam234/teldrive/pkg/services"
|
2023-12-17 21:05:36 +08:00
|
|
|
"go.uber.org/zap"
|
2023-12-03 03:47:23 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
type Controller struct {
|
|
|
|
FileService *services.FileService
|
|
|
|
UserService *services.UserService
|
|
|
|
UploadService *services.UploadService
|
|
|
|
AuthService *services.AuthService
|
|
|
|
}
|
|
|
|
|
2023-12-17 21:05:36 +08:00
|
|
|
func NewController(logger *zap.Logger) *Controller {
|
2023-12-03 03:47:23 +08:00
|
|
|
return &Controller{
|
2023-12-17 21:05:36 +08:00
|
|
|
FileService: services.NewFileService(database.DB, logger),
|
|
|
|
UserService: services.NewUserService(database.DB, logger),
|
|
|
|
UploadService: services.NewUploadService(database.DB, logger),
|
|
|
|
AuthService: services.NewAuthService(database.DB, logger),
|
2023-12-03 03:47:23 +08:00
|
|
|
}
|
|
|
|
}
|