-
Notifications
You must be signed in to change notification settings - Fork 12
/
services.go
30 lines (23 loc) · 998 Bytes
/
services.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
package service
import (
"github.com/openline-ai/openline-customer-os/packages/server/customer-os-common-auth/config"
"github.com/openline-ai/openline-customer-os/packages/server/customer-os-common-auth/repository"
commonService "github.com/openline-ai/openline-customer-os/packages/server/customer-os-common-module/service"
"gorm.io/gorm"
)
type Services struct {
CommonServices *commonService.Services
CommonAuthRepositories *repository.Repositories
OAuthTokenService OAuthTokenService
GoogleService GoogleService
}
func InitServices(cfg *config.Config, commonServices *commonService.Services, db *gorm.DB) *Services {
repositories := repository.InitRepositories(db)
services := &Services{
CommonServices: commonServices,
CommonAuthRepositories: repositories,
OAuthTokenService: NewOAuthTokenService(repositories),
}
services.GoogleService = NewGoogleService(cfg, commonServices.PostgresRepositories, repositories, services)
return services
}