From 0dbc9be215966c08383007002e1978279460ccc3 Mon Sep 17 00:00:00 2001
From: ljl <17743125563@163.com>
Date: Wed, 3 Jul 2024 15:01:56 +0800
Subject: [PATCH] iam:add ci org api.
---
.../supports/iam/src/console_interface/api.rs | 1 +
.../console_interface/api/iam_ci_org_api.rs | 64 +++++++++++++++++++
backend/supports/iam/src/iam_initializer.rs | 5 +-
3 files changed, 69 insertions(+), 1 deletion(-)
create mode 100644 backend/supports/iam/src/console_interface/api/iam_ci_org_api.rs
diff --git a/backend/supports/iam/src/console_interface/api.rs b/backend/supports/iam/src/console_interface/api.rs
index bb31f4356..2429398f7 100644
--- a/backend/supports/iam/src/console_interface/api.rs
+++ b/backend/supports/iam/src/console_interface/api.rs
@@ -3,6 +3,7 @@ pub mod iam_ci_app_api;
pub mod iam_ci_app_set_api;
pub mod iam_ci_cert_api;
pub mod iam_ci_open_api;
+pub mod iam_ci_org_api;
pub mod iam_ci_res_api;
pub mod iam_ci_role_api;
pub mod iam_ci_system_api;
diff --git a/backend/supports/iam/src/console_interface/api/iam_ci_org_api.rs b/backend/supports/iam/src/console_interface/api/iam_ci_org_api.rs
new file mode 100644
index 000000000..e91152f41
--- /dev/null
+++ b/backend/supports/iam/src/console_interface/api/iam_ci_org_api.rs
@@ -0,0 +1,64 @@
+use crate::basic::serv::iam_cert_serv::IamCertServ;
+use crate::basic::serv::iam_set_serv::IamSetServ;
+use crate::iam_constants;
+use bios_basic::helper::request_helper::try_set_real_ip_from_req_to_ctx;
+use bios_basic::rbum::dto::rbum_filer_dto::RbumSetTreeFilterReq;
+use bios_basic::rbum::dto::rbum_set_dto::RbumSetTreeResp;
+use bios_basic::rbum::helper::rbum_scope_helper::check_without_owner_and_unsafe_fill_ctx;
+use bios_basic::rbum::rbum_enumeration::RbumSetCateLevelQueryKind;
+use tardis::web::context_extractor::TardisContextExtractor;
+use tardis::web::poem::Request;
+use tardis::web::poem_openapi;
+use tardis::web::poem_openapi::param::Query;
+use tardis::web::web_resp::{TardisApiResult, TardisResp};
+
+#[derive(Clone, Default)]
+pub struct IamCiOrgApi;
+
+/// Interface Console Org API
+/// 接口控制台组织API
+#[poem_openapi::OpenApi(prefix_path = "/ci/org", tag = "bios_basic::ApiTag::Interface")]
+impl IamCiOrgApi {
+ /// Find Org Tree By Current Tenant
+ /// 查找组织树
+ ///
+ /// * Without parameters: Query the whole tree
+ /// * ``parent_sys_code=true`` : query only the next level. This can be used to query level by level when the tree is too large
+ /// * 无参数:查询整个树
+ /// * ``parent_sys_code=true``:仅查询下一级,当树太大时可以用来逐级查询
+ #[oai(path = "/tree", method = "get")]
+ async fn get_tree(
+ &self,
+ parent_sys_code: Query