package health import ( "net/http" "github.com/zeromicro/go-zero/rest/httpx" "photography-backend/internal/logic/health" "photography-backend/internal/svc" ) // 健康检查 func HealthHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := health.NewHealthLogic(r.Context(), svcCtx) resp, err := l.Health() if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { httpx.OkJsonCtx(r.Context(), w, resp) } } }