1 Star 0 Fork 1

lcq_chang_dev/webook

forked from 人间喜乐/webook 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
wire_gen.go 2.99 KB
一键复制 编辑 原始数据 按行查看 历史
人间喜乐 提交于 2024-03-30 17:20 . reward&account
// 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/google/wire"
repository2 "webook/interactive/repository"
cache2 "webook/interactive/repository/cache"
dao2 "webook/interactive/repository/dao"
service2 "webook/interactive/service"
"webook/internal/events/article"
"webook/internal/repository"
"webook/internal/repository/cache"
"webook/internal/repository/dao"
"webook/internal/service"
"webook/internal/web"
"webook/internal/web/jwt"
"webook/ioc"
)
import (
_ "github.com/spf13/viper/remote"
)
// Injectors from wire.go:
func InitWebServer() *App {
cmdable := ioc.InitRedis()
handler := jwt.NewRedisJWTHandler(cmdable)
loggerV1 := ioc.InitLogger()
v := ioc.InitGinMiddlewares(cmdable, handler, loggerV1)
db := ioc.InitDB(loggerV1)
userDao := dao.NewUserDAO(db)
userCache := cache.NewUserCache(cmdable)
userRepository := repository.NewCacheUserRepository(userDao, userCache)
userService := service.NewUserService(userRepository)
codeCache := cache.NewCodeCache(cmdable)
codeRepository := repository.NewCodeRepository(codeCache)
smsService := ioc.InitSMSService()
codeService := service.NewCodeService(codeRepository, smsService)
userHandler := web.NewUserHandler(userService, codeService, handler)
wechatService := ioc.InitWechatService(loggerV1)
oAuth2WechatHandler := web.NewOAuth2WechatHandler(wechatService, userService, handler)
articleDao := dao.NewArticleORMDAO(db)
articleCache := cache.NewArticleRedisCache(cmdable)
articleRepository := repository.NewCacheArticleRepository(articleDao, articleCache, userRepository)
client := ioc.InitSaramaClient()
syncProducer := ioc.InitSyncProducer(client)
producer := article.NewSaramaSyncProducer(syncProducer)
articleService := service.NewArticleService(articleRepository, producer)
clientv3Client := ioc.InitEtcd()
interactiveServiceClient := ioc.InitIntrClient(clientv3Client)
rewardServiceClient := ioc.InitReward()
articleHandler := web.NewArticleHandler(loggerV1, articleService, interactiveServiceClient, rewardServiceClient)
engine := ioc.InitWebServer(v, userHandler, oAuth2WechatHandler, articleHandler)
v2 := ioc.InitConsumers()
rankingCache := cache.NewRankingRedisCache(cmdable)
rankingRepository := repository.NewCachedRankingRepository(rankingCache)
rankingService := service.NewBatchRankingService(interactiveServiceClient, articleService, rankingRepository)
rlockClient := ioc.InitRlockClient(cmdable)
rankingJob := ioc.InitRankingJob(rankingService, rlockClient, loggerV1)
cron := ioc.InitJobs(loggerV1, rankingJob)
app := &App{
server: engine,
consumers: v2,
cron: cron,
}
return app
}
// wire.go:
var interactiveSvcSet = wire.NewSet(dao2.NewGORMInteractiveDao, cache2.NewRedisInteractiveCache, repository2.NewCachedInteractiveRepository, service2.NewInteractiveService)
var rankingSvcSet = wire.NewSet(cache.NewRankingRedisCache, repository.NewCachedRankingRepository, service.NewBatchRankingService)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/lcq_chang_dev/webook.git
git@gitee.com:lcq_chang_dev/webook.git
lcq_chang_dev
webook
webook
master

搜索帮助