use axum::{extract::State, Json, http::StatusCode};
use serde_json::json;
use crate::error::Result;
use crate::state::AppState;
use crate::health::{health_handler, liveness_handler, readiness_handler, HealthResponse};
pub async fn health_check() -> Result<Json<serde_json::Value>> {
Ok(Json(json!({
"status": "ok",
"service": "minifly-api",
"version": env!("CARGO_PKG_VERSION"),
"timestamp": chrono::Utc::now().to_rfc3339(),
})))
}
pub async fn comprehensive_health(state: State<AppState>) -> std::result::Result<Json<HealthResponse>, StatusCode> {
health_handler(state).await
}
pub async fn liveness() -> StatusCode {
liveness_handler().await
}
pub async fn readiness(state: State<AppState>) -> StatusCode {
readiness_handler(state).await
}