-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire_gen.go
41 lines (36 loc) · 1.35 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
// 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 (
"geekgo-webook/internal/repository"
"geekgo-webook/internal/repository/cache"
"geekgo-webook/internal/repository/dao"
"geekgo-webook/internal/service"
"geekgo-webook/internal/web"
"geekgo-webook/internal/web/jwt"
"geekgo-webook/ioc"
"github.com/gin-gonic/gin"
)
// Injectors from wire.go:
func InitWebServer() *gin.Engine {
cmdable := ioc.InitRedis()
handler := jwt.NewRedisJWTHandler(cmdable)
v := ioc.InitMiddlewares(cmdable, handler)
db := ioc.InitDB()
userDAO := dao.NewUserDAO(db)
userCache := cache.NewUserCache(cmdable)
userRepository := repository.NewUserRepository(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()
wechatHandlerConfig := ioc.NewWechatHandlerConfig()
oAuth2WechatHandler := web.NewOAuth2WechatHandler(wechatService, userService, handler, wechatHandlerConfig)
engine := ioc.InitGin(v, userHandler, oAuth2WechatHandler)
return engine
}