feat(health): 新增小程序专用今日体征摘要端点 GET /health/vital-signs/today

This commit is contained in:
iven
2026-04-24 12:17:17 +08:00
parent 19be2a08c7
commit e7b6bdfcac
4 changed files with 162 additions and 0 deletions

View File

@@ -171,3 +171,31 @@ pub struct MiniTrendResp {
/// 数据点列表(按日期升序)
pub data_points: Vec<DataPoint>,
}
// ---------------------------------------------------------------------------
// 小程序今日体征摘要
// ---------------------------------------------------------------------------
/// 单个指标摘要
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct IndicatorSummary {
/// 指标数值
pub value: f64,
/// 状态: "normal" | "high" | "low"
pub status: String,
/// 参考范围,如 "60-100"
pub reference_range: Option<String>,
/// 收缩压(仅血压指标)
pub systolic: Option<f64>,
/// 舒张压(仅血压指标)
pub diastolic: Option<f64>,
}
/// 小程序今日体征摘要响应
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct MiniTodayResp {
pub blood_pressure: Option<IndicatorSummary>,
pub heart_rate: Option<IndicatorSummary>,
pub blood_sugar: Option<IndicatorSummary>,
pub weight: Option<IndicatorSummary>,
}