添加详情接口
All checks were successful
Go CI / test-and-build (push) Successful in 11s

This commit is contained in:
2026-04-07 16:08:02 +08:00
parent c5102e608d
commit 02efb9972a
5 changed files with 53 additions and 2 deletions

View File

@@ -37,16 +37,18 @@ func main() {
r.Route("/api/libraries", func(r chi.Router) {
r.Get("/", libraryController.GetAll)
r.Post("/", libraryController.Create)
r.Get("/{id}", libraryController.GetByID)
r.Delete("/{id}", libraryController.Delete)
r.Put("/{id}/name", libraryController.UpdateName)
r.Put("/{id}/path", libraryController.UpdatePath)
r.Post("/{id}/scan", libraryController.Scan)
r.Get("/scan-status", libraryController.GetScanStatus)
r.Delete("/{id}", libraryController.Delete)
r.Get("/{id}/songs", libraryController.GetSongs)
r.Get("/scan-status", libraryController.GetScanStatus)
})
r.Route("/api/songs", func(r chi.Router) {
r.Get("/", songController.GetAllWithDetails)
r.Get("/{id}", songController.GetByIDWithDetails)
r.Get("/{id}/stream", songController.Stream)
r.Get("/{id}/cover", songController.Cover)
})