package wechat

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

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

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