//go:build wireinject
// +build wireinject

// The build tag makes sure the stub is not built in the final build.

package main

import (
	"log/slog"

	"kra/internal/conf"
	"kra/internal/logging"
	"kra/internal/modules/system/biz"
	"kra/internal/modules/system/data"
	"kra/internal/modules/system/initialize"
	"kra/internal/modules/system/integration"
	"kra/internal/modules/system/integration/cache"
	"kra/internal/modules/system/service"
	"kra/internal/modules/system/transport/server"
	"kra/internal/modules/system/worker"

	"github.com/go-kratos/kratos/v3"
	"github.com/google/wire"
)

// wireApp init kratos application.
func wireApp(*conf.Server, *conf.Runtime, *slog.Logger, *logging.ReloadableLogger, string) (*kratos.App, func(), error) {
	panic(wire.Build(
		server.ProviderSet,
		worker.ProviderSet,
		data.ProviderSet,
		integration.ProviderSet,
		initialize.ProviderSet,
		wire.Bind(new(initialize.Backend), new(*data.Data)),
		wire.Bind(new(cache.RedisProvider), new(*data.Data)),
		biz.ProviderSet,
		service.ProviderSet,
		newApp,
	))
}
