use crate::{state::AppState, Result};
use axum::{extract::State, response::IntoResponse, Json};
use serde::Serialize;
#[derive(Debug, Serialize)]
pub struct HealthStatus {
pub status: String,
}
#[derive(Debug, Serialize)]
pub struct ReadinessStatus {
pub status: String,
pub collections: usize,
pub total_points: usize,
}
pub async fn health_check() -> Result<impl IntoResponse> {
Ok(Json(HealthStatus {
status: "healthy".to_string(),
}))
}
pub async fn readiness(State(state): State<AppState>) -> Result<impl IntoResponse> {
let collections_count = state.collection_count();
Ok(Json(ReadinessStatus {
status: "ready".to_string(),
collections: collections_count,
total_points: 0, }))
}