open_lark/service/cloud_docs/bitable/
mod.rs

1use crate::core::{config::Config, trait_system::Service};
2use std::sync::Arc;
3
4pub mod v1;
5
6pub struct BitableService {
7    config: Config,
8    #[allow(dead_code)] // Reserved for future optimizations
9    config_arc: Arc<Config>,
10    pub v1: v1::V1,
11}
12
13impl BitableService {
14    pub fn new(config: Config) -> Self {
15        let config_arc = Arc::new(config.clone());
16        Self {
17            config: config.clone(),
18            config_arc: config_arc.clone(),
19            v1: v1::V1::new(config),
20        }
21    }
22
23    /// 使用共享配置(实验性)
24    pub fn new_from_shared(shared: Arc<Config>) -> Self {
25        Self {
26            config: shared.as_ref().clone(),
27            config_arc: shared.clone(),
28            v1: v1::V1::new(shared.as_ref().clone()),
29        }
30    }
31}
32
33impl Service for BitableService {
34    fn config(&self) -> &Config {
35        &self.config
36    }
37
38    fn service_name() -> &'static str {
39        "bitable"
40    }
41
42    fn service_version() -> &'static str {
43        "v1"
44    }
45}