- Split IndexHandler into HealthHandler, VersionHandler, and CharacterHandler - Rename index.go to version.go in backend - Change VersionData.Changelog from string to []string - Add changelog entries for issues #16-#23 - Remove TestDB function and related code - Fix import ordering in several files Closes #21, #22 References #16, #17, #18, #19, #20, #23 Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/labstack/echo/v5"
|
||||
"github.com/labstack/echo/v5/middleware"
|
||||
echoSwagger "github.com/swaggo/echo-swagger/v2"
|
||||
"music-server/internal/logging"
|
||||
"go.uber.org/zap"
|
||||
"music-server/internal/logging"
|
||||
)
|
||||
|
||||
// @Title MusicServer API
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
// @BasePath /
|
||||
func (s *Server) RegisterRoutes() http.Handler {
|
||||
e := echo.New()
|
||||
|
||||
|
||||
// Serve OpenAPI spec at /openapi
|
||||
e.GET("/openapi", echo.WrapHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
@@ -57,12 +57,16 @@ func (s *Server) RegisterRoutes() http.Handler {
|
||||
// Swagger UI
|
||||
e.GET("/swagger/*", echoSwagger.WrapHandler)
|
||||
|
||||
index := NewIndexHandler()
|
||||
e.GET("/version", index.GetVersion)
|
||||
e.GET("/dbtest", index.GetDBTest)
|
||||
e.GET("/health", index.HealthCheck)
|
||||
e.GET("/character", index.GetCharacter)
|
||||
e.GET("/characters", index.GetCharacterList)
|
||||
health := NewHealthHandler()
|
||||
e.GET("/health", health.HealthCheck)
|
||||
|
||||
version := NewVersionHandler()
|
||||
e.GET("/version", version.GetLatestVersion)
|
||||
e.GET("/version/history", version.GetVersionHistory)
|
||||
|
||||
character := NewCharacterHandler()
|
||||
e.GET("/character", character.GetCharacter)
|
||||
e.GET("/characters", character.GetCharacterList)
|
||||
|
||||
download := NewDownloadHandler()
|
||||
e.GET("/download", download.checkLatest)
|
||||
|
||||
Reference in New Issue
Block a user