Skip to content

Commit

Permalink
iam:fix batch remove app rel account.
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Aug 5, 2024
1 parent cbd5eab commit c6f97ca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions backend/supports/iam/src/console_app/api/iam_ca_app_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>, account_ids: Path<String>, ctx: TardisContextExtractor, request: &Request) -> TardisApiResult<Void> {
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::<Vec<_>>();
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 {})
}
}

0 comments on commit c6f97ca

Please sign in to comment.