Reorganized the code, moved more things to the new part
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user