openlark_platform/
app_engine.rs1use crate::PlatformConfig;
6use std::sync::Arc;
7
8#[derive(Debug, Clone)]
12pub struct AppEngineService {
13 config: Arc<PlatformConfig>,
15}
16
17impl AppEngineService {
18 pub fn new(config: Arc<PlatformConfig>) -> Self {
20 Self { config }
21 }
22
23 pub fn config(&self) -> Arc<PlatformConfig> {
25 self.config.clone()
26 }
27
28 pub fn v1(&self) -> crate::app_engine::apaas::v1::ApaasV1 {
30 crate::app_engine::apaas::v1::ApaasV1::new(self.config.clone())
31 }
32}
33
34pub mod apaas;
35
36#[cfg(test)]
37mod tests {
38 use crate::{PlatformConfig, app_engine::AppEngineService};
39
40 #[test]
41 fn test_service_creation() {
42 let config = PlatformConfig::builder()
43 .app_id("test_app_id")
44 .app_secret("test_app_secret")
45 .build();
46
47 let service = AppEngineService::new(std::sync::Arc::new(config));
48 assert_eq!(service.config().app_id(), "test_app_id");
50 }
51}