-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwire_gen.go
49 lines (43 loc) · 1.62 KB
/
wire_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// 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/gin-gonic/gin"
"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() *gin.Engine {
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.NewCachedUserRepository(userDAO, userCache)
userService := service.NewUserService(userRepository)
codeRedisCache := cache.NewCodeCache(cmdable)
codeRepository := repository.NewCodeRepository(codeRedisCache)
smsService := ioc.InitSMSService()
codeService := service.NewCodeService(codeRepository, smsService)
userHandler := web.NewUserHandler(userService, handler, codeService)
articleDAO := dao.NewArticleGORMDAO(db)
articleRepository := repository.NewCachedArticleRepository(articleDAO)
articleService := service.NewArticleService(articleRepository)
articleHandler := web.NewArticleHandler(loggerV1, articleService)
wechatService := ioc.InitWechatService(loggerV1)
oAuth2WechatHandler := web.NewOAuth2WechatHandler(wechatService, handler, userService)
engine := ioc.InitWebServer(v, userHandler, articleHandler, oAuth2WechatHandler)
return engine
}