openlark_platform/common/
mod.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct AppInfo {
8 pub app_id: String,
10 pub app_name: String,
12 pub description: Option<String>,
14 pub status: String,
16}
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct DirectoryItem {
21 pub id: String,
23 pub name: String,
25 pub item_type: String,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
31pub struct SystemSettings {
32 pub key: String,
34 pub value: String,
36 pub description: Option<String>,
38}
39
40pub mod api_endpoints;
42pub mod api_utils;
43pub mod constants;
44
45#[cfg(test)]
46mod tests {
47
48 use serde_json;
49
50 #[test]
51 fn test_serialization_roundtrip() {
52 let json = r#"{"test": "value"}"#;
54 assert!(serde_json::from_str::<serde_json::Value>(json).is_ok());
55 }
56
57 #[test]
58 fn test_deserialization_from_json() {
59 let json = r#"{"field": "data"}"#;
61 let value: serde_json::Value = serde_json::from_str(json).expect("JSON 反序列化失败");
62 assert_eq!(value["field"], "data");
63 }
64}