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-04-28 10:02:57 -07:00
|
|
|
|
2024-04-28 11:40:51 -07:00
|
|
|
type RepositoryService struct {
|
|
|
|
Articles repository.ArticlesRepo
|
|
|
|
DiscordWebHooks repository.DiscordWebHookRepo
|
|
|
|
Sources repository.Sources
|
|
|
|
Users repository.Users
|
|
|
|
RefreshTokens repository.RefreshToken
|
2024-04-28 10:02:57 -07:00
|
|
|
}
|
|
|
|
|
2024-04-28 11:40:51 -07:00
|
|
|
func NewRepositoryService(conn *sql.DB) RepositoryService {
|
|
|
|
return RepositoryService{
|
|
|
|
Articles: repository.NewArticleRepository(conn),
|
|
|
|
DiscordWebHooks: repository.NewDiscordWebHookRepository(conn),
|
|
|
|
Sources: repository.NewSourceRepository(conn),
|
|
|
|
Users: repository.NewUserRepository(conn),
|
|
|
|
RefreshTokens: repository.NewRefreshTokenRepository(conn),
|
|
|
|
}
|
|
|
|
}
|