huskies: merge 605_story_extract_events_and_health_services
This commit is contained in:
+10
-11
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user