INNER CODE UNIT · Rust
healthz
zly2006/zhihu-plus-plus · aigc-vote-server/src/lib.rs:269
async fn healthz(State(state): State<AppState>) -> Result<Json<serde_json::Value>, ServiceError> {
state.store.health().await?;
Ok(Json(serde_json::json!({ "ok": true })))
}
async fn post_read_events(
State(state): State<AppState>,
Json(request): Json<ReadEventsRequest>,
) -> Result<Json<ReadEventsResponse>, ServiceError> {
validate_client_id(&request.client_id)?;
Ok(Json(state.store.record_read_events(request).await?))
}
async fn post_aigc_flag(
State(state): State<AppState>,
AxumPath((content_type, content_id)): AxumPath<(String, String)>,
Json(request): Json<AigcFlagRequest>,
) -> Result<Json<AigcFlagResponse>, ServiceError> {