package taskcenter

import (
	"bindbox-game/internal/pkg/logger"
	"bindbox-game/internal/repository/mysql"
	"bindbox-game/internal/repository/mysql/dao"
	tasksvc "bindbox-game/internal/service/task_center"
)

type handler struct {
	logger  logger.CustomLogger
	writeDB *dao.Query
	readDB  *dao.Query
	repo    mysql.Repo
	task    tasksvc.Service
}

func New(l logger.CustomLogger, db mysql.Repo, taskSvc tasksvc.Service) *handler {
	return &handler{
		logger:  l,
		writeDB: dao.Use(db.GetDbW()),
		readDB:  dao.Use(db.GetDbR()),
		repo:    db,
		task:    taskSvc,
	}
}

func (h *handler) GetTaskService() tasksvc.Service {
	return h.task
}
