Phase 3 Week 7: Add KOReader routes, tests, and documentation
- Add KOReader sync endpoints to main application router - Create Bruno API collection for testing KOReader endpoints - Add integration tests for KOReader functionality - Include comprehensive README with setup instructions - Test coverage for progress, metadata, library, and bookmarks sync - Part of Phase 3 KOReader Integration implementation
This commit is contained in:
+8
-1
@@ -50,9 +50,9 @@ func main() {
|
||||
authHandler := handlers.NewAuthHandler(queries, cfg.JWTSecret, loginAttemptTracker)
|
||||
libraryHandler := handlers.NewLibraryHandler(queries)
|
||||
deviceHandler := handlers.NewDeviceHandler(queries, cfg.JWTSecret, cfg)
|
||||
koreaderHandler := handlers.NewKOReaderHandler(queries)
|
||||
|
||||
deviceAuthMiddleware := middleware.NewDeviceAuthMiddleware(queries)
|
||||
_ = deviceAuthMiddleware
|
||||
|
||||
e := echo.New()
|
||||
|
||||
@@ -181,6 +181,13 @@ func main() {
|
||||
e.GET("/devices/approve/:registration_id", deviceHandler.ApproveDevice)
|
||||
e.POST("/devices/reject/:registration_id", deviceHandler.RejectDevice)
|
||||
|
||||
// KOReader sync routes (device authentication required)
|
||||
koreaderSync := e.Group("/api/sync/koreader")
|
||||
koreaderSync.POST("/progress", deviceAuthMiddleware.Authenticate(koreaderHandler.SyncProgress))
|
||||
koreaderSync.GET("/metadata/:uuid", deviceAuthMiddleware.Authenticate(koreaderHandler.GetMetadata))
|
||||
koreaderSync.GET("/library", deviceAuthMiddleware.Authenticate(koreaderHandler.GetLibrary))
|
||||
koreaderSync.POST("/bookmarks", deviceAuthMiddleware.Authenticate(koreaderHandler.SyncBookmarks))
|
||||
|
||||
// Device management routes (protected - require user auth)
|
||||
devices := protected.Group("/devices")
|
||||
devices.GET("", deviceHandler.ListDevices)
|
||||
|
||||
Reference in New Issue
Block a user