|
1 | 1 | use tardis::web::context_extractor::TardisContextExtractor;
|
2 |
| -use tardis::web::poem::web::Query; |
3 |
| -use tardis::web::poem_openapi; |
4 | 2 | use tardis::web::poem_openapi::payload::Json;
|
| 3 | +use tardis::web::poem_openapi::{self, param::Query}; |
5 | 4 | use tardis::web::web_resp::{TardisApiResult, TardisResp, Void};
|
6 | 5 | use tardis::{log, tokio};
|
7 | 6 |
|
@@ -53,18 +52,16 @@ impl FlowCiInstApi {
|
53 | 52 |
|
54 | 53 | /// Get list of instance id by rel_business_obj_id / 通过业务ID获取实例信息
|
55 | 54 | #[oai(path = "/find_detail_by_obj_ids", method = "get")]
|
56 |
| - async fn find_detail_by_obj_ids(&self, rel_business_obj_ids: Query<String>, ctx: TardisContextExtractor) -> TardisApiResult<Vec<FlowInstDetailResp>> { |
57 |
| - let mut funs = flow_constants::get_tardis_inst(); |
58 |
| - let rel_business_obj_ids: Vec<_> = rel_business_obj_ids.split(',').map(|id| id.to_string()).collect(); |
59 |
| - funs.begin().await?; |
| 55 | + async fn find_detail_by_obj_ids(&self, obj_ids: Query<String>, ctx: TardisContextExtractor) -> TardisApiResult<Vec<FlowInstDetailResp>> { |
| 56 | + let funs = flow_constants::get_tardis_inst(); |
| 57 | + let rel_business_obj_ids: Vec<_> = obj_ids.0.split(',').map(|id| id.to_string()).collect(); |
60 | 58 | let inst_ids = FlowInstServ::get_inst_ids_by_rel_business_obj_id(rel_business_obj_ids, &funs, &ctx.0).await?;
|
61 | 59 | let mut result = vec![];
|
62 | 60 | for inst_id in inst_ids {
|
63 |
| - if let Ok(inst_detail) = FlowInstServ::get(&inst_id, &funs, &ctx.0).await{ |
| 61 | + if let Ok(inst_detail) = FlowInstServ::get(&inst_id, &funs, &ctx.0).await { |
64 | 62 | result.push(inst_detail);
|
65 | 63 | }
|
66 | 64 | }
|
67 |
| - funs.commit().await?; |
68 | 65 | TardisResp::ok(result)
|
69 | 66 | }
|
70 | 67 |
|
|
0 commit comments