// Code generated by Wire. DO NOT EDIT.

//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject

package app

import (
	"easyvqd/domain/version/versionapi"
	"easyvqd/internal/conf"
	"easyvqd/internal/core/host"
	"easyvqd/internal/core/media"
	"easyvqd/internal/core/vqdtask"
	"easyvqd/internal/data"
	"easyvqd/internal/web/api"
	"log/slog"
	"net/http"
)

// Injectors from wire.go:

func WireApp(bc *conf.Bootstrap, log *slog.Logger) (http.Handler, func(), error) {
	db, err := data.SetupDB(bc, log)
	if err != nil {
		return nil, nil, err
	}
	core := versionapi.NewVersionCore(db)
	versionapiAPI := versionapi.New(core)
	vqdTaskCore := api.NewVqdTaskCore(db)
	hostCore := host.NewCore(bc)
	mediaCore := media.NewCore(hostCore)
	vqdSdkCore := vqdtask.NewCore(hostCore, vqdTaskCore, bc)
	vqdTaskAPI := api.NewVqdTaskAPI(vqdTaskCore, mediaCore,vqdSdkCore,hostCore, bc)

	usecase := &api.Usecase{
		Conf:        bc,
		DB:          db,
		Version:     versionapiAPI,
		VqdTaskCore: vqdTaskCore,
		VqdTaskAPI:  vqdTaskAPI,
		HostCore:    hostCore,
		MediaCore:   mediaCore,
		VqdSdkCore:  vqdSdkCore,
	}
	handler := api.NewHTTPHandler(usecase)
	return handler, func() {
		vqdSdkCore.UnVqdTask()
	}, nil
}
