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;
42
43#[cfg(test)]
44mod tests {
45
46 use serde_json;
47
48 #[test]
49 fn test_serialization_roundtrip() {
50 let json = r#"{"test": "value"}"#;
52 assert!(serde_json::from_str::<serde_json::Value>(json).is_ok());
53 }
54
55 #[test]
56 fn test_deserialization_from_json() {
57 let json = r#"{"field": "data"}"#;
59 let value: serde_json::Value = serde_json::from_str(json).unwrap();
60 assert_eq!(value["field"], "data");
61 }
62}