//go:build wireinject
// +build wireinject

package main

import (
	"github.com/google/wire"
	"github.com/tidbcloud/ecosystem-service/api"
	"github.com/tidbcloud/ecosystem-service/config"
	"github.com/tidbcloud/ecosystem-service/internal/service/bigquery"
	"github.com/tidbcloud/ecosystem-service/internal/service/eventbus"
	"github.com/tidbcloud/ecosystem-service/internal/service/github"
	"github.com/tidbcloud/ecosystem-service/internal/service/grpc"
	vercelProxy "github.com/tidbcloud/ecosystem-service/internal/service/proxy/vercel"
	"github.com/tidbcloud/ecosystem-service/internal/storage/db"
	gitDB "github.com/tidbcloud/ecosystem-service/internal/storage/db/git"
	vercelDB "github.com/tidbcloud/ecosystem-service/internal/storage/db/vercel"
	"github.com/tidbcloud/ecosystem-service/internal/storage/migrate"
	"github.com/tidbcloud/ecosystem-service/internal/storage/migrate/record"
	"github.com/tidbcloud/ecosystem-service/internal/utils"
)

var providerSet = wire.NewSet(
	utils.InitLogger,
	utils.InitEncryptor,
	api.ControllerSet,
	api.JobSet,
	api.LogicSet,
	github.GitSet,
	vercelDB.VercelDAOSet,
	gitDB.GitDAOSet,
	grpc.GrpcProvider,
	bigquery.BigqueryProvider,
	db.InitializeDB,
	vercelProxy.NewAPIClient,
	config.InitConfig,
	record.InitRecorderExecutor,
	migrate.NewMigrator,
	eventbus.EventSet)

func initializeServer(configPath string) (*Server, error) {
	panic(wire.Build(providerSet, NewServer))
}
