use chrono::NaiveDateTime;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[allow(dead_code)]
pub(crate) trait Timestamp {
fn timestamp_from_nanos(&self) -> Option<NaiveDateTime>;
}
impl Timestamp for i64 {
fn timestamp_from_nanos(&self) -> Option<NaiveDateTime> {
let nanos = self % 1_000_000_000;
let seconds = (self - nanos) / 1_000_000_000;
NaiveDateTime::from_timestamp_opt(seconds, nanos as u32)
}
}
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
#[schemars(rename = "health")]
pub struct Health {
pub healthy: bool,
}