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-07 22:20:50 -07:00
|
|
|
repositoryservices "git.jamestombleson.com/jtom38/newsbot-api/internal/repositoryServices"
|
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-07 22:20:50 -07:00
|
|
|
RefreshTokens repositoryservices.RefreshToken
|
2024-05-04 11:58:10 -07:00
|
|
|
Sources repository.Sources
|
2024-05-07 22:20:50 -07:00
|
|
|
Users repositoryservices.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-07 22:20:50 -07:00
|
|
|
RefreshTokens: repositoryservices.NewRefreshTokenService(conn),
|
2024-05-04 11:58:10 -07:00
|
|
|
Sources: repository.NewSourceRepository(conn),
|
2024-05-07 22:20:50 -07:00
|
|
|
Users: repositoryservices.NewUserService(conn),
|
2024-05-04 11:58:10 -07:00
|
|
|
UserSourceSubscriptions: repository.NewUserSourceRepository(conn),
|
2024-04-28 11:40:51 -07:00
|
|
|
}
|
|
|
|
}
|