- 在api路由中添加/version接口用于显示程序版本信息 - 集成全局Version变量用于版本号管理 - 修改Dockerfile支持版本号注入构建参数 - 更新开发环境部署工作流添加版本信息构建 - 更新生产环境部署工作流添加版本信息构建 - 实现在版本接口中展示程序版本和Gin框架版本
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"dypid/global"
|
||||
"dypid/internal/controller"
|
||||
"embed"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
|
||||
@@ -15,6 +17,9 @@ func RegRoutes(r *gin.Engine) {
|
||||
g.GET("/test", func(context *gin.Context) {
|
||||
context.String(http.StatusOK, "ok")
|
||||
})
|
||||
g.GET("/version", func(context *gin.Context) {
|
||||
context.String(http.StatusOK, fmt.Sprintf("程序版本: %s\nGin: %s", global.Version, gin.Version))
|
||||
})
|
||||
}
|
||||
{
|
||||
g.GET("/token", controller.ListTokenHandler) //获取token列表
|
||||
|
||||
Reference in New Issue
Block a user