| 1234567891011121314151617181920212223 |
- use bos_platform::clients::{uds::UdsClient, PlatformClient};
- use bos_scope::DbScopedSelect;
- use std::sync::Arc;
- #[derive(Clone)]
- pub struct AppState {
- /// 数据出入口:一律经 SEOH UDS,⛔ 自持数据库凭据直连。
- pub db: Arc<UdsClient>,
- pub platform: Arc<PlatformClient>,
- pub scope: Arc<DbScopedSelect>,
- pub bos_env: String,
- pub service_name: String,
- /// 本项目的项目空间 ID = 平台 `scope_type='end_user'` 的 `scope_id`。
- /// 建号类接口(`iam-user/user/create@v1`)必须自带作用域三元组,平台侧
- /// `ensure_end_user_env_stage` 缺一即 `11103` ⇒ BOS 无从由 JWT 之外的途径取得。
- pub project_id: String,
- /// 租户 ID(`uds.tenant_id`):平台 SJC/UME 的 `tenant_id` 必填项,
- /// UDS 数据面已用它拼 `uds.<schema>.<table>`,此处只供平台调度/消息面复用。
- pub tenant_id: String,
- /// 数据面环境二元组(`nonprod|prod` + `dev|test|prod`),与 UDS 取数同一口径。
- pub data_env: String,
- pub seoh_env: String,
- }
|