refactor: extract anime feature into its domain slice

This commit is contained in:
2026-04-06 22:38:37 +02:00
parent 67468b41a0
commit af6005500a
4 changed files with 89 additions and 44 deletions

View File

@@ -4,9 +4,9 @@ import (
"net/http"
"malago/internal/database"
"malago/internal/features/anime"
"malago/internal/features/auth"
"malago/internal/features/watchlist"
"malago/internal/handlers"
"malago/internal/jikan"
"malago/internal/middleware"
)
@@ -21,9 +21,12 @@ func NewRouter(cfg Config) http.Handler {
mux := http.NewServeMux()
authHandler := auth.NewHandler(cfg.AuthService)
watchlistSvc := watchlist.NewService(cfg.DB)
watchlistHandler := watchlist.NewHandler(watchlistSvc)
animeHandler := handlers.NewAnimeHandler(cfg.JikanClient, cfg.DB)
animeSvc := anime.NewService(cfg.JikanClient, cfg.DB)
animeHandler := anime.NewHandler(animeSvc)
// Serve static files
fs := http.FileServer(http.Dir("./static"))