package controller

import (
	"opencatd-open/internal/service"
	"opencatd-open/pkg/config"

	"gorm.io/gorm"
)

type Api struct {
	cfg            *config.Config
	db             *gorm.DB
	userService    *service.UserServiceImpl
	tokenService   *service.TokenServiceImpl
	keyService     *service.ApiKeyServiceImpl
	webAuthService *service.WebAuthnService
	usageService   *service.UsageService
}

func NewApi(cfg *config.Config, db *gorm.DB, userService *service.UserServiceImpl, tokenService *service.TokenServiceImpl, keyService *service.ApiKeyServiceImpl, webAuthService *service.WebAuthnService, usageService *service.UsageService) *Api {
	return &Api{
		cfg:            cfg,
		db:             db,
		userService:    userService,
		tokenService:   tokenService,
		keyService:     keyService,
		webAuthService: webAuthService,
		usageService:   usageService,
	}
}
