From 5386d362ba22699a5adeadd176fef38c744a9266 Mon Sep 17 00:00:00 2001 From: nite07 Date: Fri, 15 Nov 2024 15:13:44 +0800 Subject: [PATCH] mod: healthcheck response --- server/handler/healthcheck.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/handler/healthcheck.go b/server/handler/healthcheck.go index fa666a4..968dedf 100644 --- a/server/handler/healthcheck.go +++ b/server/handler/healthcheck.go @@ -7,12 +7,14 @@ import ( "time" "github.com/nitezs/pcgamedb/config" + "github.com/nitezs/pcgamedb/constant" "github.com/nitezs/pcgamedb/db" "github.com/gin-gonic/gin" ) type HealthCheckResponse struct { + Version string `json:"version"` Status string `json:"status"` Message string `json:"message,omitempty"` Date string `json:"date"` @@ -48,6 +50,7 @@ func HealthCheckHandler(c *gin.Context) { } c.JSON(http.StatusOK, HealthCheckResponse{ Status: "ok", + Version: constant.Version, Date: time.Now().Format("2006-01-02 15:04:05"), Uptime: time.Since(config.Runtime.ServerStartTime).String(), AutoCrawl: config.Config.Server.AutoCrawl,