feat: Add start time in /api/sysinfover

This commit is contained in:
lejianwen
2025-06-16 12:23:48 +08:00
parent f20414b3a5
commit 175fdc3bd4
2 changed files with 15 additions and 1 deletions

View File

@@ -3,13 +3,14 @@ package service
import (
"os"
"sync"
"time"
)
type AppService struct {
}
var version = ""
var startTime = ""
var once = &sync.Once{}
func (a *AppService) GetAppVersion() string {
@@ -26,3 +27,13 @@ func (a *AppService) GetAppVersion() string {
})
return version
}
func init() {
// Initialize the AppService if needed
startTime = time.Now().Format("2006-01-02 15:04:05")
}
// GetStartTime
func (a *AppService) GetStartTime() string {
return startTime
}