Reorganized the code, moved more things to the new part

This commit is contained in:
2025-01-13 16:08:54 +01:00
parent 034ba35fbb
commit 5b640375c3
38 changed files with 213 additions and 2028 deletions

View File

@@ -3,7 +3,6 @@ package server
import (
"fmt"
"music-server/cmd/web"
"music-server/pkg/api"
"net/http"
"sort"
"strings"
@@ -37,11 +36,11 @@ func (s *Server) RegisterRoutes() http.Handler {
swagger := http.FileServer(http.FS(web.Swagger))
e.GET("/swagger/*", echo.WrapHandler(swagger))
index := api.NewIndex()
index := NewIndexHandler()
e.GET("/version", index.GetVersion)
e.GET("/health", index.GetDBTest)
sync := api.NewSync()
sync := NewSyncHandler()
syncGroup := e.Group("/sync")
syncGroup.GET("", sync.SyncGames)
syncGroup.GET("/new", sync.SyncGamesNewOnlyChanges)
@@ -49,7 +48,7 @@ func (s *Server) RegisterRoutes() http.Handler {
syncGroup.GET("/quick", sync.SyncGamesQuick)
syncGroup.GET("/reset", sync.ResetGames)
music := api.NewMusic()
music := NewMusicHandler()
musicGroup := e.Group("/music")
musicGroup.GET("", music.GetSong)
musicGroup.GET("/soundTest", music.GetSoundCheckSong)