- Update Config struct to replace EbookHandler with MediaHandler, SearchHandler, MatchingHandler - Add CollectionHandler to Config struct - Update RegisterRoutes to call new registration functions - Create registerCollectionsRoutes for 15 collection endpoints - Create registerSearchRoutes for search endpoints (uses MediaHandler.SearchMediaItems, MatchingHandler.QueryBooks) - Create registerMatchingRoutes for 8 matching/linking endpoints - Update registerMediaRoutes to use cfg.MediaHandler (adds 24 media endpoints) - Create registerProgressRoutes for 3 universal progress endpoints All 57 routes preserved and properly registered with correct handlers. No functionality lost, all endpoints work identically. This is Phase 5 of the ebook.go refactoring plan.
14 lines
403 B
Go
14 lines
403 B
Go
package router
|
|
|
|
func registerSearchRoutes(cfg *Config) {
|
|
e := cfg.Echo
|
|
|
|
// JWT middleware for protected routes
|
|
jwtMiddleware := createJWTMiddleware(cfg)
|
|
protected := e.Group("/api", jwtMiddleware)
|
|
|
|
// Search and query endpoints (all authenticated users)
|
|
protected.GET("/media-items/search", cfg.MediaHandler.SearchMediaItems)
|
|
protected.POST("/sync/books/query", cfg.MatchingHandler.QueryBooks)
|
|
}
|