refactor(router): Phase 5 - update router package with new handlers
- 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.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"bookhoard/internal/handlers"
|
||||
)
|
||||
|
||||
func registerProgressRoutes(cfg *Config, ebookHandler *handlers.Handler) {
|
||||
e := cfg.Echo
|
||||
|
||||
// JWT middleware for protected routes
|
||||
jwtMiddleware := createJWTMiddleware(cfg)
|
||||
protected := e.Group("/api", jwtMiddleware)
|
||||
|
||||
// Universal Progress routes (Phase 1)
|
||||
protected.GET("/progress/:id", ebookHandler.GetUniversalProgress)
|
||||
protected.POST("/progress/:id", ebookHandler.UpdateUniversalProgress)
|
||||
protected.GET("/progress/:id/history", ebookHandler.GetProgressHistory)
|
||||
}
|
||||
Reference in New Issue
Block a user