refactor: wire anime handler to use new service interfaces via fx

This commit is contained in:
2026-05-28 12:12:00 +02:00
committed by Milas Holsting
parent 931ee7f493
commit 3accf85f99
3 changed files with 20 additions and 4 deletions

View File

@@ -20,13 +20,20 @@ import (
)
type AnimeHandler struct {
svc domain.AnimeService
svc Service
watchlistSvc domain.WatchlistService
scheduleCacheMu sync.Mutex
scheduleCache map[string]cachedWeekSchedule
}
type Service interface {
domain.AnimeCatalogService
domain.AnimeDiscoverService
domain.AnimeSearchService
domain.AnimeDetailsService
}
type cachedWeekSchedule struct {
fetchedAt time.Time
value animeschedule.WeekSchedule
@@ -40,7 +47,7 @@ func wrapAnimes(in []jikan.Anime) []domain.Anime {
return out
}
func NewAnimeHandler(svc domain.AnimeService, watchlistSvc domain.WatchlistService) *AnimeHandler {
func NewAnimeHandler(svc Service, watchlistSvc domain.WatchlistService) *AnimeHandler {
return &AnimeHandler{
svc: svc,
watchlistSvc: watchlistSvc,