|
1
|
|
|
// Code generated by Wire. DO NOT EDIT. |
|
2
|
|
|
|
|
3
|
|
|
//go:generate go run -mod=mod github.com/google/wire/cmd/wire |
|
4
|
|
|
//go:build !wireinject |
|
5
|
|
|
// +build !wireinject |
|
6
|
|
|
|
|
7
|
|
|
package services |
|
8
|
|
|
|
|
9
|
|
|
import ( |
|
10
|
|
|
"github.com/memnix/memnix-rest/app/v1/controllers" |
|
11
|
|
|
"github.com/memnix/memnix-rest/infrastructures" |
|
12
|
|
|
"github.com/memnix/memnix-rest/services/auth" |
|
13
|
|
|
"github.com/memnix/memnix-rest/services/card" |
|
14
|
|
|
"github.com/memnix/memnix-rest/services/deck" |
|
15
|
|
|
"github.com/memnix/memnix-rest/services/mcq" |
|
16
|
|
|
"github.com/memnix/memnix-rest/services/user" |
|
17
|
|
|
) |
|
18
|
|
|
|
|
19
|
|
|
// Injectors from wire.go: |
|
20
|
|
|
|
|
21
|
|
|
// InitializeUser initializes the user controller. |
|
22
|
|
|
func InitializeUser() controllers.UserController { |
|
23
|
|
|
db := infrastructures.GetDBConn() |
|
24
|
|
|
iRepository := user.NewRepository(db) |
|
25
|
|
|
client := infrastructures.GetRedisClient() |
|
26
|
|
|
iRedisRepository := user.NewRedisRepository(client) |
|
27
|
|
|
cache := infrastructures.GetRistrettoCache() |
|
28
|
|
|
iRistrettoRepository := user.NewRistrettoCache(cache) |
|
29
|
|
|
iUseCase := user.NewUseCase(iRepository, iRedisRepository, iRistrettoRepository) |
|
30
|
|
|
userController := controllers.NewUserController(iUseCase) |
|
31
|
|
|
return userController |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
// InitializeAuth initializes the auth controller. |
|
35
|
|
|
func InitializeAuth() controllers.AuthController { |
|
36
|
|
|
db := infrastructures.GetDBConn() |
|
37
|
|
|
iRepository := user.NewRepository(db) |
|
38
|
|
|
iUseCase := auth.NewUseCase(iRepository) |
|
39
|
|
|
authController := controllers.NewAuthController(iUseCase) |
|
40
|
|
|
return authController |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
// InitializeJWT initializes the jwt controller. |
|
44
|
|
|
func InitializeJWT() controllers.JwtController { |
|
45
|
|
|
db := infrastructures.GetDBConn() |
|
46
|
|
|
iRepository := user.NewRepository(db) |
|
47
|
|
|
client := infrastructures.GetRedisClient() |
|
48
|
|
|
iRedisRepository := user.NewRedisRepository(client) |
|
49
|
|
|
cache := infrastructures.GetRistrettoCache() |
|
50
|
|
|
iRistrettoRepository := user.NewRistrettoCache(cache) |
|
51
|
|
|
iUseCase := user.NewUseCase(iRepository, iRedisRepository, iRistrettoRepository) |
|
52
|
|
|
jwtController := controllers.NewJwtController(iUseCase) |
|
53
|
|
|
return jwtController |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
// InitializeOAuth initializes the oauth controller. |
|
57
|
|
|
func InitializeOAuth() controllers.OAuthController { |
|
58
|
|
|
db := infrastructures.GetDBConn() |
|
59
|
|
|
iRepository := user.NewRepository(db) |
|
60
|
|
|
iUseCase := auth.NewUseCase(iRepository) |
|
61
|
|
|
client := infrastructures.GetRedisClient() |
|
62
|
|
|
iAuthRedisRepository := auth.NewRedisRepository(client) |
|
63
|
|
|
oAuthController := controllers.NewOAuthController(iUseCase, iAuthRedisRepository) |
|
64
|
|
|
return oAuthController |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
// InitializeDeck initializes the deck controller. |
|
68
|
|
|
func InitializeDeck() controllers.DeckController { |
|
69
|
|
|
db := infrastructures.GetDBConn() |
|
70
|
|
|
iRepository := deck.NewRepository(db) |
|
71
|
|
|
client := infrastructures.GetRedisClient() |
|
72
|
|
|
iRedisRepository := deck.NewRedisRepository(client) |
|
73
|
|
|
iUseCase := deck.NewUseCase(iRepository, iRedisRepository) |
|
74
|
|
|
deckController := controllers.NewDeckController(iUseCase) |
|
75
|
|
|
return deckController |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
// InitializeCard initializes the card controller. |
|
79
|
|
|
func InitializeCard() controllers.CardController { |
|
80
|
|
|
db := infrastructures.GetDBConn() |
|
81
|
|
|
iRepository := card.NewRepository(db) |
|
82
|
|
|
client := infrastructures.GetRedisClient() |
|
83
|
|
|
iRedisRepository := card.NewRedisRepository(client) |
|
84
|
|
|
iUseCase := card.NewUseCase(iRepository, iRedisRepository) |
|
85
|
|
|
cardController := controllers.NewCardController(iUseCase) |
|
86
|
|
|
return cardController |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
// InitializeMcq initializes the mcq controller. |
|
90
|
|
|
func InitializeMcq() controllers.McqController { |
|
91
|
|
|
db := infrastructures.GetDBConn() |
|
92
|
|
|
iRepository := mcq.NewRepository(db) |
|
93
|
|
|
client := infrastructures.GetRedisClient() |
|
94
|
|
|
iRedisRepository := mcq.NewRedisRepository(client) |
|
95
|
|
|
iUseCase := mcq.NewUseCase(iRepository, iRedisRepository) |
|
96
|
|
|
mcqController := controllers.NewMcqController(iUseCase) |
|
97
|
|
|
return mcqController |
|
98
|
|
|
} |
|
99
|
|
|
|