huskies: merge 605_story_extract_events_and_health_services

This commit is contained in:
dave
2026-04-24 14:03:20 +00:00
parent 2f07365745
commit 23890a1d33
9 changed files with 399 additions and 166 deletions
+10 -11
View File
@@ -1,7 +1,13 @@
//! Health check endpoint — returns a static "ok" response.
//! Health check endpoint — thin HTTP adapter over `service::health`.
//!
//! Domain logic (the `HealthStatus` type and check function) lives in
//! `service::health`; this module is a thin adapter: call service → shape
//! response.
pub use crate::service::health::HealthStatus;
use poem::handler;
use poem_openapi::{Object, OpenApi, Tags, payload::Json};
use serde::Serialize;
use poem_openapi::{OpenApi, Tags, payload::Json};
/// Health check endpoint.
///
@@ -16,11 +22,6 @@ enum HealthTags {
Health,
}
#[derive(Serialize, Object)]
pub struct HealthStatus {
status: String,
}
pub struct HealthApi;
#[OpenApi(tag = "HealthTags::Health")]
@@ -30,9 +31,7 @@ impl HealthApi {
/// Returns a JSON status object to confirm the server is running.
#[oai(path = "/health", method = "get")]
async fn health(&self) -> Json<HealthStatus> {
Json(HealthStatus {
status: "ok".to_string(),
})
Json(crate::service::health::check())
}
}