package message

import (
	"mini-chat/internal/pkg/logger"
	"mini-chat/internal/repository/mysql"
	"mini-chat/internal/repository/mysql/dao"
)

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

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