package common

import (
	"bindbox-game/internal/pkg/logger"
	"bindbox-game/internal/repository/mysql"
	"bindbox-game/internal/repository/mysql/dao"
	commonsvc "bindbox-game/internal/service/common"
)

type handler struct {
	logger  logger.CustomLogger
	writeDB *dao.Query
	readDB  *dao.Query
	svc     commonsvc.Service
}

func New(l logger.CustomLogger, db mysql.Repo) *handler {
	return &handler{
		logger:  l,
		writeDB: dao.Use(db.GetDbW()),
		readDB:  dao.Use(db.GetDbR()),
		svc:     commonsvc.New(),
	}
}
