// Code generated by Wire. DO NOT EDIT.

//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject

package main

import (
	"github.com/go-kratos/kratos/v2"
	"github.com/go-kratos/kratos/v2/log"
	"order/internal/biz"
	"order/internal/conf"
	"order/internal/data"
	"order/internal/server"
	"order/internal/service"
)

// Injectors from wire.go:

// wireApp init kratos application.
func wireApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, auth *conf.Auth, confService *conf.Service, logger log.Logger) (*kratos.App, func(), error) {
	db := data.NewDB(confData)
	client := data.NewRedis(confData)
	dataData, cleanup, err := data.NewData(confData, logger, db, client)
	if err != nil {
		return nil, nil, err
	}
	orderRepo := data.NewOrderRepo(dataData, logger)
	discovery := data.NewDiscovery(registry)
	userClient := data.NewUserServiceClient(auth, confService, discovery)
	cartClient := data.NewCartServiceClient(auth, confService, discovery)
	goodsClient := data.NewGoodsServiceClient(auth, confService, discovery)
	orderUsecase := biz.NewOrderUsecase(orderRepo, userClient, cartClient, goodsClient, logger)
	orderService := service.NewOrderService(orderUsecase, logger)
	grpcServer := server.NewGRPCServer(confServer, orderService, logger)
	registrar := server.NewRegistrar(registry)
	app := newApp(logger, grpcServer, registrar)
	return app, func() {
		cleanup()
	}, nil
}
