// 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"
	"kra/internal/app"
	integration3 "kra/internal/biz/integration"
	payment2 "kra/internal/biz/payment"
	system2 "kra/internal/biz/system"
	task2 "kra/internal/biz/task"
	"kra/internal/conf"
	"kra/internal/data"
	"kra/internal/data/integration"
	"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/storage"
	"kra/internal/integration/websocket"
	"kra/internal/modules"
	"kra/internal/server"
	"kra/internal/server/handler"
	"kra/internal/server/router"
	"kra/internal/service"
	"kra/internal/worker"
	"kra/pkg/logging"
	"log/slog"
)

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

// Injectors from wire.go:

// wireApp init kratos application.
func wireApp(confServer *conf.Server, runtime *conf.Runtime, logger *slog.Logger, reloadableLogger *logging.ReloadableLogger, string2 string) (*kratos.App, func(), error) {
	reloadable, err := storage.NewFileStorage(runtime)
	if err != nil {
		return nil, nil, err
	}
	catalog := modules.Catalog()
	dataData, cleanup, err := data.NewData(runtime, logger, reloadable, catalog)
	if err != nil {
		return nil, nil, err
	}
	authorityAccessRepo := system.NewAuthorityAccessRepo(dataData)
	apiRepo := system.NewAPIRepo(dataData)
	accessControlUsecase := system2.NewAccessControlUsecase(authorityAccessRepo, apiRepo)
	accessControlService := service.NewAccessControlService(accessControlUsecase)
	userRepo := system.NewUserRepo(dataData)
	userUsecase := system2.NewUserUsecase(userRepo)
	securityRepo := system.NewSecurityRepo(dataData)
	systemCache := cache.New(dataData)
	runtimeSettings := system.NewRuntimeSettings(runtime)
	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 := service.NewAuthService(authenticationUsecase)
	securityService := service.NewSecurityService(securityUsecase)
	auditRecorderUsecase := system2.NewAuditRecorderUsecase(auditRecordRepo)
	auditRecorder := service.NewAuditRecorder(auditRecorderUsecase)
	authorityUsecase := system2.NewAuthorityUsecase(authorityAccessRepo)
	authorityService := service.NewAuthorityService(authorityUsecase)
	authority := handler.NewAuthority(authorityService)
	menuRepo := system.NewMenuRepo(dataData)
	menuUsecase := system2.NewMenuUsecase(menuRepo)
	menuService := service.NewMenuService(menuUsecase)
	menu := handler.NewMenu(menuService)
	apiUsecase := system2.NewAPIUsecase(apiRepo)
	apiService := service.NewAPIService(apiUsecase, runtimeSettings)
	api := handler.NewAPI(apiService)
	permissionRepo := system.NewPermissionRepo(dataData)
	permissionUsecase := system2.NewPermissionUsecase(permissionRepo)
	permissionService := service.NewPermissionService(permissionUsecase)
	permission := handler.NewPermission(permissionService)
	departmentRepo := system.NewDepartmentRepo(dataData)
	departmentUsecase := system2.NewDepartmentUsecase(departmentRepo)
	departmentService := service.NewDepartmentService(departmentUsecase)
	positionRepo := system.NewPositionRepo(dataData)
	positionUsecase := system2.NewPositionUsecase(positionRepo)
	positionService := service.NewPositionService(positionUsecase)
	organization := handler.NewOrganization(departmentService, positionService)
	announcementRepo := system.NewAnnouncementRepo(dataData)
	announcementUsecase := system2.NewAnnouncementUsecase(announcementRepo)
	announcementService := service.NewAnnouncementService(announcementUsecase)
	announcement := handler.NewAnnouncement(announcementService)
	emailRepo := email.NewEmailRepo(runtime)
	emailUsecase := system2.NewEmailUsecase(emailRepo)
	emailService := service.NewEmailService(emailUsecase)
	handlerEmail := handler.NewEmail(emailService)
	paymentConfigReader := integration.NewPaymentConfigReader(dataData)
	paymentRepo := payment.NewPaymentRepo(dataData, paymentConfigReader)
	paymentOrderRepo := payment.NewPaymentOrderRepo(dataData)
	paymentUsecase := payment2.NewPaymentUsecase(paymentRepo, paymentOrderRepo, logger)
	paymentService := service.NewPaymentService(paymentUsecase)
	handlerPayment := handler.NewPayment(paymentService)
	taskRepo := task.NewTaskRepo(dataData)
	registry := app.TaskRegistry(catalog)
	taskUsecase := task2.NewTaskUsecaseWithRegistry(taskRepo, registry)
	mediaRepo := system.NewMediaRepo(dataData)
	mediaUsecase := system2.NewMediaUsecase(mediaRepo, reloadable, runtimeSettings)
	taskExecutor := worker.NewTaskExecutorWithRegistry(taskUsecase, mediaUsecase, runtime, registry)
	taskScheduler := worker.NewTaskScheduler(taskUsecase, authorityUsecase, taskExecutor, logger)
	taskRuntime := worker.NewTaskRuntime(taskScheduler)
	taskApplicationUsecase := task2.NewTaskApplicationUsecase(taskUsecase, taskRuntime)
	taskService := service.NewTaskService(taskApplicationUsecase)
	handlerTask := handler.NewTask(taskService)
	mediaService := service.NewMediaService(mediaUsecase, runtimeSettings)
	media := handler.NewMedia(mediaService)
	auditQueryRepo := system.NewAuditRepo(dataData)
	auditUsecase := system2.NewAuditUsecase(auditQueryRepo)
	auditService := service.NewAuditService(auditUsecase)
	logFileRepo := system.NewLogFileRepo(dataData)
	logViewerUsecase := system2.NewLogViewerUsecase(logFileRepo)
	logViewerService := service.NewLogViewerService(logViewerUsecase)
	audit := handler.NewAudit(auditService, auditRecorder, logViewerService, logger)
	exportRepo := system.NewExportRepo(dataData)
	exportUsecase := system2.NewExportUsecase(exportRepo)
	exportService := service.NewExportService(exportUsecase, systemCache)
	export := handler.NewExport(exportService)
	versionRepo := system.NewVersionRepo(dataData)
	versionUsecase := system2.NewVersionUsecase(versionRepo)
	versionService := service.NewVersionService(versionUsecase)
	version := handler.NewVersion(versionService)
	dictionaryRepo := system.NewDictionaryRepo(dataData)
	dictionaryUsecase := system2.NewDictionaryUsecase(dictionaryRepo)
	dictionaryService := service.NewDictionaryService(dictionaryUsecase)
	dictionary := handler.NewDictionary(dictionaryService)
	parameterRepo := system.NewParameterRepo(dataData)
	parameterUsecase := system2.NewParameterUsecase(parameterRepo)
	parameterService := service.NewParameterService(parameterUsecase)
	parameter := handler.NewParameter(parameterService)
	tokenService := service.NewTokenService(tokenUsecase, tokenIssuer)
	apiToken := handler.NewAPIToken(tokenService)
	initializationRepo := initialize.NewRepo(dataData, catalog)
	taskReloader := worker.NewTaskReloader(taskScheduler)
	systemConfigUsecase := system2.NewSystemConfigUsecase(initializationRepo, taskReloader)
	systemConfigService := service.NewSystemConfigService(systemConfigUsecase, runtimeSettings)
	systemConfig := handler.NewSystemConfig(systemConfigService, securityService)
	public := handler.NewPublic(authService, systemConfigService, securityService)
	userService := service.NewUserService(userUsecase, securityService)
	user := handler.NewUser(userService, authService)
	navigation := handler.NewNavigation(userService)
	session := handler.NewSession(tokenService)
	integrationConfigRepo := integration.NewIntegrationConfigRepo(dataData)
	store := data.NewIntegrationRuntime(dataData)
	connectivityTester := integration2.NewConnectivityTester(store)
	integrationConfigUsecase := integration3.NewIntegrationConfigUsecase(integrationConfigRepo, connectivityTester)
	integrationConfigService := service.NewIntegrationConfigService(integrationConfigUsecase)
	integrationConfig := handler.NewIntegrationConfig(integrationConfigService)
	v := handler.NewSet(authority, menu, api, permission, organization, announcement, handlerEmail, handlerPayment, handlerTask, media, audit, export, version, dictionary, parameter, apiToken, systemConfig, public, user, navigation, session, integrationConfig)
	routes := router.NewRoutes(v)
	maintenanceRepo := system.NewMaintenanceRepo(dataData)
	maintenanceUsecase := system2.NewMaintenanceUsecase(maintenanceRepo)
	taskMethods := worker.NewTaskMethods(taskUsecase, maintenanceUsecase, mediaUsecase, runtime)
	appRuntimeContributions := runtimeContributions(routes, taskMethods)
	moduleRuntime := app.Runtime(appRuntimeContributions, registry)
	websocketServer, cleanup2, err := websocket.New(store)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	engine := server.NewGinEngineWithRuntime(runtime, accessControlService, authService, securityService, auditRecorder, logger, string2, moduleRuntime, websocketServer)
	httpServer := server.NewGinServer(confServer, engine)
	mqReloadable, cleanup3, err := mq.New(store, logger)
	if err != nil {
		cleanup2()
		cleanup()
		return nil, nil, err
	}
	kratosApp := newApp(logger, httpServer, taskScheduler, auditRecorder, reloadableLogger, mqReloadable)
	return kratosApp, func() {
		cleanup3()
		cleanup2()
		cleanup()
	}, nil
}
