mirror of
https://gitlab.com/foxixus/neomovies-api.git
synced 2025-10-27 17:38:51 +05:00
feat(api): add unified models, mappers, and prefixed routes (movie/tv/search)
This commit is contained in:
9
main.go
9
main.go
@@ -47,7 +47,8 @@ func main() {
|
||||
tvHandler := appHandlers.NewTVHandler(tvService)
|
||||
favoritesHandler := appHandlers.NewFavoritesHandler(favoritesService, cfg)
|
||||
docsHandler := appHandlers.NewDocsHandler()
|
||||
searchHandler := appHandlers.NewSearchHandler(tmdbService, kpService)
|
||||
searchHandler := appHandlers.NewSearchHandler(tmdbService, kpService)
|
||||
unifiedHandler := appHandlers.NewUnifiedHandler(tmdbService, kpService)
|
||||
categoriesHandler := appHandlers.NewCategoriesHandler(tmdbService)
|
||||
playersHandler := appHandlers.NewPlayersHandler(cfg)
|
||||
torrentsHandler := appHandlers.NewTorrentsHandler(torrentService, tmdbService)
|
||||
@@ -100,7 +101,11 @@ func main() {
|
||||
api.HandleFunc("/movies/top-rated", movieHandler.TopRated).Methods("GET")
|
||||
api.HandleFunc("/movies/upcoming", movieHandler.Upcoming).Methods("GET")
|
||||
api.HandleFunc("/movies/now-playing", movieHandler.NowPlaying).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}", movieHandler.GetByID).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}", movieHandler.GetByID).Methods("GET")
|
||||
// Unified prefixed routes
|
||||
api.HandleFunc("/movie/{id}", unifiedHandler.GetMovie).Methods("GET")
|
||||
api.HandleFunc("/tv/{id}", unifiedHandler.GetTV).Methods("GET")
|
||||
api.HandleFunc("/search", unifiedHandler.Search).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}/recommendations", movieHandler.GetRecommendations).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}/similar", movieHandler.GetSimilar).Methods("GET")
|
||||
api.HandleFunc("/movies/{id}/external-ids", movieHandler.GetExternalIDs).Methods("GET")
|
||||
|
||||
Reference in New Issue
Block a user