diff --git a/crates/erp-health/src/handler/device_reading_handler.rs b/crates/erp-health/src/handler/device_reading_handler.rs index 97cee2a..890ab65 100644 --- a/crates/erp-health/src/handler/device_reading_handler.rs +++ b/crates/erp-health/src/handler/device_reading_handler.rs @@ -33,6 +33,13 @@ pub struct HourlyQuery { pub page_size: Option, } +#[utoipa::path( + post, + path = "/health/patients/{patient_id}/device-readings/batch", + responses((status = 200, description = "批量创建成功")), + tag = "设备数据", + security(("bearer_auth" = [])), +)] pub async fn batch_create( State(state): State, Extension(ctx): Extension, @@ -50,6 +57,13 @@ where Ok(axum::Json(ApiResponse::ok(result))) } +#[utoipa::path( + get, + path = "/health/patients/{patient_id}/device-readings", + responses((status = 200, description = "设备读数列表")), + tag = "设备数据", + security(("bearer_auth" = [])), +)] pub async fn list_readings( State(state): State, Extension(ctx): Extension, @@ -76,6 +90,13 @@ where Ok(axum::Json(ApiResponse::ok(result))) } +#[utoipa::path( + get, + path = "/health/patients/{patient_id}/device-readings/hourly", + responses((status = 200, description = "小时聚合数据")), + tag = "设备数据", + security(("bearer_auth" = [])), +)] pub async fn list_hourly( State(state): State, Extension(ctx): Extension, diff --git a/crates/erp-health/src/handler/diagnosis_handler.rs b/crates/erp-health/src/handler/diagnosis_handler.rs index 457337c..f46ee11 100644 --- a/crates/erp-health/src/handler/diagnosis_handler.rs +++ b/crates/erp-health/src/handler/diagnosis_handler.rs @@ -16,6 +16,13 @@ pub struct PaginationParams { pub page_size: Option, } +#[utoipa::path( + get, + path = "/health/patients/{patient_id}/diagnoses", + responses((status = 200, description = "诊断记录列表")), + tag = "诊断记录", + security(("bearer_auth" = [])), +)] pub async fn list_diagnoses( State(state): State, Extension(ctx): Extension, @@ -35,6 +42,13 @@ where Ok(Json(ApiResponse::ok(result))) } +#[utoipa::path( + post, + path = "/health/patients/{patient_id}/diagnoses", + responses((status = 200, description = "创建成功")), + tag = "诊断记录", + security(("bearer_auth" = [])), +)] pub async fn create_diagnosis( State(state): State, Extension(ctx): Extension, @@ -59,6 +73,13 @@ where Ok(Json(ApiResponse::ok(result))) } +#[utoipa::path( + put, + path = "/health/diagnoses/{diagnosis_id}", + responses((status = 200, description = "更新成功")), + tag = "诊断记录", + security(("bearer_auth" = [])), +)] pub async fn update_diagnosis( State(state): State, Extension(ctx): Extension, @@ -84,6 +105,13 @@ where Ok(Json(ApiResponse::ok(result))) } +#[utoipa::path( + delete, + path = "/health/diagnoses/{diagnosis_id}", + responses((status = 200, description = "删除成功")), + tag = "诊断记录", + security(("bearer_auth" = [])), +)] pub async fn delete_diagnosis( State(state): State, Extension(ctx): Extension, diff --git a/crates/erp-health/src/handler/vital_signs_daily_handler.rs b/crates/erp-health/src/handler/vital_signs_daily_handler.rs index 57dd98c..7e10b3e 100644 --- a/crates/erp-health/src/handler/vital_signs_daily_handler.rs +++ b/crates/erp-health/src/handler/vital_signs_daily_handler.rs @@ -19,6 +19,13 @@ pub struct DailyAggQuery { pub end_date: String, } +#[utoipa::path( + get, + path = "/health/vital-signs/daily", + responses((status = 200, description = "日聚合数据")), + tag = "设备数据", + security(("bearer_auth" = [])), +)] pub async fn get_daily_aggregations( State(state): State, Extension(ctx): Extension,