fix(cordis): satisfy L2 test and swagger gates

This commit is contained in:
ryan
2026-08-30 14:17:51 +08:00
parent 2d0f2ef3df
commit 6cabad3197
14 changed files with 9896 additions and 8342 deletions
+12 -3
View File
@@ -56,9 +56,7 @@ func (p *Plugin) Apply(ctx *core.Context) error {
ctx.Router().GET("/api/healthz", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
})
ctx.Router().GET("/api/health", func(c *gin.Context) {
c.JSON(http.StatusOK, response.OKNil())
})
ctx.Router().GET("/api/health", Health)
ctx.Router().RegisterWhitelist("/api/health")
// 2. Public config
@@ -92,3 +90,14 @@ func (p *Plugin) Apply(ctx *core.Context) error {
return nil
}
// Health 健康检查
// @Summary 健康检查
// @Description 检查服务是否正常运行,可用于负载均衡存活探测
// @Tags health
// @Produce json
// @Success 200 {object} response.Any{data=string} "服务正常"
// @Router /api/health [get]
func Health(c *gin.Context) {
c.JSON(http.StatusOK, response.OKNil())
}