feat(backend): directory scanner — diff, error state, covers, cache sweep, redis lock

This commit is contained in:
2026-09-05 00:31:32 +08:00
parent 4e84a8aeb7
commit 193d7612b5
7 changed files with 410 additions and 7 deletions
+3 -2
View File
@@ -7,12 +7,13 @@ import (
"booklib/internal/config"
"booklib/internal/redispkg"
"booklib/internal/scanner"
"booklib/internal/store"
)
func NewRouter(cfg *config.Config, st *store.Store, rdb *redispkg.R) *gin.Engine {
func NewRouter(cfg *config.Config, st *store.Store, rdb *redispkg.R, sc *scanner.Scanner) *gin.Engine {
gin.SetMode(gin.ReleaseMode)
a := &api{cfg: cfg, st: st, rdb: rdb}
a := &api{cfg: cfg, st: st, rdb: rdb, sc: sc}
r := gin.New()
r.Use(gin.Recovery())
g := r.Group("/api")