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

import (
	"github.com/go-nunu/nunu-layout-advanced/internal/handler"
	"github.com/go-nunu/nunu-layout-advanced/internal/middleware"
	"github.com/go-nunu/nunu-layout-advanced/internal/repository"
	"github.com/go-nunu/nunu-layout-advanced/internal/server"
	"github.com/go-nunu/nunu-layout-advanced/internal/service"
	"github.com/go-nunu/nunu-layout-advanced/pkg/app"
	"github.com/go-nunu/nunu-layout-advanced/pkg/jwt"
	"github.com/go-nunu/nunu-layout-advanced/pkg/limiter"
	"github.com/go-nunu/nunu-layout-advanced/pkg/log"
	"github.com/go-nunu/nunu-layout-advanced/pkg/server/http"
	"github.com/go-nunu/nunu-layout-advanced/pkg/sid"
	"github.com/google/wire"
	"github.com/spf13/viper"
)

// Injectors from wire.go:

func NewWire(viperViper *viper.Viper, logger *log.Logger) (*app.App, func(), error) {
	jwtJWT := jwt.NewJwt(viperViper)
	db := repository.NewDB(viperViper, logger)
	syncedEnforcer := repository.NewCasbinEnforcer(viperViper, logger, db)
	limiterLimiter := limiter.NewLimiter(viperViper)
	handlerFunc := middleware.NewRateLimitMiddleware(limiterLimiter)
	handlerHandler := handler.NewHandler(logger)
	client := repository.NewRedis(viperViper)
	qmgoClient := repository.NewMongoClient(viperViper)
	database := repository.NewMongoDB(qmgoClient, viperViper)
	rabbitMQ, cleanup := repository.NewRabbitMQ(viperViper, logger)
	repositoryRepository := repository.NewRepository(logger, db, client, qmgoClient, database, rabbitMQ, syncedEnforcer)
	transaction := repository.NewTransaction(repositoryRepository)
	sidSid := sid.NewSid()
	serviceService := service.NewService(transaction, logger, sidSid, jwtJWT)
	userRepository := repository.NewUserRepository(repositoryRepository)
	userService := service.NewUserService(serviceService, userRepository)
	userHandler := handler.NewUserHandler(handlerHandler, userService)
	gameShieldRepository := repository.NewGameShieldRepository(repositoryRepository)
	parserService := service.NewParserService(serviceService)
	crawlerService := service.NewCrawlerService(serviceService, parserService, viperViper)
	gameShieldPublicIpRepository := repository.NewGameShieldPublicIpRepository(repositoryRepository)
	gameShieldUserIpRepository := repository.NewGameShieldUserIpRepository(repositoryRepository)
	gameShieldPublicIpService := service.NewGameShieldPublicIpService(serviceService, gameShieldPublicIpRepository, gameShieldUserIpRepository)
	duedateService := service.NewDuedateService(serviceService, gameShieldRepository)
	gameShieldBackendRepository := repository.NewGameShieldBackendRepository(repositoryRepository)
	hostRepository := repository.NewHostRepository(repositoryRepository)
	hostService := service.NewHostService(serviceService, hostRepository)
	formatterService := service.NewFormatterService(serviceService, gameShieldPublicIpService, gameShieldBackendRepository, hostService)
	requiredService := service.NewRequiredService(serviceService, crawlerService, viperViper)
	gameShieldSdkIpRepository := repository.NewGameShieldSdkIpRepository(repositoryRepository)
	gameShieldSdkIpService := service.NewGameShieldSdkIpService(serviceService, gameShieldSdkIpRepository)
	gameShieldService := service.NewGameShieldService(serviceService, gameShieldRepository, crawlerService, gameShieldPublicIpService, duedateService, formatterService, parserService, requiredService, viperViper, gameShieldSdkIpService)
	gameShieldHandler := handler.NewGameShieldHandler(handlerHandler, gameShieldService, crawlerService)
	gameShieldBackendService := service.NewGameShieldBackendService(serviceService, gameShieldBackendRepository, gameShieldRepository, crawlerService, gameShieldPublicIpService, duedateService, formatterService, parserService, requiredService, viperViper, gameShieldService, hostService)
	gameShieldBackendHandler := handler.NewGameShieldBackendHandler(handlerHandler, gameShieldBackendService)
	webForwardingRepository := repository.NewWebForwardingRepository(repositoryRepository)
	globalLimitRepository := repository.NewGlobalLimitRepository(repositoryRepository)
	tcpforwardingRepository := repository.NewTcpforwardingRepository(repositoryRepository)
	udpForWardingRepository := repository.NewUdpForWardingRepository(repositoryRepository)
	gatewayGroupRepository := repository.NewGatewayGroupRepository(repositoryRepository)
	gateWayGroupIpRepository := repository.NewGateWayGroupIpRepository(repositoryRepository)
	wafFormatterService := service.NewWafFormatterService(serviceService, globalLimitRepository, hostRepository, requiredService, parserService, tcpforwardingRepository, udpForWardingRepository, webForwardingRepository, rabbitMQ, hostService, gatewayGroupRepository, gateWayGroupIpRepository)
	aoDunService := service.NewAoDunService(serviceService, viperViper)
	webForwardingService := service.NewWebForwardingService(serviceService, requiredService, webForwardingRepository, crawlerService, parserService, wafFormatterService, aoDunService, rabbitMQ, gateWayGroupIpRepository, gatewayGroupRepository)
	webForwardingHandler := handler.NewWebForwardingHandler(handlerHandler, webForwardingService)
	webLimitRepository := repository.NewWebLimitRepository(repositoryRepository)
	webLimitService := service.NewWebLimitService(serviceService, webLimitRepository, requiredService, parserService, crawlerService, hostService)
	webLimitHandler := handler.NewWebLimitHandler(handlerHandler, webLimitService)
	tcpforwardingService := service.NewTcpforwardingService(serviceService, tcpforwardingRepository, parserService, requiredService, crawlerService, globalLimitRepository, hostRepository, wafFormatterService)
	tcpforwardingHandler := handler.NewTcpforwardingHandler(handlerHandler, tcpforwardingService)
	udpForWardingService := service.NewUdpForWardingService(serviceService, udpForWardingRepository, requiredService, parserService, crawlerService, globalLimitRepository, hostRepository, wafFormatterService)
	udpForWardingHandler := handler.NewUdpForWardingHandler(handlerHandler, udpForWardingService)
	tcpLimitRepository := repository.NewTcpLimitRepository(repositoryRepository)
	tcpLimitService := service.NewTcpLimitService(serviceService, tcpLimitRepository, requiredService, parserService, crawlerService, hostService)
	tcpLimitHandler := handler.NewTcpLimitHandler(handlerHandler, tcpLimitService)
	udpLimitRepository := repository.NewUdpLimitRepository(repositoryRepository)
	udpLimitService := service.NewUdpLimitService(serviceService, udpLimitRepository, requiredService, crawlerService, parserService, hostService)
	udpLimitHandler := handler.NewUdpLimitHandler(handlerHandler, udpLimitService)
	requestService := service.NewRequestService(serviceService)
	gatewayGroupService := service.NewGatewayGroupService(serviceService, gatewayGroupRepository, requiredService, parserService, requestService)
	cdnRepository := repository.NewCdnRepository(repositoryRepository)
	cdnService := service.NewCdnService(serviceService, viperViper, requestService, cdnRepository)
	globalLimitService := service.NewGlobalLimitService(serviceService, globalLimitRepository, duedateService, crawlerService, viperViper, requiredService, parserService, hostService, tcpLimitService, udpLimitService, webLimitService, gatewayGroupService, hostRepository, gatewayGroupRepository, cdnService, cdnRepository)
	globalLimitHandler := handler.NewGlobalLimitHandler(handlerHandler, globalLimitService)
	adminRepository := repository.NewAdminRepository(repositoryRepository)
	adminService := service.NewAdminService(serviceService, adminRepository)
	adminHandler := handler.NewAdminHandler(handlerHandler, adminService)
	gatewayGroupHandler := handler.NewGatewayGroupHandler(handlerHandler, gatewayGroupService)
	gateWayGroupIpService := service.NewGateWayGroupIpService(serviceService, gateWayGroupIpRepository, requestService)
	gateWayGroupIpHandler := handler.NewGateWayGroupIpHandler(handlerHandler, gateWayGroupIpService)
	httpServer := server.NewHTTPServer(logger, viperViper, jwtJWT, syncedEnforcer, limiterLimiter, handlerFunc, userHandler, gameShieldHandler, gameShieldBackendHandler, webForwardingHandler, webLimitHandler, tcpforwardingHandler, udpForWardingHandler, tcpLimitHandler, udpLimitHandler, globalLimitHandler, adminHandler, gatewayGroupHandler, gateWayGroupIpHandler)
	appApp := newApp(httpServer)
	return appApp, func() {
		cleanup()
	}, nil
}

// wire.go:

var repositorySet = wire.NewSet(repository.NewDB, repository.NewRedis, repository.NewCasbinEnforcer, repository.NewMongoClient, repository.NewMongoDB, repository.NewRabbitMQ, repository.NewRepository, repository.NewTransaction, repository.NewAdminRepository, repository.NewUserRepository, repository.NewGameShieldRepository, repository.NewGameShieldPublicIpRepository, repository.NewWebForwardingRepository, repository.NewTcpforwardingRepository, repository.NewUdpForWardingRepository, repository.NewGameShieldUserIpRepository, repository.NewWebLimitRepository, repository.NewTcpLimitRepository, repository.NewUdpLimitRepository, repository.NewGameShieldBackendRepository, repository.NewGameShieldSdkIpRepository, repository.NewHostRepository, repository.NewGlobalLimitRepository, repository.NewGatewayGroupRepository, repository.NewGateWayGroupIpRepository, repository.NewCdnRepository)

var serviceSet = wire.NewSet(service.NewService, service.NewAoDunService, service.NewUserService, service.NewAdminService, service.NewGameShieldService, service.NewGameShieldPublicIpService, service.NewDuedateService, service.NewFormatterService, service.NewParserService, service.NewRequiredService, service.NewCrawlerService, service.NewWebForwardingService, service.NewTcpforwardingService, service.NewUdpForWardingService, service.NewGameShieldUserIpService, service.NewWebLimitService, service.NewTcpLimitService, service.NewUdpLimitService, service.NewGameShieldBackendService, service.NewGameShieldSdkIpService, service.NewHostService, service.NewGlobalLimitService, service.NewGatewayGroupService, service.NewWafFormatterService, service.NewGateWayGroupIpService, service.NewRequestService, service.NewCdnService)

var handlerSet = wire.NewSet(handler.NewHandler, handler.NewUserHandler, handler.NewAdminHandler, handler.NewGameShieldHandler, handler.NewGameShieldPublicIpHandler, handler.NewWebForwardingHandler, handler.NewTcpforwardingHandler, handler.NewUdpForWardingHandler, handler.NewGameShieldUserIpHandler, handler.NewWebLimitHandler, handler.NewTcpLimitHandler, handler.NewUdpLimitHandler, handler.NewGameShieldBackendHandler, handler.NewGameShieldSdkIpHandler, handler.NewHostHandler, handler.NewGlobalLimitHandler, handler.NewGatewayGroupHandler, handler.NewGateWayGroupIpHandler)

// 限流器依赖集
var limiterSet = wire.NewSet(limiter.NewLimiter, middleware.NewRateLimitMiddleware)

var serverSet = wire.NewSet(server.NewHTTPServer)

// build App
func newApp(
	httpServer *http.Server,
) *app.App {
	return app.NewApp(app.WithServer(httpServer), app.WithName("demo-server"))
}
