fix: add missing queue management routes
Add all queue routes from original main.go: - /queue/devices/:device_id/stats - /queue/devices/:device_id/items - /queue/items/:item_id/retry - /queue/items/:item_id (DELETE) - /queue/devices/:device_id/clear - /queue/items (admin-only GET)
This commit is contained in:
@@ -2,8 +2,6 @@ package router
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bookhoard/internal/handlers"
|
"bookhoard/internal/handlers"
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func registerQueueRoutes(cfg *Config) {
|
func registerQueueRoutes(cfg *Config) {
|
||||||
@@ -17,10 +15,10 @@ func registerQueueRoutes(cfg *Config) {
|
|||||||
// Sync queue management routes (protected - require user auth)
|
// Sync queue management routes (protected - require user auth)
|
||||||
queue := protected.Group("/queue")
|
queue := protected.Group("/queue")
|
||||||
queue.GET("/devices/:device_id/stats", cfg.QueueHandler.GetDeviceQueueStats)
|
queue.GET("/devices/:device_id/stats", cfg.QueueHandler.GetDeviceQueueStats)
|
||||||
queue.GET("/devices/:device_id/items", queueHandler.ListDeviceQueueItems)
|
queue.GET("/devices/:device_id/items", cfg.QueueHandler.ListDeviceQueueItems)
|
||||||
queue.POST("/items/:item_id/retry", queueHandler.RetryQueueItem)
|
queue.POST("/items/:item_id/retry", cfg.QueueHandler.RetryQueueItem)
|
||||||
queue.DELETE("/items/:item_id", queueHandler.DeleteQueueItem)
|
queue.DELETE("/items/:item_id", cfg.QueueHandler.DeleteQueueItem)
|
||||||
queue.DELETE("/devices/:device_id/clear", queueHandler.ClearDeviceQueue)
|
queue.DELETE("/devices/:device_id/clear", cfg.QueueHandler.ClearDeviceQueue)
|
||||||
|
|
||||||
// Admin-only queue routes
|
// Admin-only queue routes
|
||||||
adminQueue := queue.Group("", handlers.AdminMiddleware)
|
adminQueue := queue.Group("", handlers.AdminMiddleware)
|
||||||
|
|||||||
Reference in New Issue
Block a user