修改:打包脚本,以打包时间作为版本号写入程序包中

This commit is contained in:
2024-09-20 11:24:24 +08:00
parent 04b3113b8a
commit d27d9d6bc3
4 changed files with 68 additions and 35 deletions

View File

@@ -8,6 +8,9 @@ import (
var r = gin.Default()
// Version 时间格式化 YYYY.MM.DD-HH.MM.SS
var Version string
func init() {
// 1.日志文件 定期分割归档
@@ -26,6 +29,11 @@ func StartWatch() {
zbus.Bus.Clearup()
c.JSON(http.StatusOK, "+OK")
})
r.GET("/_/version", func(c *gin.Context) {
c.JSON(http.StatusOK, map[string]string{
"version": Version,
})
})
r.GET("/timer/reload", func(c *gin.Context) {
zbus.Bus.ReloadTimer()