feat(backend): cover/file/pages endpoints — immutable URLs, Range, disk+redis caches

This commit is contained in:
2026-09-05 00:48:40 +08:00
parent 249619b857
commit 0946f6be5a
5 changed files with 340 additions and 3 deletions
+4
View File
@@ -37,5 +37,9 @@ func NewRouter(cfg *config.Config, st *store.Store, rdb *redispkg.R, sc *scanner
p.GET("/books", a.listBooks)
p.GET("/books/:id", a.getBook)
p.DELETE("/books/:id", a.adminOnly(), a.deleteBook)
p.GET("/books/:id/cover", a.serveCover)
p.GET("/books/:id/file", a.serveFile)
p.GET("/books/:id/pages", a.pagesCount)
p.GET("/books/:id/pages/:n", a.page)
return r
}