openlark_workflow/v1/
mod.rs1pub mod task;
11
12use openlark_core::config::Config;
13use std::sync::Arc;
14
15#[derive(Clone)]
17pub struct TaskV1 {
18 config: Arc<Config>,
19}
20
21impl TaskV1 {
22 pub fn new(config: Arc<Config>) -> Self {
24 Self { config }
25 }
26
27 pub fn task(&self) -> task::Task {
29 task::Task::new(self.config.clone())
30 }
31}
32
33#[cfg(test)]
34#[allow(unused_imports)]
35mod tests {
36 use super::*;
37 use std::sync::Arc;
38
39 fn create_test_config() -> Arc<Config> {
40 Arc::new(
41 Config::builder()
42 .app_id("test_app")
43 .app_secret("test_secret")
44 .build(),
45 )
46 }
47
48 #[test]
49 fn test_task_v1_new() {
50 let config = create_test_config();
51 let _task_v1 = TaskV1::new(config);
52 }
53
54 #[test]
55 fn test_task_v1_task() {
56 let config = create_test_config();
57 let task_v1 = TaskV1::new(config);
58 let _task = task_v1.task();
59 }
60}