拆分LibraryRepository
All checks were successful
Go CI / test-and-build (push) Successful in 11s

This commit is contained in:
2026-04-08 14:42:52 +08:00
parent 9637ad2476
commit 55c017f60d
8 changed files with 414 additions and 377 deletions

View File

@@ -23,9 +23,11 @@ func main() {
r.Use(middleware.Logger)
libraryRepo := repository.NewLibraryRepository(GetDB())
artistRepo := repository.NewArtistRepository(GetDB())
albumRepo := repository.NewAlbumRepository(GetDB())
songRepo := repository.NewSongRepository(GetDB())
mediaRepo := repository.NewMediaRepository(GetDB())
libraryService := service.NewLibraryService(libraryRepo)
libraryService := service.NewLibraryService(libraryRepo, artistRepo, albumRepo, songRepo, mediaRepo)
songService := service.NewSongService(songRepo, mediaRepo)
libraryController := controller.NewLibraryController(libraryService)
songController := controller.NewSongController(songService)