Files
iotlcm/internal/pub/pkg/version/version.go
T
2026-10-29 14:59:32 +08:00

52 lines
1.7 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// package version
// @Link https://github.com/xiujiecn/xiu-admin
// @Copyright Copyright (c) 2025 LiXiujie
// @Author Lxj <xxx@example.com>
// @License https://github.com/xiujiecn/xiu-admin/blob/master/LICENSE
package version
import (
"context"
"fmt"
"github.com/gogf/gf/v2/frame/g"
)
var (
BuildTime string
BuildVersion string
CommitID string
)
func ShowLogo(ctx context.Context, buildVersion, buildTime, commitID string) {
BuildVersion = buildVersion
BuildTime = buildTime
CommitID = commitID
//版本号
g.Log().Notice(ctx, `
██╗██╗███████╗ ██╗ ██████╗ ████████╗
██║██║██╔════╝ ██║██╔═══██╗╚══██╔══╝
██║██║█████╗ ██║██║ ██║ ██║
██ ██║██║██╔══╝ ██║██║ ██║ ██║
╚█████╔╝██║███████╗ ██║╚██████╔╝ ██║
╚════╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝
`)
g.Log().Notice(ctx, "Version :", buildVersion)
g.Log().Notice(ctx, "BuildTime :", buildTime)
g.Log().Notice(ctx, "CommitID :", commitID)
g.Log().Notice(ctx, "Copyright:", "2026 The iotLCM Authors")
fmt.Println("Version :", buildVersion)
fmt.Println("BuildTime :", buildTime)
fmt.Println("CommitID :", commitID)
fmt.Println("Copyright:", "2026 The iotLCM Authors")
}
func AppName(ctx context.Context) string {
return g.Cfg().MustGet(ctx, "system.appName", "IotLCM").String()
}