2024-04-28 10:02:57 -07:00
|
|
|
package services
|
|
|
|
|
2024-04-28 11:40:51 -07:00
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
|
|
|
|
"git.jamestombleson.com/jtom38/newsbot-api/internal/repository"
|
2024-05-05 10:02:17 -07:00
|
|
|
repositoryservice "git.jamestombleson.com/jtom38/newsbot-api/internal/respositoryServices"
|
2024-04-28 11:40:51 -07:00
|
|
|
)
|
2024-04-28 10:02:57 -07:00
|
|
|
|
2024-04-28 11:40:51 -07:00
|
|
|
type RepositoryService struct {
|
2024-05-04 11:58:10 -07:00
|
|
|
AlertDiscord repository.AlertDiscordRepo
|
|
|
|
Articles repository.ArticlesRepo
|
|
|
|
DiscordWebHooks repository.DiscordWebHookRepo
|
2024-05-05 10:02:17 -07:00
|
|
|
RefreshTokens repositoryservice.RefreshToken
|
2024-05-04 11:58:10 -07:00
|
|
|
Sources repository.Sources
|
2024-05-05 10:02:17 -07:00
|
|
|
Users repositoryservice.UserServices
|
2024-05-04 11:58:10 -07:00
|
|
|
UserSourceSubscriptions repository.UserSourceRepo
|
2024-04-28 10:02:57 -07:00
|
|
|
}
|
|
|
|
|
2024-04-28 11:40:51 -07:00
|
|
|
func NewRepositoryService(conn *sql.DB) RepositoryService {
|
|
|
|
return RepositoryService{
|
2024-05-04 11:58:10 -07:00
|
|
|
AlertDiscord: repository.NewAlertDiscordRepository(conn),
|
|
|
|
Articles: repository.NewArticleRepository(conn),
|
|
|
|
DiscordWebHooks: repository.NewDiscordWebHookRepository(conn),
|
2024-05-05 10:02:17 -07:00
|
|
|
RefreshTokens: repositoryservice.NewRefreshTokenService(conn),
|
2024-05-04 11:58:10 -07:00
|
|
|
Sources: repository.NewSourceRepository(conn),
|
2024-05-05 10:02:17 -07:00
|
|
|
Users: repositoryservice.NewUserService(conn),
|
2024-05-04 11:58:10 -07:00
|
|
|
UserSourceSubscriptions: repository.NewUserSourceRepository(conn),
|
2024-04-28 11:40:51 -07:00
|
|
|
}
|
|
|
|
}
|