41 lines
900 B
Go
41 lines
900 B
Go
|
package initialize
|
||
|
|
||
|
import (
|
||
|
"github.com/go-redis/redis/v8"
|
||
|
"github.com/themakers/hlog"
|
||
|
"go.uber.org/zap"
|
||
|
"gopkg.in/telebot.v3"
|
||
|
"heruvym/internal/controllers/other"
|
||
|
"heruvym/internal/controllers/tickets"
|
||
|
)
|
||
|
|
||
|
type ControllersDeps struct {
|
||
|
Reps *Repositories
|
||
|
RedisClient *redis.Client
|
||
|
Notifier *telebot.Bot
|
||
|
TgChatID int64
|
||
|
HLogger hlog.Logger
|
||
|
ZapLogger *zap.Logger
|
||
|
}
|
||
|
|
||
|
type Controllers struct {
|
||
|
Tickets *tickets.TicketController
|
||
|
Other *other.OtherController
|
||
|
}
|
||
|
|
||
|
func NewControllers(deps ControllersDeps) *Controllers {
|
||
|
return &Controllers{
|
||
|
Tickets: tickets.NewTicketController(tickets.Deps{
|
||
|
Dal: deps.Reps.Mongo,
|
||
|
Notifier: deps.Notifier,
|
||
|
TgChatID: deps.TgChatID,
|
||
|
ZapLogger: deps.ZapLogger,
|
||
|
HLogger: deps.HLogger,
|
||
|
}),
|
||
|
Other: other.NewOtherController(other.Deps{
|
||
|
Dal: deps.Reps.Mongo,
|
||
|
RedisClient: deps.RedisClient,
|
||
|
}),
|
||
|
}
|
||
|
}
|