chore: 保存工作副本——客户端授权新契约(双端点/验签/令牌/周检)与桌面会话可靠性改进

This commit is contained in:
Logan.Li committed 2026-09-14 22:10:22 +08:00
1 parent f71eef0eba
commit ae6093c9b3
163 files changed
+4911 -2494

No files matched your search

+29
View File
@@ -27,6 +27,8 @@ pub struct OperationResponse {
pub success: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
}
impl OperationResponse {
@@ -34,6 +36,7 @@ impl OperationResponse {
Self {
success: true,
error: None,
error_code: None,
}
}
@@ -41,6 +44,15 @@ impl OperationResponse {
Self {
success: false,
error: Some(error.into()),
error_code: None,
}
}
pub fn coded(code: &'static str, error: impl Into<String>) -> Self {
Self {
success: false,
error: Some(error.into()),
error_code: Some(code.to_string()),
}
}
}
@@ -57,6 +69,8 @@ pub struct IdResponse {
pub sftp_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
}
impl IdResponse {
@@ -67,6 +81,7 @@ impl IdResponse {
shell_id: None,
sftp_id: None,
error: None,
error_code: None,
}
}
@@ -77,6 +92,7 @@ impl IdResponse {
shell_id: Some(id),
sftp_id: None,
error: None,
error_code: None,
}
}
@@ -87,6 +103,7 @@ impl IdResponse {
shell_id: None,
sftp_id: Some(id),
error: None,
error_code: None,
}
}
@@ -97,6 +114,18 @@ impl IdResponse {
shell_id: None,
sftp_id: None,
error: Some(error.into()),
error_code: None,
}
}
pub fn coded(code: &'static str, error: impl Into<String>) -> Self {
Self {
success: false,
connection_id: None,
shell_id: None,
sftp_id: None,
error: Some(error.into()),
error_code: Some(code.to_string()),
}
}
}