From 9b1b89056d3685bc88ea5419fdf52934602313d0 Mon Sep 17 00:00:00 2001 From: keven1024 Date: Sat, 21 Jun 2025 15:51:01 +0800 Subject: [PATCH] chore(backend): update version and build_time in GetStat function to use environment variables for better tracking --- backend/internal/controllers/stat.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/internal/controllers/stat.go b/backend/internal/controllers/stat.go index f30bd5a..234cfb2 100644 --- a/backend/internal/controllers/stat.go +++ b/backend/internal/controllers/stat.go @@ -9,6 +9,7 @@ import ( "github.com/hibiken/asynq" "github.com/labstack/echo/v4" "github.com/samber/lo" + "github.com/spf13/cast" ) type FileChartData struct { @@ -83,7 +84,8 @@ func GetStat(c echo.Context) error { }) return utils.HTTPSuccessHandler(c, map[string]any{ - "version": "0.1.0", + "version": utils.GetEnvWithDefault("VERSION", "dev"), + "build_time": cast.ToInt(utils.GetEnvWithDefault("BUILD_TIME", cast.ToString(time.Now().Unix()))), "max_limit": map[string]any{ "file_size": maxStorageSize, },