// 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"
	"kra/internal/biz"
	"kra/internal/conf"
	"kra/internal/data"
	"kra/internal/data/payment"
	"kra/internal/data/repository"
	"kra/internal/initialize"
	"kra/internal/integration/cache"
	"kra/internal/integration/email"
	"kra/internal/integration/mq"
	"kra/internal/integration/storage"
	"kra/internal/integration/websocket"
	"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 := app.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 := biz.NewAccessControlUsecase(authorityAccessRepo, apiRepo)
	accessControlService := service.NewAccessControlService(accessControlUsecase)
	userRepo := system.NewUserRepo(dataData)
	userUsecase := biz.NewUserUsecase(userRepo)
	securityRepo := system.NewSecurityRepo(dataData)
	bizCache := cache.New(dataData)
	runtimeSettings := system.NewRuntimeSettings(runtime)
	apiTokenRepo := system.NewAPITokenRepo(dataData)
	tokenUsecase := biz.NewTokenUsecase(apiTokenRepo)
	securityUsecase := biz.NewSecurityUsecase(securityRepo, bizCache, runtimeSettings, tokenUsecase)
	tokenIssuer := system.NewTokenIssuer(runtimeSettings)
	auditRecordRepo := system.NewAuditRecorderRepo(dataData)
	authenticationUsecase := biz.NewAuthenticationUsecase(userUsecase, securityUsecase, tokenIssuer, auditRecordRepo)
	authService := service.NewAuthService(authenticationUsecase)
	securityService := service.NewSecurityService(securityUsecase)
	auditRecorderUsecase := biz.NewAuditRecorderUsecase(auditRecordRepo)
	auditRecorder := service.NewAuditRecorder(auditRecorderUsecase)
	authorityUsecase := biz.NewAuthorityUsecase(authorityAccessRepo)
	authorityService := service.NewAuthorityService(authorityUsecase)
	authority := handler.NewAuthority(authorityService)
	menuRepo := system.NewMenuRepo(dataData)
	menuUsecase := biz.NewMenuUsecase(menuRepo)
	menuService := service.NewMenuService(menuUsecase)
	menu := handler.NewMenu(menuService)
	apiUsecase := biz.NewAPIUsecase(apiRepo)
	apiService := service.NewAPIService(apiUsecase, runtimeSettings)
	api := handler.NewAPI(apiService)
	permissionRepo := system.NewPermissionRepo(dataData)
	permissionUsecase := biz.NewPermissionUsecase(permissionRepo)
	permissionService := service.NewPermissionService(permissionUsecase)
	permission := handler.NewPermission(permissionService)
	departmentRepo := system.NewDepartmentRepo(dataData)
	departmentUsecase := biz.NewDepartmentUsecase(departmentRepo)
	departmentService := service.NewDepartmentService(departmentUsecase)
	positionRepo := system.NewPositionRepo(dataData)
	positionUsecase := biz.NewPositionUsecase(positionRepo)
	positionService := service.NewPositionService(positionUsecase)
	organization := handler.NewOrganization(departmentService, positionService)
	announcementRepo := system.NewAnnouncementRepo(dataData)
	announcementUsecase := biz.NewAnnouncementUsecase(announcementRepo)
	announcementService := service.NewAnnouncementService(announcementUsecase)
	announcement := handler.NewAnnouncement(announcementService)
	emailRepo := email.NewEmailRepo(runtime)
	emailUsecase := biz.NewEmailUsecase(emailRepo)
	emailService := service.NewEmailService(emailUsecase)
	handlerEmail := handler.NewEmail(emailService)
	paymentRepo := payment.NewPaymentRepo(dataData)
	paymentOrderRepo := payment.NewPaymentOrderRepo(dataData)
	paymentUsecase := biz.NewPaymentUsecase(paymentRepo, paymentOrderRepo, logger)
	paymentService := service.NewPaymentService(paymentUsecase)
	handlerPayment := handler.NewPayment(paymentService)
	taskRepo := system.NewTaskRepo(dataData)
	registry := app.TaskRegistry(catalog)
	taskUsecase := biz.NewTaskUsecaseWithRegistry(taskRepo, registry)
	mediaRepo := system.NewMediaRepo(dataData)
	mediaUsecase := biz.NewMediaUsecase(mediaRepo, reloadable, runtimeSettings)
	taskExecutor := worker.NewTaskExecutorWithRegistry(taskUsecase, mediaUsecase, runtime, registry)
	taskScheduler := worker.NewTaskScheduler(taskUsecase, authorityUsecase, taskExecutor, logger)
	taskRuntime := worker.NewTaskRuntime(taskScheduler)
	taskApplicationUsecase := biz.NewTaskApplicationUsecase(taskUsecase, taskRuntime)
	taskService := service.NewTaskService(taskApplicationUsecase)
	task := handler.NewTask(taskService)
	mediaService := service.NewMediaService(mediaUsecase, runtimeSettings)
	media := handler.NewMedia(mediaService)
	auditQueryRepo := system.NewAuditRepo(dataData)
	auditUsecase := biz.NewAuditUsecase(auditQueryRepo)
	auditService := service.NewAuditService(auditUsecase)
	logFileRepo := system.NewLogFileRepo(dataData)
	logViewerUsecase := biz.NewLogViewerUsecase(logFileRepo)
	logViewerService := service.NewLogViewerService(logViewerUsecase)
	audit := handler.NewAudit(auditService, auditRecorder, logViewerService, logger)
	exportRepo := system.NewExportRepo(dataData)
	exportUsecase := biz.NewExportUsecase(exportRepo)
	exportService := service.NewExportService(exportUsecase, bizCache)
	export := handler.NewExport(exportService)
	versionRepo := system.NewVersionRepo(dataData)
	versionUsecase := biz.NewVersionUsecase(versionRepo)
	versionService := service.NewVersionService(versionUsecase)
	version := handler.NewVersion(versionService)
	dictionaryRepo := system.NewDictionaryRepo(dataData)
	dictionaryUsecase := biz.NewDictionaryUsecase(dictionaryRepo)
	dictionaryService := service.NewDictionaryService(dictionaryUsecase)
	dictionary := handler.NewDictionary(dictionaryService)
	parameterRepo := system.NewParameterRepo(dataData)
	parameterUsecase := biz.NewParameterUsecase(parameterRepo)
	parameterService := service.NewParameterService(parameterUsecase)
	parameter := handler.NewParameter(parameterService)
	tokenService := service.NewTokenService(tokenUsecase, tokenIssuer)
	apiToken := handler.NewAPIToken(tokenService)
	initializationRepo := initialize.NewRepo(dataData, catalog)
	systemConfigUsecase := biz.NewSystemConfigUsecase(initializationRepo, taskRuntime)
	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 := system.NewIntegrationConfigRepo(dataData)
	integrationConfigUsecase := biz.NewIntegrationConfigUsecase(integrationConfigRepo)
	integrationConfigService := service.NewIntegrationConfigService(integrationConfigUsecase)
	integrationConfig := handler.NewIntegrationConfig(integrationConfigService)
	v := handler.NewSet(authority, menu, api, permission, organization, announcement, handlerEmail, handlerPayment, task, media, audit, export, version, dictionary, parameter, apiToken, systemConfig, public, user, navigation, session, integrationConfig)
	routes := router.NewRoutes(v)
	taskMethods := worker.NewTaskMethods(taskUsecase, mediaUsecase, runtime)
	moduleRuntime := app.Runtime(routes, taskMethods, registry)
	store := data.NewIntegrationRuntime(dataData)
	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
}
