answer/cmd/wire.go

51 lines
1.6 KiB
Go
Raw Permalink Normal View History

2022-09-27 17:59:05 +08:00
//go:build wireinject
// +build wireinject
// The build tag makes sure the stub is not built in the final build.
package answercmd
2022-09-27 17:59:05 +08:00
import (
"github.com/answerdev/answer/internal/base/conf"
2022-12-12 17:03:04 +08:00
"github.com/answerdev/answer/internal/base/cron"
"github.com/answerdev/answer/internal/base/data"
"github.com/answerdev/answer/internal/base/middleware"
"github.com/answerdev/answer/internal/base/server"
"github.com/answerdev/answer/internal/base/translator"
"github.com/answerdev/answer/internal/controller"
2022-11-29 17:50:31 +08:00
"github.com/answerdev/answer/internal/controller/template_render"
2022-12-21 16:55:16 +08:00
"github.com/answerdev/answer/internal/controller_admin"
"github.com/answerdev/answer/internal/repo"
"github.com/answerdev/answer/internal/router"
"github.com/answerdev/answer/internal/service"
"github.com/answerdev/answer/internal/service/service_config"
2022-09-27 17:59:05 +08:00
"github.com/google/wire"
"github.com/segmentfault/pacman"
"github.com/segmentfault/pacman/log"
)
// initApplication init application.
func initApplication(
debug bool,
serverConf *conf.Server,
dbConf *data.Database,
cacheConf *data.CacheConf,
i18nConf *translator.I18n,
swaggerConf *router.SwaggerConfig,
serviceConf *service_config.ServiceConfig,
logConf log.Logger) (*pacman.Application, func(), error) {
panic(wire.Build(
server.ProviderSetServer,
router.ProviderSetRouter,
controller.ProviderSetController,
2022-12-21 16:55:16 +08:00
controller_admin.ProviderSetController,
2022-11-29 17:50:31 +08:00
templaterender.ProviderSetTemplateRenderController,
2022-09-27 17:59:05 +08:00
service.ProviderSetService,
2022-12-12 17:03:04 +08:00
cron.ProviderSetService,
2022-09-27 17:59:05 +08:00
repo.ProviderSetRepo,
translator.ProviderSet,
middleware.ProviderSetMiddleware,
newApplication,
))
}