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

@@ -0,0 +1,28 @@
package server
import (
"music-server/internal/backend"
"net/http"
"github.com/labstack/echo"
)
type IndexHandler struct {
}
func NewIndexHandler() *IndexHandler {
return &IndexHandler{}
}
func (i *IndexHandler) GetVersion(ctx echo.Context) error {
versionHistory := backend.GetVersionHistory()
if versionHistory.Version == "" {
return ctx.JSON(http.StatusNotFound, "version not found")
}
return ctx.JSON(http.StatusOK, versionHistory)
}
func (i *IndexHandler) GetDBTest(ctx echo.Context) error {
backend.TestDB()
return ctx.JSON(http.StatusOK, "TestedDB")
}