upadted to 1.24.0; fixed stb and spiddped doubles in precene

This commit is contained in:
2025-03-03 09:28:41 +02:00
parent 0ecf0ddec1
commit 203f834f65
41 changed files with 1058 additions and 219 deletions

7
pkg/service/info.go Normal file
View File

@@ -0,0 +1,7 @@
package service
type InfoService struct{}
func NewInfoService() *InfoService {
return &InfoService{}
}

View File

@@ -0,0 +1 @@
package service

View File

@@ -8,11 +8,15 @@ import (
type Service struct {
_interface.Rutracker
_interface.Prescene
_interface.Info
_interface.ShareTheBrutality
}
func New(repos *repository.Repository) *Service {
return &Service{
Rutracker: NewRutrackerService(repos.Rutracker),
Prescene: NewPresceneService(repos.Prescene),
Rutracker: NewRutrackerService(repos.Rutracker),
Prescene: NewPresceneService(repos.Prescene),
Info: NewInfoService(),
ShareTheBrutality: NewShareTheBrutalityService(repos.ShareTheBrutality),
}
}

19
pkg/service/stb.go Normal file
View File

@@ -0,0 +1,19 @@
package service
import (
"git.amok.space/yevhen/resource-scraper/internal/mail"
"git.amok.space/yevhen/resource-scraper/types/interface"
"git.amok.space/yevhen/resource-scraper/types/model"
)
type ShareTheBrutalityService struct {
repo _interface.ShareTheBrutality
}
func NewShareTheBrutalityService(repo _interface.ShareTheBrutality) *ShareTheBrutalityService {
return &ShareTheBrutalityService{repo: repo}
}
func (stb *ShareTheBrutalityService) GetMail(email string) ([]model.ExternalSources, *mail.EmailService) {
return stb.repo.GetMail(email)
}