From 89a0ea34b02e14fe10719d345d4aab4509c43a57 Mon Sep 17 00:00:00 2001 From: LinkLeong Date: Thu, 20 Jul 2023 04:12:46 +0100 Subject: [PATCH] Add get version function --- route/v1.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/route/v1.go b/route/v1.go index a5648d97e..9ca006dde 100644 --- a/route/v1.go +++ b/route/v1.go @@ -7,6 +7,7 @@ import ( "github.com/IceWhaleTech/CasaOS-Common/external" "github.com/IceWhaleTech/CasaOS-Common/middleware" "github.com/IceWhaleTech/CasaOS-Common/utils/jwt" + "github.com/IceWhaleTech/CasaOS/common" "github.com/IceWhaleTech/CasaOS/pkg/config" v1 "github.com/IceWhaleTech/CasaOS/route/v1" @@ -35,6 +36,9 @@ func InitV1Router() *gin.Engine { r.GET("/v1/sys/debug", v1.GetSystemConfigDebug) // //debug r.GET("/v1/sys/version/check", v1.GetSystemCheckVersion) + r.GET("/v1/sys/version/current", func(ctx *gin.Context) { + ctx.String(200, common.VERSION) + }) r.GET("/ping", func(ctx *gin.Context) { ctx.String(200, "pong") })