From c6f97ca1b41c329fa28c0cf4626b3c305fa4026f Mon Sep 17 00:00:00 2001 From: ljl <17743125563@163.com> Date: Mon, 5 Aug 2024 15:30:42 +0800 Subject: [PATCH] iam:fix batch remove app rel account. --- .../iam/src/console_app/api/iam_ca_app_api.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/supports/iam/src/console_app/api/iam_ca_app_api.rs b/backend/supports/iam/src/console_app/api/iam_ca_app_api.rs index 33d26abf9..2223281fb 100644 --- a/backend/supports/iam/src/console_app/api/iam_ca_app_api.rs +++ b/backend/supports/iam/src/console_app/api/iam_ca_app_api.rs @@ -74,4 +74,20 @@ impl IamCaAppApi { ctx.0.execute_task().await?; TardisResp::ok(Void {}) } + + /// Batch Delete App Rel Account + /// 批量删除应用关联账号 + #[oai(path = "/:id/account/batch/:account_ids", method = "delete")] + async fn batch_delete_rel_account(&self, id: Path, account_ids: Path, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult { + try_set_real_ip_from_req_to_ctx(request, &ctx.0).await?; + let mut funs = iam_constants::get_tardis_inst(); + funs.begin().await?; + let split = account_ids.0.split(',').collect::>(); + for s in split { + IamAppServ::delete_rel_account(&id.0, s, &funs, &ctx.0).await?; + } + funs.commit().await?; + ctx.0.execute_task().await?; + TardisResp::ok(Void {}) + } }