package server import ( "net/http" "music-server/internal/backend" "github.com/labstack/echo/v5" ) type VersionHandler struct{} func NewVersionHandler() *VersionHandler { return &VersionHandler{} } // GetVersionHistory godoc // // @Summary Getting the version history of the backend // @Description get version history // @Tags version // @Produce json // @Success 200 {array} backend.VersionData // @Router /version/history [get] func (v *VersionHandler) GetVersionHistory(ctx *echo.Context) error { return ctx.JSON(http.StatusOK, backend.GetVersionHistory()) } // GetLatestVersion godoc // // @Summary Getting the latest version of the backend // @Description get latest version info // @Tags version // @Produce json // @Success 200 {object} backend.VersionData // @Router /version [get] func (v *VersionHandler) GetLatestVersion(ctx *echo.Context) error { return ctx.JSON(http.StatusOK, backend.GetLatestVersion()) }