59 lines
1.6 KiB
Go
59 lines
1.6 KiB
Go
// 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/v2"
|
|
"github.com/go-kratos/kratos/v2/log"
|
|
"voucher/internal/biz"
|
|
"voucher/internal/conf"
|
|
"voucher/internal/data"
|
|
"voucher/internal/data/repoimpl"
|
|
"voucher/internal/data/thirdrepoimpl"
|
|
"voucher/internal/data/wechatrepoimpl"
|
|
log2 "voucher/internal/pkg/log"
|
|
"voucher/internal/server"
|
|
"voucher/internal/service"
|
|
)
|
|
|
|
import (
|
|
_ "go.uber.org/automaxprocs"
|
|
)
|
|
|
|
// Injectors from wire.go:
|
|
|
|
// wireApp init kratos application.
|
|
func wireApp(bootstrap *conf.Bootstrap, logger log.Logger, accessLogger *log2.AccessLogger) (*kratos.App, func(), error) {
|
|
helper := log2.NewLogHelper(logger)
|
|
rdb, cleanup, err := data.NewRdb(bootstrap)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
orderRepo := repoimpl.NewOrderRepoImpl()
|
|
rocketMQ, cleanup2, err := data.NewRocketMQ(bootstrap)
|
|
if err != nil {
|
|
cleanup()
|
|
return nil, nil, err
|
|
}
|
|
thirdMQSend := thirdrepoimpl.NewMQSendImpl(rocketMQ)
|
|
wechatCpnRepo, err := wechatrepoimpl.NewCpnRepoImpl(bootstrap)
|
|
if err != nil {
|
|
cleanup2()
|
|
cleanup()
|
|
return nil, nil, err
|
|
}
|
|
voucherBiz := biz.NewVoucherBiz(rdb, orderRepo, thirdMQSend, wechatCpnRepo)
|
|
voucherService := service.NewVoucherService(bootstrap, voucherBiz)
|
|
httpServer := server.NewHTTPServer(bootstrap, helper, accessLogger, voucherService)
|
|
consumer := server.NewConsumer(helper, bootstrap, voucherService)
|
|
app := newApp(logger, httpServer, consumer)
|
|
return app, func() {
|
|
cleanup2()
|
|
cleanup()
|
|
}, nil
|
|
}
|