52 lines
1.7 KiB
Go
52 lines
1.7 KiB
Go
// 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()
|
||
}
|