-
Notifications
You must be signed in to change notification settings - Fork 0
/
wire.go
30 lines (26 loc) · 1.69 KB
/
wire.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
//go:build wireinject
// +build wireinject
package main
import (
auth "github.com/Laeeqdev/AttendanceMangements/API/Auth"
repository "github.com/Laeeqdev/AttendanceMangements/API/Repository"
resthandler "github.com/Laeeqdev/AttendanceMangements/API/RestHandler"
router "github.com/Laeeqdev/AttendanceMangements/API/Router"
service "github.com/Laeeqdev/AttendanceMangements/API/Service"
"github.com/go-pg/pg"
"github.com/google/wire"
)
func InitializeApp(*pg.DB) *router.RouterImpl {
wire.Build(auth.NewUserAuthHandlerImpl, wire.Bind(new(auth.UserAuthHandler), new(*auth.UserAuthHandlerImpl)),
repository.NewDetailsRepositoryImpl, wire.Bind(new(repository.DetailsRepository), new(*repository.DetailsRepositoryImpl)),
repository.NewPunchinRepositoryImpl, wire.Bind(new(repository.PunchinRepository), new(*repository.PunchinRepositoryImpl)),
repository.NewUserRepositoryImpl, wire.Bind(new(repository.UserRepository), new(*repository.UserRepositoryImpl)),
resthandler.NewDetailsHandlerImpl, wire.Bind(new(resthandler.DetailsHandler), new(*resthandler.DetailsHandlerImpl)),
resthandler.NewPrincipalHandlerImpl, wire.Bind(new(resthandler.PrincipalHandler), new(*resthandler.PrincipalHandlerImpl)),
resthandler.NewPunchInPunchOutHandlerImpl, wire.Bind(new(resthandler.PunchInPunchOutHandler), new(*resthandler.PunchInPunchOutHandlerImpl)),
router.NewRouterImpl,
service.NewGetDeatilsServiceImpl, wire.Bind(new(service.GetDeatilsService), new(*service.GetDeatilsServiceImpl)),
service.NewPunchinServiceImpl, wire.Bind(new(service.PunchinService), new(*service.PunchinServiceImpl)),
service.NewUserServiceImpl, wire.Bind(new(service.UserService), new(*service.UserServiceImpl)))
return &router.RouterImpl{}
}