use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)]
pub struct UploadAttachmentResponse {
pub attachment_guid: String,
pub task_guid: String,
pub file_name: String,
pub file_size: i64,
pub file_type: String,
pub created_at: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct DeleteAttachmentResponse {
pub success: bool,
pub attachment_guid: String,
}
#[cfg(test)]
#[allow(unused_imports)]
mod tests {
#[test]
fn test_serialization_roundtrip() {
let json = r#"{"test": "value"}"#;
assert!(serde_json::from_str::<serde_json::Value>(json).is_ok());
}
#[test]
fn test_deserialization_from_json() {
let json = r#"{"field": "data"}"#;
let value: serde_json::Value = serde_json::from_str(json).expect("JSON 反序列化失败");
assert_eq!(value["field"], "data");
}
}