feat(api): 添加版本信息接口并完善构建流程
部署开发环境 / deploy-dev (push) Successful in 1m22s

- 在api路由中添加/version接口用于显示程序版本信息
- 集成全局Version变量用于版本号管理
- 修改Dockerfile支持版本号注入构建参数
- 更新开发环境部署工作流添加版本信息构建
- 更新生产环境部署工作流添加版本信息构建
- 实现在版本接口中展示程序版本和Gin框架版本
This commit is contained in:
2026-04-30 22:06:21 +08:00
parent 6d379714cd
commit 28aec98414
5 changed files with 22 additions and 3 deletions
+5
View File
@@ -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列表