30 lines
1.0 KiB
Go
30 lines
1.0 KiB
Go
package services
|
|
|
|
import (
|
|
"database/sql"
|
|
|
|
"git.jamestombleson.com/jtom38/newsbot-api/internal/repository"
|
|
)
|
|
|
|
type RepositoryService struct {
|
|
AlertDiscord repository.AlertDiscordRepo
|
|
Articles repository.ArticlesRepo
|
|
DiscordWebHooks repository.DiscordWebHookRepo
|
|
RefreshTokens repository.RefreshToken
|
|
Sources repository.Sources
|
|
Users repository.Users
|
|
UserSourceSubscriptions repository.UserSourceRepo
|
|
}
|
|
|
|
func NewRepositoryService(conn *sql.DB) RepositoryService {
|
|
return RepositoryService{
|
|
AlertDiscord: repository.NewAlertDiscordRepository(conn),
|
|
Articles: repository.NewArticleRepository(conn),
|
|
DiscordWebHooks: repository.NewDiscordWebHookRepository(conn),
|
|
RefreshTokens: repository.NewRefreshTokenRepository(conn),
|
|
Sources: repository.NewSourceRepository(conn),
|
|
Users: repository.NewUserRepository(conn),
|
|
UserSourceSubscriptions: repository.NewUserSourceRepository(conn),
|
|
}
|
|
}
|