24 lines
409 B
Go
24 lines
409 B
Go
|
|
package handler
|
||
|
|
|
||
|
|
import (
|
||
|
|
"net/http"
|
||
|
|
|
||
|
|
"github.com/gin-gonic/gin"
|
||
|
|
)
|
||
|
|
|
||
|
|
// HealthHandler 健康检查处理器
|
||
|
|
type HealthHandler struct{}
|
||
|
|
|
||
|
|
// NewHealthHandler 创建健康检查处理器
|
||
|
|
func NewHealthHandler() *HealthHandler {
|
||
|
|
return &HealthHandler{}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Check 健康检查
|
||
|
|
func (h *HealthHandler) Check(c *gin.Context) {
|
||
|
|
c.JSON(http.StatusOK, gin.H{
|
||
|
|
"status": "ok",
|
||
|
|
"service": "qd-sc-server",
|
||
|
|
})
|
||
|
|
}
|