0.6 rust重构01

This commit is contained in:
lix-2026
2026-04-14 13:22:29 +08:00
parent 71fb1aee7e
commit 84a8454fa9
401 changed files with 5841 additions and 1512 deletions
+59
View File
@@ -0,0 +1,59 @@
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ActorPayload {
pub actor_type: String,
pub actor_id: String,
pub session_id: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SourcePayload {
pub channel: String,
pub client: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct TargetRef {
pub workspace_id: Option<String>,
pub page_id: Option<String>,
pub block_id: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RequestMeta {
pub idempotency_key: Option<String>,
pub validate_only: bool,
pub dry_run: bool,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AffectedObject {
pub object_type: String,
pub object_id: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ResponseMeta {
pub request_id: String,
pub trace_id: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct OkPayload<T> {
pub data: T,
pub meta: ResponseMeta,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ErrorDetail {
pub field: Option<String>,
pub reason: String,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ErrorPayload {
pub code: String,
pub message: String,
pub details: Vec<ErrorDetail>,
pub retryable: bool,
pub meta: ResponseMeta,
}