use crate::PlatformConfig;
use std::sync::Arc;
#[derive(Debug, Clone)]
pub struct AppEngineService {
config: Arc<PlatformConfig>,
}
impl AppEngineService {
pub fn new(config: Arc<PlatformConfig>) -> Self {
Self { config }
}
pub fn config(&self) -> Arc<PlatformConfig> {
self.config.clone()
}
pub fn v1(&self) -> crate::app_engine::apaas::v1::ApaasV1 {
crate::app_engine::apaas::v1::ApaasV1::new(self.config.clone())
}
}
pub mod apaas;
#[cfg(test)]
mod tests {
use crate::{PlatformConfig, app_engine::AppEngineService};
#[test]
fn test_service_creation() {
let config = PlatformConfig::builder()
.app_id("test_app_id")
.app_secret("test_app_secret")
.build();
let service = AppEngineService::new(std::sync::Arc::new(config));
assert_eq!(service.config().app_id(), "test_app_id");
}
}