docs(health): OpenAPI 注解 — diagnosis + device_reading + vital_signs_daily
为 3 个 handler 文件共 8 个函数添加 #[utoipa::path] 注解。 P1-5 批次 2/N。
This commit is contained in:
@@ -33,6 +33,13 @@ pub struct HourlyQuery {
|
|||||||
pub page_size: Option<u64>,
|
pub page_size: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[utoipa::path(
|
||||||
|
post,
|
||||||
|
path = "/health/patients/{patient_id}/device-readings/batch",
|
||||||
|
responses((status = 200, description = "批量创建成功")),
|
||||||
|
tag = "设备数据",
|
||||||
|
security(("bearer_auth" = [])),
|
||||||
|
)]
|
||||||
pub async fn batch_create<S>(
|
pub async fn batch_create<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
@@ -50,6 +57,13 @@ where
|
|||||||
Ok(axum::Json(ApiResponse::ok(result)))
|
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<S>(
|
pub async fn list_readings<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
@@ -76,6 +90,13 @@ where
|
|||||||
Ok(axum::Json(ApiResponse::ok(result)))
|
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<S>(
|
pub async fn list_hourly<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ pub struct PaginationParams {
|
|||||||
pub page_size: Option<u64>,
|
pub page_size: Option<u64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[utoipa::path(
|
||||||
|
get,
|
||||||
|
path = "/health/patients/{patient_id}/diagnoses",
|
||||||
|
responses((status = 200, description = "诊断记录列表")),
|
||||||
|
tag = "诊断记录",
|
||||||
|
security(("bearer_auth" = [])),
|
||||||
|
)]
|
||||||
pub async fn list_diagnoses<S>(
|
pub async fn list_diagnoses<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
@@ -35,6 +42,13 @@ where
|
|||||||
Ok(Json(ApiResponse::ok(result)))
|
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<S>(
|
pub async fn create_diagnosis<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
@@ -59,6 +73,13 @@ where
|
|||||||
Ok(Json(ApiResponse::ok(result)))
|
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<S>(
|
pub async fn update_diagnosis<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
@@ -84,6 +105,13 @@ where
|
|||||||
Ok(Json(ApiResponse::ok(result)))
|
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<S>(
|
pub async fn delete_diagnosis<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ pub struct DailyAggQuery {
|
|||||||
pub end_date: String,
|
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<S>(
|
pub async fn get_daily_aggregations<S>(
|
||||||
State(state): State<HealthState>,
|
State(state): State<HealthState>,
|
||||||
Extension(ctx): Extension<TenantContext>,
|
Extension(ctx): Extension<TenantContext>,
|
||||||
|
|||||||
Reference in New Issue
Block a user