Skip to main content

openlark_platform/app_engine/apaas/v1/user_task/
mod.rs

1//! 人工任务模块
2
3pub mod cc;
4pub mod chat_group;
5pub mod expediting;
6pub mod query;
7pub mod rollback;
8pub mod rollback_points;
9
10use openlark_core::config::Config;
11
12/// user_task 资源服务
13#[derive(Debug, Clone)]
14pub struct UserTaskService {
15    config: Config,
16}
17
18impl UserTaskService {
19    /// 创建新的 user_task 服务
20    pub fn new(config: Config) -> Self {
21        Self { config }
22    }
23
24    /// 查询用户任务
25    pub fn query(&self) -> query::UserTaskQueryRequestBuilder {
26        query::UserTaskQueryRequestBuilder::new(self.config.clone())
27    }
28
29    /// 抄送用户任务(接收 task_id 路径参数)
30    pub fn cc(&self, task_id: impl Into<String>) -> cc::CcTaskRequestBuilder {
31        cc::CcTaskRequestBuilder::new(self.config.clone(), task_id)
32    }
33
34    /// 催办用户任务(接收 task_id 路径参数)
35    pub fn expediting(&self, task_id: impl Into<String>) -> expediting::ExpeditingRequestBuilder {
36        expediting::ExpeditingRequestBuilder::new(self.config.clone(), task_id)
37    }
38
39    /// 创建群聊(接收 task_id 路径参数)
40    pub fn chat_group(&self, task_id: impl Into<String>) -> chat_group::ChatGroupRequestBuilder {
41        chat_group::ChatGroupRequestBuilder::new(self.config.clone(), task_id)
42    }
43
44    /// 获取退回节点列表(接收 task_id 路径参数)
45    pub fn rollback_points(
46        &self,
47        task_id: impl Into<String>,
48    ) -> rollback_points::RollbackPointsRequestBuilder {
49        rollback_points::RollbackPointsRequestBuilder::new(self.config.clone(), task_id)
50    }
51
52    /// 退回用户任务(接收 task_id 与 node_id 两个路径参数)
53    pub fn rollback(
54        &self,
55        task_id: impl Into<String>,
56        node_id: impl Into<String>,
57    ) -> rollback::RollbackTaskRequestBuilder {
58        rollback::RollbackTaskRequestBuilder::new(self.config.clone(), task_id, node_id)
59    }
60}