feat: 添加版本信息

This commit is contained in:
2026-03-27 19:26:19 +08:00
parent 21251c6e07
commit 6f30eb79e6
5 changed files with 44 additions and 6 deletions

View File

@@ -133,7 +133,7 @@ func (h *WKHandler) AllRecord(ctx *gin.Context) {
req.Page = 1
}
var list any
var pageInfo any
var pageInfo ckwk.PageInfo
var err error
// 根据类型调用不同的泛型方法
@@ -172,8 +172,11 @@ func (h *WKHandler) AllRecord(ctx *gin.Context) {
}
ctx.JSON(200, dto.Success(map[string]any{
"list": list,
"page_info": pageInfo,
"list": list,
"page_info": map[string]any{
"page": 1,
"pageSize": pageInfo.RecordsCount,
},
}))
}

View File

@@ -0,0 +1,18 @@
package handler
import (
"ckwk/internal/conf"
"ckwk/internal/dto"
"github.com/gin-gonic/gin"
)
func Version(ctx *gin.Context) {
ctx.JSON(200, dto.Success(map[string]string{
"Version": conf.Version,
"BuildAt": conf.BuildAt,
"GitAuthor": conf.GitAuthor,
"GitEmail": conf.GitEmail,
"GitCommit": conf.GitCommit,
}))
}