// 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 main

import (
	"github.com/go-kratos/kratos/v3"
	integration3 "kra/internal/biz/integration"
	payment3 "kra/internal/biz/payment"
	system2 "kra/internal/biz/system"
	task2 "kra/internal/biz/task"
	"kra/internal/config"
	"kra/internal/data"
	"kra/internal/data/integration"
	payment2 "kra/internal/data/payment"
	"kra/internal/data/system"
	"kra/internal/data/task"
	"kra/internal/initialize"
	integration2 "kra/internal/integration"
	"kra/internal/integration/cache"
	"kra/internal/integration/email"
	"kra/internal/integration/mq"
	"kra/internal/integration/payment"
	"kra/internal/integration/storage"
	"kra/internal/integration/systeminfo"
	"kra/internal/integration/websocket"
	"kra/internal/logging"
	"kra/internal/modules"
	"kra/internal/server"
	"kra/internal/server/handler"
	"kra/internal/server/router"
	integration4 "kra/internal/service/integration"
	payment4 "kra/internal/service/payment"
	system3 "kra/internal/service/system"
	task3 "kra/internal/service/task"
	"kra/internal/worker"
	"log/slog"
)

import (
	_ "go.uber.org/automaxprocs"
)

// Injectors from wire.go:

// wireApp init kratos application.
func wireApp(configServer *config.Server, store *config.Store, logger *slog.Logger, reloadableLogger *logging.ReloadableLogger, string2 string) (*kratos.App, func(), error) {
	reloadable, err := storage.NewFileStorage(store)
	if err != nil {
		return nil, nil, err
	}
	catalog := modules.Catalog()
	dataData, cleanup, err := data.NewData(store, logger, reloadable, catalog)
	if err != nil {
		return nil, nil, err
	}
	authorityAccessRepo := system.NewAuthorityAccessRepo(dataData)
	apiRepo := system.NewAPIRepo(dataData)
	accessControlUsecase := system2.NewAccessControlUsecase(authorityAccessRepo, apiRepo)
	accessControlService := system3.NewAccessControlService(accessControlUsecase)
	userRepo := system.NewUserRepo(dataData)
	userUsecase := system2.NewUserUsecase(userRepo)
	securityRepo := system.NewSecurityRepo(dataData)
	systemCache := cache.New(dataData)
	runtimeSettings := system.NewRuntimeSettings(store)
	apiTokenRepo := system.NewAPITokenRepo(dataData)
	tokenUsecase := system2.NewTokenUsecase(apiTokenRepo)
	securityUsecase := system2.NewSecurityUsecase(securityRepo, systemCache, runtimeSettings, tokenUsecase)
	tokenIssuer := system.NewTokenIssuer(runtimeSettings)
	auditRecordRepo := system.NewAuditRecorderRepo(dataData)
	authenticationUsecase := system2.NewAuthenticationUsecase(userUsecase, securityUsecase, tokenIssuer, auditRecordRepo)
	authService := system3.NewAuthService(authenticationUsecase)
	securityService := system3.NewSecurityService(securityUsecase)
	auditRecorderUsecase := system2.NewAuditRecorderUsecase(auditRecordRepo)
	auditRecorder := system3.NewAuditRecorder(auditRecorderUsecase)
	registry := taskRegistry()
	authorityUsecase := system2.NewAuthorityUsecase(authorityAccessRepo)
	authorityService := system3.NewAuthorityService(authorityUsecase)
	authority := handler.NewAuthority(authorityService)
	menuRepo := system.NewMenuRepo(dataData)
	menuUsecase := system2.NewMenuUsecase(menuRepo)
	menuService := system3.NewMenuService(menuUsecase)
	menu := handler.NewMenu(menuService)
	apiUsecase := system2.NewAPIUsecase(apiRepo)
	apiService := system3.NewAPIService(apiUsecase, runtimeSettings)
	api := handler.NewAPI(apiService)
	permissionRepo := system.NewPermissionRepo(dataData)
	permissionUsecase := system2.NewPermissionUsecase(permissionRepo)
	permissionService := system3.NewPermissionService(permissionUsecase)
	permission := handler.NewPermission(permissionService)
	departmentRepo := system.NewDepartmentRepo(dataData)
	departmentUsecase := system2.NewDepartmentUsecase(departmentRepo)
	departmentService := system3.NewDepartmentService(departmentUsecase)
	positionRepo := system.NewPositionRepo(dataData)
	positionUsecase := system2.NewPositionUsecase(positionRepo)
	positionService := system3.NewPositionService(positionUsecase)
	organization := handler.NewOrganization(departmentService, positionService)
	announcementRepo := system.NewAnnouncementRepo(dataData)
	announcementUsecase := system2.NewAnnouncementUsecase(announcementRepo)
	announcementService := system3.NewAnnouncementService(announcementUsecase)
	announcement := handler.NewAnnouncement(announcementService)
	emailRepo := email.NewEmailRepo(store)
	emailUsecase := system2.NewEmailUsecase(emailRepo)
	emailService := system3.NewEmailService(emailUsecase)
	handlerEmail := handler.NewEmail(emailService)
	paymentConfigReader := integration.NewPaymentConfigReader(dataData)
	factory := payment.NewFactory()
	paymentOrderRepo := payment2.NewPaymentOrderRepo(dataData)
	paymentRepo := payment2.NewPaymentRepo(dataData, paymentConfigReader, factory, paymentOrderRepo)
	paymentHooks := payment3.NewPaymentHooks()
	paymentOrderSourceRegistry := payment3.NewPaymentOrderSourceRegistry()
	paymentFulfillmentRegistry := payment3.NewPaymentFulfillmentRegistry()
	paymentUsecase := payment3.NewPaymentUsecase(paymentRepo, paymentOrderRepo, paymentHooks, paymentOrderSourceRegistry, paymentFulfillmentRegistry, logger)
	paymentService := payment4.NewPaymentService(paymentUsecase)
	handlerPayment := handler.NewPayment(paymentService)
	taskRepo := task.NewTaskRepo(dataData)
	taskUsecase := task2.NewTaskUsecaseWithRegistry(taskRepo, registry)
	taskExecutor := worker.NewTaskExecutorWithRegistry(taskUsecase, registry)
	taskScheduler := worker.NewTaskScheduler(taskUsecase, authorityUsecase, taskExecutor, logger)
	taskRuntime := worker.NewTaskRuntime(taskScheduler)
	taskApplicationUsecase := task2.NewTaskApplicationUsecase(taskUsecase, taskRuntime)
	taskService := task3.NewTaskService(taskApplicationUsecase)
	handlerTask := handler.NewTask(taskService)
	mediaRepo := system.NewMediaRepo(dataData)
	mediaUsecase := system2.NewMediaUsecase(mediaRepo, reloadable, runtimeSettings)
	mediaService := system3.NewMediaService(mediaUsecase, runtimeSettings)
	media := handler.NewMedia(mediaService)
	auditQueryRepo := system.NewAuditRepo(dataData)
	auditUsecase := system2.NewAuditUsecase(auditQueryRepo)
	auditService := system3.NewAuditService(auditUsecase)
	logFileRepo := system.NewLogFileRepo(dataData)
	logViewerUsecase := system2.NewLogViewerUsecase(logFileRepo)
	logViewerService := system3.NewLogViewerService(logViewerUsecase)
	audit := handler.NewAudit(auditService, auditRecorder, logViewerService, logger)
	exportRepo := system.NewExportRepo(dataData)
	exportUsecase := system2.NewExportUsecase(exportRepo)
	exportService := system3.NewExportService(exportUsecase, systemCache)
	export := handler.NewExport(exportService)
	versionRepo := system.NewVersionRepo(dataData)
	versionUsecase := system2.NewVersionUsecase(versionRepo)
	versionService := system3.NewVersionService(versionUsecase)
	version := handler.NewVersion(versionService)
	dictionaryRepo := system.NewDictionaryRepo(dataData)
	dictionaryUsecase := system2.NewDictionaryUsecase(dictionaryRepo)
	dictionaryService := system3.NewDictionaryService(dictionaryUsecase)
	dictionary := handler.NewDictionary(dictionaryService)
	parameterRepo := system.NewParameterRepo(dataData)
	parameterUsecase := system2.NewParameterUsecase(parameterRepo)
	parameterService := system3.NewParameterService(parameterUsecase)
	parameter := handler.NewParameter(parameterService)
	tokenService := system3.NewTokenService(tokenUsecase, tokenIssuer)
	apiToken := handler.NewAPIToken(tokenService)
	initializationRepo := initialize.NewRepo(dataData, catalog)
	taskReloader := worker.NewTaskReloader(taskScheduler)
	provider := systeminfo.NewProvider()
	systemConfigUsecase := system2.NewSystemConfigUsecase(initializationRepo, taskReloader, provider)
	systemConfigService := system3.NewSystemConfigService(systemConfigUsecase, runtimeSettings)
	systemConfig := handler.NewSystemConfig(systemConfigService, securityService)
	public := handler.NewPublic(authService, systemConfigService, securityService)
	userService := system3.NewUserService(userUsecase, securityService)
	user := handler.NewUser(userService, authService)
	navigation := handler.NewNavigation(userService)
	session := handler.NewSession(tokenService)
	integrationConfigRepo := integration.NewIntegrationConfigRepo(dataData)
	runtimeconfigStore := data.NewIntegrationRuntime(dataData)
	connectivityTester := integration2.NewConnectivityTester(runtimeconfigStore)
	integrationConfigUsecase := integration3.NewIntegrationConfigUsecase(integrationConfigRepo, connectivityTester)
	integrationConfigService := integration4.NewIntegrationConfigService(integrationConfigUsecase)
	integrationConfig := handler.NewIntegrationConfig(integrationConfigService)
	set := &handler.Set{
		Authority:         authority,
		Menu:              menu,
		API:               api,
		Permission:        permission,
		Organization:      organization,
		Announcement:      announcement,
		Email:             handlerEmail,
		Payment:           handlerPayment,
		Task:              handlerTask,
		Media:             media,
		Audit:             audit,
		Export:            export,
		Version:           version,
		Dictionary:        dictionary,
		Parameter:         parameter,
		APIToken:          apiToken,
		SystemConfig:      systemConfig,
		Public:            public,
		User:              user,
		Navigation:        navigation,
		Session:           session,
		IntegrationConfig: integrationConfig,
	}
	routes := router.NewRoutes(set)
	maintenanceRepo := system.NewMaintenanceRepo(dataData)
	maintenanceUsecase := system2.NewMaintenanceUsecase(maintenanceRepo)
	taskMethods := worker.NewTaskMethods(taskUsecase, maintenanceUsecase, mediaUsecase, store)
	routeRegistrar := buildRuntime(registry, routes, taskMethods)
	websocketServer, cleanup2, err := websocket.New(runtimeconfigStore)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	engine := server.NewGinEngineWithRuntime(store, accessControlService, authService, securityService, auditRecorder, logger, string2, routeRegistrar, websocketServer)
	httpServer := server.NewGinServer(configServer, engine)
	mqReloadable, cleanup3, err := mq.New(runtimeconfigStore, logger)
	if err != nil {
		cleanup2()
		cleanup()
		return nil, nil, err
	}
	app := newApp(logger, httpServer, taskScheduler, auditRecorder, reloadableLogger, mqReloadable)
	return app, func() {
		cleanup3()
		cleanup2()
		cleanup()
	}, nil
}
