refactor: wire anime handler to use new service interfaces via fx
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user