meegle/finished/
api.rs

1use super::types::*;
2use crate::client::{AuthType, Client};
3use crate::error::ApiResult;
4
5pub trait FinishedApi {
6    /// 批量查询评审意见、评审结论
7    /// 该接口用于批量查询节点的评审意见和结论。
8    fn batch_query_finished(
9        &self,
10        request: BatchQueryFinishedRequest,
11        auth: AuthType,
12    ) -> impl std::future::Future<Output = ApiResult<BatchQueryFinishedResponse>> + Send;
13
14    /// 更新节点评审意见和结论
15    /// 该接口用于更新节点评审意见和结论,或执行置空操作。
16    fn update_finished(
17        &self,
18        request: UpdateFinishedRequest,
19        auth: AuthType,
20    ) -> impl std::future::Future<Output = ApiResult<UpdateFinishedResponse>> + Send;
21
22    /// 获取评审结论标签值
23    /// 该接口用于查询节点下配置的评审结论标签。
24    fn query_conclusion_option(
25        &self,
26        request: QueryConclusionOptionRequest,
27        auth: AuthType,
28    ) -> impl std::future::Future<Output = ApiResult<QueryConclusionOptionResponse>> + Send;
29}
30
31impl FinishedApi for Client {
32    async fn batch_query_finished(
33        &self,
34        request: BatchQueryFinishedRequest,
35        auth: AuthType,
36    ) -> ApiResult<BatchQueryFinishedResponse> {
37        Ok(self
38            .post("work_item/finished/batch_query", &request, auth)
39            .await?)
40    }
41
42    async fn update_finished(
43        &self,
44        request: UpdateFinishedRequest,
45        auth: AuthType,
46    ) -> ApiResult<UpdateFinishedResponse> {
47        Ok(self
48            .post("work_item/finished/update", &request, auth)
49            .await?)
50    }
51
52    async fn query_conclusion_option(
53        &self,
54        request: QueryConclusionOptionRequest,
55        auth: AuthType,
56    ) -> ApiResult<QueryConclusionOptionResponse> {
57        Ok(self
58            .post("work_item/finished/query_conclusion_option", &request, auth)
59            .await?)
60    }
61}