package router // Podcast routes (plan §8). All under /api/podcasts with the JWT // middleware; scoping is RLS's job (D20) — handlers add no visibility // plumbing. func registerPodcastRoutes(cfg *Config) { g := cfg.Echo.Group("/api/podcasts", createJWTMiddleware(cfg)) g.POST("/feeds", cfg.PodcastHandler.AddFeed) g.GET("/feeds", cfg.PodcastHandler.ListFeeds) g.GET("/search", cfg.PodcastHandler.Search) // :id-scoped (RLS answers 404 for feeds outside the caller's scope). feeds := g.Group("/feeds/:id") feeds.GET("", cfg.PodcastHandler.GetFeed) feeds.GET("/sequence", cfg.PodcastHandler.GetFeedSequence) feeds.PUT("/order", cfg.PodcastHandler.SetFeedOrder) feeds.PUT("/subscription", cfg.PodcastHandler.UpdateSubscription) feeds.DELETE("/subscription", cfg.PodcastHandler.DeleteSubscription) feeds.POST("/refresh", cfg.PodcastHandler.RefreshFeed) feeds.POST("/episodes/:eid/download", cfg.PodcastHandler.DownloadEpisodes) feeds.DELETE("", cfg.PodcastHandler.DeleteFeed) // admin-only (handler checks role) }