update
This commit is contained in:
18
internal/handler/health_handler.go
Normal file
18
internal/handler/health_handler.go
Normal file
@ -0,0 +1,18 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// HealthHandler 健康检查,供容器编排与反向代理探活使用。
|
||||
type HealthHandler struct{}
|
||||
|
||||
// NewHealthHandler 创建健康检查 handler。
|
||||
func NewHealthHandler() *HealthHandler { return &HealthHandler{} }
|
||||
|
||||
// Check GET /api/health
|
||||
func (h *HealthHandler) Check(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"status": "ok"})
|
||||
}
|
||||
Reference in New Issue
Block a user