{
  "openapi": "3.0.3",
  "info": {
    "title": "Vion Platform Access Web API",
    "version": "0.1.0",
    "description": "**中文**\n\nVion 7.0 平台 Access 模块的 Web 页面接口契约，涵盖租户开通编排、本地角色与场所范围。\n超后台的 11 个管理操作仅允许平台管理员，租户后台的 17 个管理操作（含角色详情占位）仅允许平台管理员或当前租户管理员。\n两组管理操作分别由 Controller 类级 Authorize 角色声明保护，普通用户即使持有业务功能码也不能调用。\nWeb 使用 keycloak-js 公共客户端两阶段授权、直接换票与续期，登录完成确认后读取 BFF 只读授权视图，并由 SDK 发起标准退出。\n登录完成确认与显式平台管理目标校验分别执行各自的身份、租户资格校验。/auth/* 仅保留未迁移原生机密客户端的兼容协议，退役退出恢复接口返回 410。\n新 Authorize 声明内部角色与功能码按 OR，角色数组按 ANY、功能码数组按 ALL；类与方法声明同时满足。\n新声明允许平台管理员、本租户管理员按身份通过功能码条件，但不跳过认证、租户、资源和写前复核。\n移除旧注解，指标接口暂不加权限注解，保留认证和租户校验；本次不改变菜单、按钮、权限集合或授权配置上限。\n\n**English**\n\nVion 7.0 platform Access Web API contract covering tenant provisioning orchestration, local roles, and site scopes.\nOnly platform administrators may invoke the 11 platform administration operations. Only platform administrators or administrators of the current tenant may invoke the 17 tenant administration operations (including the role details placeholder).\nEach set of administration operations is protected by a controller class-level Authorize role declaration. Ordinary users cannot invoke them even if they hold the corresponding business permission codes.\nThe Web application uses keycloak-js with a public client for two-stage authorization, direct token exchange and refresh. After confirming login completion, it reads the BFF read-only authorization view. The SDK initiates standard logout.\nLogin completion confirmation and explicit platform management target validation each perform their own identity and tenant eligibility checks. The /auth/* routes retain only the compatibility protocol for unmigrated native confidential clients. Retired logout recovery endpoints return 410.\nWithin a new Authorize declaration, roles and permission codes are combined with OR. Role arrays use ANY and permission-code arrays use ALL. Both class-level and method-level declarations must be satisfied.\nThe new declarations allow platform administrators and administrators of the current tenant to satisfy permission-code conditions by their identity, without bypassing authentication, tenant and resource checks, or pre-write revalidation.\nThe old annotations are removed. Metric endpoints do not yet receive permission annotations and retain authentication and tenant checks. This change does not alter menus, buttons, permission sets, or authorization configuration ceilings."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "access",
      "description": "**中文**\n\n租户开通编排、本地角色与场所范围\n\n**English**\n\nTenant provisioning orchestration, local roles, and site scopes"
    }
  ],
  "x-java-raw-request-bodies": true,
  "x-doc-groups": [
    {
      "id": "tenant-login",
      "title": "业务租户登录确认 / Business Tenant Login Confirmation",
      "operations": [
        "confirmTenantLogin"
      ]
    },
    {
      "id": "platform-management-target",
      "title": "平台管理目标租户 / Platform Tenant Management Target",
      "operations": [
        "selectTenant"
      ]
    },
    {
      "id": "platform-tenants",
      "title": "平台租户管理 / Platform Tenant Administration",
      "operations": [
        "createTenant",
        "updateTenant",
        "disableTenant",
        "enableTenant"
      ]
    },
    {
      "id": "platform-tenant-authorization",
      "title": "平台租户授权 / Platform Tenant Entitlements",
      "operations": [
        "getTenantAuthorization",
        "updateTenantAuthorization"
      ]
    },
    {
      "id": "platform-users",
      "title": "平台全局用户管理 / Platform Global User Administration",
      "operations": [
        "listGlobalUsers",
        "updateGlobalUser",
        "resetGlobalUserPassword"
      ]
    },
    {
      "id": "platform-user-memberships",
      "title": "平台用户租户成员关系 / Platform User Tenant Memberships",
      "operations": [
        "getGlobalUserTenants",
        "updateGlobalUserTenants",
        "updateTenantAdmin"
      ]
    },
    {
      "id": "members",
      "title": "租户成员管理 / Tenant Member Administration",
      "operations": [
        "listMembers",
        "createMember",
        "updateMember",
        "removeMember"
      ]
    },
    {
      "id": "roles",
      "title": "租户本地角色 / Tenant Roles",
      "operations": [
        "listRoles",
        "getRole",
        "createRole",
        "updateRole",
        "deleteRole"
      ]
    },
    {
      "id": "role-authorization",
      "title": "租户角色授权 / Tenant Role Authorization",
      "operations": [
        "getRoleAuthorization",
        "updateRoleAuthorization"
      ]
    },
    {
      "id": "user-roles",
      "title": "租户成员角色分配 / Tenant Member Role Assignments",
      "operations": [
        "listUserRoles",
        "getUserRoleOptions",
        "replaceUserRoles"
      ]
    },
    {
      "id": "site-scopes",
      "title": "租户成员场所范围 / Tenant Member Site Scopes",
      "operations": [
        "listUserSiteScopes",
        "getSiteScopeOptions",
        "assignUserSiteScope"
      ]
    },
    {
      "id": "legacy-native-authentication",
      "title": "旧版原生客户端认证 / Legacy Native Client Authentication",
      "operations": [
        "beginLogin",
        "beginPlatformLogin",
        "completeLogin",
        "refreshAuthentication",
        "logoutAuthentication",
        "getLogoutStatus",
        "continueLogout",
        "completeLogout"
      ]
    }
  ],
  "paths": {
    "/api/platform/access/login/complete": {
      "post": {
        "operationId": "confirmTenantLogin",
        "tags": [
          "access"
        ],
        "summary": "确认所选租户的登录 / Confirm the selected tenant login",
        "description": "**中文**\n\n仅允许 Bearer 认证，不接受请求体、查询参数或 X-Tenant-Id 请求头。\n校验令牌中的唯一组织、当前成员资格和已启用的租户映射。\n仅在校验通过后记录 userId 和 organizationId。不执行令牌交换，也不建立服务端会话。\nWeb 使用 keycloak-js 公共客户端，先请求 openid profile email，读取 BFF 身份视图，并在 Web 对话框中选择租户。\n随后仅请求 openid profile email organization:<alias>，再调用本确认接口并读取 BFF 业务会话视图。alias 来自 BFF 返回的权威候选项。\nSDK 直接交换和刷新令牌，并发起标准退出。/auth/* 路由仅为尚未迁移的原生机密客户端保留。\n\n**English**\n\nBearer authentication only; no body, query parameters or X-Tenant-Id header.\nValidates the unique token organization, current membership and enabled tenant mapping.\nLogs userId and organizationId only after validation. No token exchange or server session.\nWeb uses keycloak-js with a public client, first requests openid profile email,\nreads the BFF identity view and selects a tenant in the Web dialog.\nIt then requests only openid profile email organization:<alias>, followed by this confirmation\nand the BFF business session view. The alias comes from the authoritative BFF candidate.\nThe SDK exchanges and refreshes tokens directly\nand initiates standard logout. The /auth/* routes are retained only for unmigrated native confidential clients.",
        "x-controller": "AccessContextController",
        "x-spring-provide-args": [
          "@org.springframework.web.bind.annotation.RequestBody(required = false) byte[] body",
          "jakarta.servlet.http.HttpServletRequest request"
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n租户登录确认成功。\n\n**English**\n\nTenant login confirmed",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginCompletionEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "success": true
                      },
                      "message": "OK",
                      "requestId": "10000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "description": "**中文**\n\n登录确认无效。\n\n**English**\n\nLogin confirmation invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 40101,
                      "data": null,
                      "message": "Invalid bearer token.",
                      "requestId": "10000000-0000-4000-8000-000000000001",
                      "reason": "INVALID_TOKEN",
                      "params": {}
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "**中文**\n\n登录确认被拒绝。\n\n**English**\n\nLogin confirmation denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 40301,
                      "data": null,
                      "message": "A unique organization is required.",
                      "requestId": "10000000-0000-4000-8000-000000000001",
                      "reason": "ORGANIZATION_REQUIRED",
                      "params": {}
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "**中文**\n\n登录确认服务不可用。\n\n**English**\n\nLogin confirmation unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "failure": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Identity service is unavailable.",
                      "requestId": "10000000-0000-4000-8000-000000000001",
                      "reason": "IDENTITY_UNAVAILABLE",
                      "params": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/access/session/tenant": {
      "post": {
        "description": "**中文**\n\n仅允许平台管理员调用。校验显式指定的管理目标租户，不保留当前租户状态。\nWeb 的业务组织切换使用 keycloak-js 组织授权，随后调用 POST /api/platform/access/login/complete 并读取 BFF 会话视图。\n\n**English**\n\nPlatform administrator only. Validate an explicit management target without retaining a current tenant.\nWeb business organization switching uses keycloak-js organization authorization, followed by\nPOST /api/platform/access/login/complete and the BFF session view.",
        "operationId": "selectTenant",
        "tags": [
          "access"
        ],
        "summary": "校验平台管理目标租户 / Validate a platform management tenant",
        "x-controller": "AccessContextController",
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelectTenantResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98"
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "description": "**中文**\n\n开通失败、远端清理未完成或提交结果未确认\n\n**English**\n\nProvisioning failed, remote cleanup is incomplete, or the commit outcome is unconfirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rolledBack": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Tenant creation failed. The new business record was rolled back.",
                      "reason": "IDENTITY_UNAVAILABLE",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  },
                  "cleanupIncomplete": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Tenant creation failed. Identity organization cleanup needs verification.",
                      "reason": "TENANT_PROVISIONING_INCOMPLETE",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  },
                  "commitUnconfirmed": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Tenant creation could not be confirmed. Verify the existing tenant before retrying.",
                      "reason": "TENANT_PROVISIONING_UNCONFIRMED",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectTenantRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/tenants": {
      "post": {
        "operationId": "createTenant",
        "tags": [
          "access"
        ],
        "summary": "开通租户 / Provision a tenant",
        "description": "**中文**\n\n仅平台超管可调用。首次 Masterdata 写入前开启本地事务，主档、资料、唯一组织映射和最终状态一次提交。\n提交前失败回滚本次新增记录，不保存失败的 PENDING 主档。PENDING 仅为新建事务内中间状态。\n按 tenantCode 协调开通；已存在 ACTIVE/DISABLED 同编码记录返回原资料和状态，不隐式启用。\n组织按 alias 精确分页匹配；409 后复查不获得本次新建归属。复用或归属未知的组织不得补偿删除。\n仅在本地确定未提交、组织确定由本次新建且未被使用时安全补偿；提交结果未知时先核实权威记录。\n远端清理未完成返回 TENANT_PROVISIONING_INCOMPLETE，提交结果未知返回 TENANT_PROVISIONING_UNCONFIRMED。\n历史 PENDING 不自动清理；按原编码显式重试失败时保留操作前的已有事实。tenantCode 创建后不可修改。\n\n**English**\n\nOnly platform administrators may invoke this operation. A local transaction starts before the first Masterdata write. The master record, profile, unique organization mapping, and final status are committed together.\nFailures before commit roll back records added by this attempt. Failed PENDING master records are not retained. PENDING is only an intermediate state within a new provisioning transaction.\nProvisioning is coordinated by tenantCode. An existing ACTIVE or DISABLED record with the same code returns its existing profile and status without implicitly enabling it.\nOrganizations are matched exactly by alias through pagination. A recheck after a 409 does not establish that the organization was created by this attempt. Reused organizations or organizations of unknown ownership must not be deleted as compensation.\nSafe compensation is allowed only when the local transaction is known to be uncommitted, the organization is confirmed to have been created by this attempt, and it is unused. If the commit outcome is unknown, first verify the authoritative record.\nAn incomplete remote cleanup returns TENANT_PROVISIONING_INCOMPLETE. An unknown commit outcome returns TENANT_PROVISIONING_UNCONFIRMED.\nHistorical PENDING records are not cleaned up automatically. If an explicit retry with the original code fails, the pre-existing state is preserved. tenantCode is immutable after creation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTenantRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "tenantCode": "hxl-demo",
                    "defaultTimezone": "Asia/Shanghai",
                    "firstDayOfWeek": 1,
                    "nameI18n": {},
                    "name": "好想来示例租户"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n开通后的租户主档\n\n**English**\n\nTenant master record after provisioning",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "tenantCode": "hxl-demo",
                        "defaultTimezone": "Asia/Shanghai",
                        "firstDayOfWeek": 1,
                        "status": "ACTIVE",
                        "nameI18n": {},
                        "name": "好想来示例租户"
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440323"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "description": "**中文**\n\n开通失败、远端清理未完成或提交结果未确认\n\n**English**\n\nProvisioning failed, remote cleanup is incomplete, or the commit outcome is unconfirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "rolledBack": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Tenant creation failed. The new business record was rolled back.",
                      "reason": "IDENTITY_UNAVAILABLE",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  },
                  "cleanupIncomplete": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Tenant creation failed. Identity organization cleanup needs verification.",
                      "reason": "TENANT_PROVISIONING_INCOMPLETE",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  },
                  "commitUnconfirmed": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Tenant creation could not be confirmed. Verify the existing tenant before retrying.",
                      "reason": "TENANT_PROVISIONING_UNCONFIRMED",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "PlatformAccessAdminController"
      }
    },
    "/api/platform/admin/access/tenants/{tenantId}/update": {
      "post": {
        "operationId": "updateTenant",
        "tags": [
          "access"
        ],
        "summary": "更新租户资料 / Update tenant profile",
        "description": "**中文**\n\ntenantCode 不可修改。不替换租户获授的菜单及功能权限、成员关系或生命周期状态。\n\n**English**\n\ntenantCode is immutable. Does not replace entitlements, member relations or lifecycle state.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n平台管理目标租户 ID。\n\n**English**\n\nTenant ID of the platform administration target."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "tenantCode": "tenant-alpha",
                        "nameI18n": {},
                        "status": "PENDING",
                        "firstDayOfWeek": 1,
                        "name": "Example name"
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "nameI18n": {},
                    "defaultTimezone": "Asia/Shanghai",
                    "name": "Tenant Alpha"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/tenants/{tenantId}/disable": {
      "post": {
        "operationId": "disableTenant",
        "tags": [
          "access"
        ],
        "summary": "停用租户并保留全部数据 / Disable a tenant without deleting any data",
        "description": "**中文**\n\n仅允许平台管理员调用。将租户生命周期状态设为 DISABLED 并同步身份组织的可用状态，保留租户及关联数据。\n\n**English**\n\nOnly platform administrators may invoke this operation. Set the tenant lifecycle status to DISABLED and synchronize identity organization availability, retaining the tenant and related data.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n平台管理目标租户 ID。\n\n**English**\n\nTenant ID of the platform administration target."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantStatusResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "status": "DISABLED"
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/admin/access/tenants/{tenantId}/enable": {
      "post": {
        "operationId": "enableTenant",
        "tags": [
          "access"
        ],
        "summary": "启用已完成开通的租户 / Enable an already provisioned tenant",
        "description": "**中文**\n\n仅允许平台管理员调用。租户必须处于有效期内，且必须确认其已有身份组织已启用，方可返回成功。\n\n**English**\n\nPlatform administrator only. The tenant must be within its validity period and its existing identity organization must be confirmed enabled before success is returned.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n平台管理目标租户 ID。\n\n**English**\n\nTenant ID of the platform administration target."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n租户和身份组织均已启用。\n\n**English**\n\nTenant and identity organization are enabled",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableTenantResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "status": "ACTIVE"
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "**中文**\n\n租户已过期、开通未完成或组织映射无效。\n\n**English**\n\nTenant has expired, provisioning is incomplete, or the organization mapping is invalid",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "expired": {
                    "value": {
                      "code": 40901,
                      "data": null,
                      "message": "Extend the tenant validity period before enabling it.",
                      "reason": "TENANT_EXPIRED",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "description": "**中文**\n\n无法确认身份组织可用。\n\n**English**\n\nIdentity organization availability could not be confirmed",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unavailable": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Identity organization availability could not be confirmed.",
                      "reason": "IDENTITY_UNAVAILABLE",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/tenants/{tenantId}/authorization": {
      "get": {
        "operationId": "getTenantAuthorization",
        "tags": [
          "access"
        ],
        "summary": "读取租户获授的菜单和功能权限 / Read tenant menu and permission entitlements",
        "description": "**中文**\n\n仅允许平台管理员调用。返回目标租户已获授的两类独立集合、可选应用及其菜单和功能权限。\n\n**English**\n\nOnly platform administrators may invoke this operation. Return the target tenant's two independent granted sets and the available applications with their menus and permissions.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n平台管理目标租户 ID。\n\n**English**\n\nTenant ID of the platform administration target."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationDetailEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "menuUids": [],
                        "permissionUids": [],
                        "apps": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/admin/access/tenants/{tenantId}/authorization/update": {
      "post": {
        "operationId": "updateTenantAuthorization",
        "tags": [
          "access"
        ],
        "summary": "原子替换租户获授的菜单和功能权限 / Atomically replace tenant menu and permission entitlements",
        "description": "**中文**\n\n仅允许平台管理员调用。撤销租户获授的菜单或功能权限时，在同一事务内撤销对应的角色授权。重新开放该项授权时不会自动恢复这些角色授权。\n\n**English**\n\nPlatform administrator only. Removing entitlement also removes corresponding role grants in the same transaction; reopening does not restore them.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n平台管理目标租户 ID。\n\n**English**\n\nTenant ID of the platform administration target."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "menuUids": [],
                        "permissionUids": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationSelectionRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "menuUids": [],
                    "permissionUids": []
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/users": {
      "get": {
        "operationId": "listGlobalUsers",
        "tags": [
          "access"
        ],
        "summary": "查询全局用户及其完整租户成员关系 / List global users with complete tenant memberships",
        "description": "**中文**\n\n仅允许平台管理员调用，无需选择租户。身份源出现故障时必须返回错误，绝不能返回空成员关系列表。\n\n**English**\n\nPlatform administrator only, no selected tenant required. Identity-source failure is an error, never an empty membership list.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "**中文**\n\n传递至身份源的全局用户搜索词，可按用户名、姓名或电子邮箱搜索。\n\n**English**\n\nSearch term passed to the identity source for global users, supporting search by username, name, or email."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "**中文**\n\n本页最多返回的记录条数。\n\n**English**\n\nMaximum number of records returned in this page."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "**中文**\n\n本页之前跳过的记录条数。\n\n**English**\n\nNumber of records skipped before this page."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalUserPageEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [],
                        "page": {
                          "limit": 1,
                          "offset": 0,
                          "hasMore": false
                        }
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/admin/access/users/{userId}/update": {
      "post": {
        "operationId": "updateGlobalUser",
        "tags": [
          "access"
        ],
        "summary": "更新全局用户资料和状态 / Update global account profile and status",
        "description": "**中文**\n\n仅允许平台管理员调用。更新明确提交的共享用户资料或全局启用状态。不得停用调用者本人或平台管理员。\n\n**English**\n\nOnly platform administrators may invoke this operation. Update explicitly supplied shared user profile fields or global enabled status. The caller and platform administrators must not be disabled.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalUserProfileEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "displayName": "Alex Chen",
                        "email": "alex@example.com",
                        "enabled": false
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGlobalUserRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "displayName": "Alex Chen",
                    "email": "alex@example.com",
                    "enabled": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/users/{userId}/reset-password": {
      "post": {
        "operationId": "resetGlobalUserPassword",
        "tags": [
          "access"
        ],
        "summary": "重置全局用户密码 / Reset a global account password",
        "description": "**中文**\n\n仅允许平台管理员调用。为目标全局用户重置密码，密码及临时密码标记按身份源规则处理。\n\n**English**\n\nOnly platform administrators may invoke this operation. Reset the target global user's password, applying identity-source rules to the password and temporary-password flag.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetPasswordResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "reset": false
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetGlobalUserPasswordRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "password": "Example-password-123",
                    "temporary": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/users/{userId}/tenants": {
      "get": {
        "operationId": "getGlobalUserTenants",
        "tags": [
          "access"
        ],
        "summary": "读取全局用户的完整租户成员关系 / Read complete global user tenant memberships",
        "description": "**中文**\n\n仅允许平台管理员调用，无需选择当前业务租户。返回目标全局用户在平台已有租户中的完整成员关系。\n\n**English**\n\nOnly platform administrators may invoke this operation, without selecting a current business tenant. Return the target global user's complete memberships in platform tenants.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalUserTenantsEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "items": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "updateGlobalUserTenants",
        "tags": [
          "access"
        ],
        "summary": "按显式差量更新已有全局用户的租户成员关系 / Update an existing global account tenant memberships by explicit differences",
        "description": "**中文**\n\n先校验全部目标，再应用显式且互不相交的 addTenantIds 与 removeTenantIds。已存在的新增关系与已不存在的移除关系均为幂等操作，移除已不存在的关系仍会清理本地授权。\n新增要求租户可用，且绝不授予管理员身份、本地角色或场所范围。移除仅清理目标租户的管理员成员关系、组织成员关系、用户角色绑定及直接数据授权。保留共享全局用户及其他租户。\n无变更的空数组返回当前成员关系。无效字段或两个数组相交返回 422。新增目标租户不可用或受管理成员关系无法安全移除时，在写入前返回 409。\n跨系统写入不具备原子性。更新结果未确认或仅部分完成时，返回 503 并附 MEMBERSHIP_UPDATE_INCOMPLETE，调用方应刷新成员关系状态并重试原命令。不切换当前业务租户。\n\n**English**\n\nApplies explicit, disjoint addTenantIds and removeTenantIds after validating all targets. Existing additions and absent removals are idempotent; absent removals still clean local grants. Additions require an available tenant and never grant administrator status, roles or site scope. Removals clear only the target tenant administrator membership, organization membership, user role bindings and direct data grants. Shared accounts and other tenants are preserved. No-op arrays return the current memberships. Invalid fields or intersecting arrays return 422; unavailable additions or unsafe managed removals return 409 before writes. Cross-system writes are not atomic. An unconfirmed or partially completed update returns 503 with MEMBERSHIP_UPDATE_INCOMPLETE; refresh membership state and retry the original command. Does not switch the current business tenant.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalUserTenantsEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "items": [
                          {
                            "tenantId": "01a2319e-2164-7715-bb2b-bbcaaf55baab",
                            "tenantCode": "tenant-b",
                            "nameI18n": {},
                            "status": "ACTIVE",
                            "name": "Tenant B"
                          }
                        ]
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "**中文**\n\n受管理的成员关系无法安全变更，或目标租户不可用。\n\n**English**\n\nUnsafe managed membership or unavailable target tenant",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "conflict": {
                    "value": {
                      "code": 40901,
                      "data": null,
                      "message": "Managed membership cannot be safely removed.",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "**中文**\n\n成员关系差量请求无效。\n\n**English**\n\nInvalid membership difference request",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalid": {
                    "value": {
                      "code": 42201,
                      "data": null,
                      "message": "Tenant ID arrays must be unique and disjoint.",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "description": "**中文**\n\n成员关系更新未完成或依赖不可用。\n\n**English**\n\nMembership update incomplete or dependency unavailable",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "incomplete": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Membership update could not be confirmed. Refresh and retry the original changes.",
                      "requestId": "00000000-0000-4000-8000-000000000001",
                      "reason": "MEMBERSHIP_UPDATE_INCOMPLETE"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGlobalUserTenantsRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "addTenantIds": [
                      "01a2319e-2164-7715-bb2b-bbcaaf55baab"
                    ],
                    "removeTenantIds": [
                      "01a2319e-215e-74f1-b5e0-b9650e2a3f98"
                    ]
                  }
                },
                "noChanges": {
                  "value": {
                    "addTenantIds": [],
                    "removeTenantIds": []
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/admin/access/users/{userId}/tenant-admin/update": {
      "post": {
        "operationId": "updateTenantAdmin",
        "tags": [
          "access"
        ],
        "summary": "授予或撤销租户管理员身份 / Grant or revoke tenant administrator identity",
        "description": "**中文**\n\n仅允许平台管理员调用，当前目标租户必须有效。更新的是身份源的管理员组，而非本地 roleUids。\n\n**English**\n\nPlatform administrator only; current target tenant must be valid. Updates the identity-source administrator group, not local roleUids.",
        "x-controller": "PlatformAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantAdminResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "tenantAdmin": false
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTenantAdminRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "enabled": false
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/access/members": {
      "get": {
        "operationId": "listMembers",
        "tags": [
          "access"
        ],
        "summary": "查询当前租户成员 / List current tenant members",
        "description": "**中文**\n\n返回当前租户的身份源成员分页列表，并补充本地角色、租户管理员身份和调用方允许的管理动作。\n\n**English**\n\nReturn a page of identity-source members of the current tenant, enriched with local role assignments, tenant administrator identity, and the caller's allowed administration actions.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "**中文**\n\n传递至身份源的当前租户成员搜索词。\n\n**English**\n\nSearch term passed to the identity source for members of the current tenant."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "**中文**\n\n本页最多返回的记录条数。\n\n**English**\n\nMaximum number of records returned in this page."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "**中文**\n\n本页之前跳过的记录条数。\n\n**English**\n\nNumber of records skipped before this page."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberPageEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [],
                        "page": {
                          "limit": 1,
                          "offset": 0,
                          "hasMore": false
                        }
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      },
      "post": {
        "operationId": "createMember",
        "tags": [
          "access"
        ],
        "summary": "新建全局用户并加入当前租户 / Create a new account and join the current tenant",
        "description": "**中文**\n\n已有 username 时返回 409。不接受 userId 模式。不隐式授予本地角色、管理员身份或场所范围。使用已确认的创建资源标识加入当前租户。\n如果全局用户创建或租户成员关系仅部分完成或结果未确认，则返回 503 / USER_CREATE_INCOMPLETE。\n全局用户可能已经存在。平台管理员必须在全局用户列表中核实该用户并管理其租户成员关系，租户管理员则必须联系平台管理员。绝不能自动接纳已经存在的 username。\n未确认的创建归属或成员资格不构成删除全局用户的授权。\n\n**English**\n\nReject existing username with 409. userId mode is not accepted. No implicit roles, administrator identity\nor site scope is granted. Use the confirmed creation resource identifier to join the current tenant.\nIf account creation or membership is only partially completed or unconfirmed, return 503 / USER_CREATE_INCOMPLETE.\nThe account may already exist. A platform administrator must verify it in global users and manage its tenants;\na tenant administrator must contact the platform administrator. Never automatically adopt an existing username.\nUnconfirmed ownership or membership does not authorize account deletion.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "username": "alex",
                        "displayName": "Alex Chen",
                        "email": "alex@example.com",
                        "enabled": false,
                        "roleUids": [],
                        "tenantAdmin": false,
                        "allowedActions": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "description": "**中文**\n\n全局用户创建或租户成员关系未完成，或结果未确认。\n\n**English**\n\nAccount creation or tenant membership is incomplete or unconfirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "incomplete": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Account creation or tenant membership could not be confirmed. Ask a platform administrator to verify global users and manage tenant membership.",
                      "reason": "USER_CREATE_INCOMPLETE",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  },
                  "creationFailed": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Account creation failed and the new unused account was removed. Retry creation.",
                      "reason": "USER_CREATE_FAILED",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "username": "alex",
                    "displayName": "Alex Chen",
                    "email": "alex@example.com",
                    "password": "Example-password-123"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/access/members/{userId}/update": {
      "post": {
        "operationId": "updateMember",
        "tags": [
          "access"
        ],
        "summary": "更新租户成员的共享用户资料 / Update a tenant member shared profile",
        "description": "**中文**\n\n仅接受 displayName 和 email。禁止传入 username、enabled、password、roles 和 scope。变更作用于共享的全局用户。\n\n**English**\n\nOnly displayName and email are accepted. Username, enabled, password, roles and scope are forbidden. Changes affect the shared account.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberProfileEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "displayName": "Alex Chen",
                        "email": "alex@example.com"
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "displayName": "Alex Chen",
                    "email": "alex@example.com"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/access/members/{userId}/remove": {
      "post": {
        "operationId": "removeMember",
        "tags": [
          "access"
        ],
        "summary": "移除租户成员关系并保留全局用户 / Remove membership while retaining the global account",
        "description": "**中文**\n\n移除本人、受保护的管理员或无法安全移除的受管理成员关系时返回 409。保留其他租户的成员关系及授权。\n\n**English**\n\nReject self-removal, protected administrators and managed memberships that cannot be safely removed with 409. Preserve other tenant memberships and grants.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RemoveMemberResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "removed": false
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/access/roles": {
      "get": {
        "operationId": "listRoles",
        "tags": [
          "access"
        ],
        "summary": "查询当前租户的业务角色与内置管理员 / List current tenant business roles and built-in administrators",
        "description": "**中文**\n\nitems 返回 mst_role 本地角色；builtinRoles 返回当前 Organization 的只读管理员摘要，不包含本地 roleUid，查询不写入身份源。\n\n**English**\n\nitems contains local mst_role roles. builtinRoles contains read-only administrator summaries for the current Organization, without local roleUid values. The query does not write to the identity source.",
        "responses": {
          "200": {
            "description": "**中文**\n\n本地角色与内置管理员列表\n\n**English**\n\nList of local roles and built-in administrators",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleListEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [
                          {
                            "roleUid": "3f212b18-a24f-5259-8a1d-2602a45ab26e",
                            "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                            "status": 1,
                            "nameI18n": {},
                            "userCount": 2,
                            "name": "场所查看员"
                          }
                        ],
                        "builtinRoles": [
                          {
                            "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                            "code": "tenant_admin",
                            "nameI18n": {},
                            "isBuiltin": true,
                            "status": 1,
                            "userCount": 1,
                            "name": "Tenant administrator"
                          }
                        ]
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440326"
                    }
                  },
                  "builtinOnly": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [],
                        "builtinRoles": [
                          {
                            "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                            "code": "tenant_admin",
                            "nameI18n": {},
                            "isBuiltin": true,
                            "status": 1,
                            "userCount": 1,
                            "name": "Tenant administrator"
                          }
                        ]
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440326"
                    }
                  },
                  "unassignedBuiltin": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [],
                        "builtinRoles": [
                          {
                            "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                            "code": "tenant_admin",
                            "nameI18n": {},
                            "isBuiltin": true,
                            "status": 1,
                            "userCount": 0,
                            "name": "Tenant administrator"
                          }
                        ]
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440326"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "**中文**\n\n管理员组缺失、歧义或缺少内置角色绑定。\n\n**English**\n\nAdministrator group missing or ambiguous, or built-in role binding missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalidAdministratorGroup": {
                    "value": {
                      "code": 40901,
                      "data": null,
                      "message": "Administrator group configuration is invalid.",
                      "reason": "ADMIN_GROUP_CONFLICT",
                      "requestId": "550e8400-e29b-41d4-a716-446655440326"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "503": {
            "description": "**中文**\n\n身份源不可用或成员分页无法完整读取。\n\n**English**\n\nIdentity source unavailable or member pagination cannot be read completely.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "identityUnavailable": {
                    "value": {
                      "code": 50301,
                      "data": null,
                      "message": "Identity service is unavailable.",
                      "reason": "IDENTITY_UNAVAILABLE",
                      "requestId": "550e8400-e29b-41d4-a716-446655440326"
                    }
                  }
                }
              }
            }
          }
        },
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          }
        ]
      },
      "post": {
        "operationId": "createRole",
        "tags": [
          "access"
        ],
        "summary": "新增当前租户的本地角色 / Create a local role in the current tenant",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRoleRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "nameI18n": {},
                    "name": "场所查看员"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n新建的本地角色\n\n**English**\n\nNewly created local role",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "roleUid": "3f212b18-a24f-5259-8a1d-2602a45ab26e",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "status": 1,
                        "nameI18n": {},
                        "name": "场所查看员"
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440327"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          }
        ],
        "description": "**中文**\n\n在当前租户创建本地角色，提交基础名称及可选的完整翻译字典。内置管理员身份由身份源维护。\n\n**English**\n\nCreate a local role in the current tenant with a base name and an optional complete translation dictionary. Built-in administrator identity is maintained by the identity source."
      }
    },
    "/api/platform/access/roles/{roleUid}": {
      "get": {
        "operationId": "getRole",
        "tags": [
          "access"
        ],
        "summary": "查询本地角色编辑详情 / Read local role details for editing",
        "description": "**中文**\n\n从可信租户上下文取得 tenantId，以 tenantId 和 roleUid 联合查询本地角色。仅平台管理员或当前租户管理员可读取。\n无权读取返回 403，当前租户内找不到角色返回 404。\n\n**English**\n\nObtain tenantId from the trusted tenant context and query the local role by tenantId and roleUid together. Only platform administrators or administrators of the current tenant may read it.\nReturn 403 if reading is unauthorized, or 404 if the role is not found within the current tenant.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "roleUid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n当前租户内目标本地角色的 UID。\n\n**English**\n\nUID of the target local role in the current tenant."
          },
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n角色基础名称及完整翻译字典\n\n**English**\n\nRole base name and complete translation dictionary",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "roleUid": "3f212b18-a24f-5259-8a1d-2602a45ab26e",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "status": 1,
                        "nameI18n": {},
                        "name": "场所查看员"
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440327"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        }
      }
    },
    "/api/platform/access/roles/{roleUid}/update": {
      "post": {
        "operationId": "updateRole",
        "tags": [
          "access"
        ],
        "summary": "更新本地角色名称和状态 / Update local role name and status",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "roleUid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n当前租户内目标本地角色的 UID。\n\n**English**\n\nUID of the target local role in the current tenant."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRoleRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "status": 1,
                    "nameI18n": {},
                    "name": "场所报表查看员"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n更新后的本地角色\n\n**English**\n\nUpdated local role",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "roleUid": "3f212b18-a24f-5259-8a1d-2602a45ab26e",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "status": 1,
                        "nameI18n": {},
                        "name": "场所报表查看员"
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440328"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "x-controller": "TenantAccessAdminController",
        "description": "**中文**\n\n修改当前租户的可编辑本地角色。修改名称时须同时提交基础名称与完整翻译字典，允许仅更新状态。平台预置角色不可通过本地角色接口修改。\n\n**English**\n\nEdit a mutable local role in the current tenant. When changing the name, supply both the base name and the complete translation dictionary. Status-only updates are allowed. Platform built-in roles cannot be edited through the local role endpoint."
      }
    },
    "/api/platform/access/roles/{roleUid}/delete": {
      "post": {
        "operationId": "deleteRole",
        "tags": [
          "access"
        ],
        "summary": "删除未分配给用户的本地角色 / Delete an unassigned local role",
        "description": "**中文**\n\n存在任何用户角色绑定时均阻止删除，并返回 409。不自动解除用户角色绑定。\n\n**English**\n\nAny user-role binding prevents deletion with 409. No automatic unassignment.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "roleUid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n当前租户内目标本地角色的 UID。\n\n**English**\n\nUID of the target local role in the current tenant."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteRoleResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "roleUid": "3f212b18-a24f-5259-8a1d-2602a45ab26e",
                        "deleted": false
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/access/roles/{roleUid}/authorization": {
      "get": {
        "operationId": "getRoleAuthorization",
        "tags": [
          "access"
        ],
        "summary": "读取角色的菜单和功能权限授权 / Read role menu and permission authorization",
        "description": "**中文**\n\n读取当前租户本地角色已获授的菜单和功能权限，以及受租户授权和调用方授权上限约束的候选项。\n\n**English**\n\nRead the menus and permissions granted to a local role in the current tenant, along with candidates limited by tenant entitlements and the caller's authorization ceiling.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "roleUid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n当前租户内目标本地角色的 UID。\n\n**English**\n\nUID of the target local role in the current tenant."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationDetailEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "menuUids": [],
                        "permissionUids": [],
                        "apps": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/access/roles/{roleUid}/authorization/update": {
      "post": {
        "operationId": "updateRoleAuthorization",
        "tags": [
          "access"
        ],
        "summary": "原子替换角色的菜单和功能权限授权 / Atomically replace role menu and permission authorization",
        "description": "**中文**\n\n菜单集合与功能权限集合相互独立，两者都必须提供，且受当前租户获授范围约束。没有 expectedVersion 字段。\n\n**English**\n\nMenu and permission sets are independent, both required and constrained by current tenant entitlements. No expectedVersion field.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "roleUid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n当前租户内目标本地角色的 UID。\n\n**English**\n\nUID of the target local role in the current tenant."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthorizationResultEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "menuUids": [],
                        "permissionUids": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationSelectionRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "menuUids": [],
                    "permissionUids": []
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/platform/access/users/{userId}/roles": {
      "get": {
        "operationId": "listUserRoles",
        "tags": [
          "access"
        ],
        "summary": "查询用户在当前租户的本地角色 / Read a user's local roles in the current tenant",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n用户本地角色分配\n\n**English**\n\nUser's local role assignments",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRolesEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "roleUids": [
                          "3f212b18-a24f-5259-8a1d-2602a45ab26e"
                        ],
                        "tenantAdmin": false
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440329"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "x-controller": "TenantAccessAdminController",
        "description": "**中文**\n\n返回当前租户成员获授的本地角色 UID，并独立返回身份源中的租户管理员状态。\n\n**English**\n\nReturn the local role UIDs assigned to a member of the current tenant and the separate tenant administrator status from the identity source."
      }
    },
    "/api/platform/access/users/{userId}/role-options": {
      "get": {
        "operationId": "getUserRoleOptions",
        "tags": [
          "access"
        ],
        "summary": "读取租户成员可分配的角色 / Read assignable roles for a tenant member",
        "description": "**中文**\n\n返回候选角色及分配操作，不加载组织单元或场所。\n\n**English**\n\nReturns role candidates and assignment actions without loading organization units or sites.",
        "x-controller": "TenantAccessAdminController",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRoleOptionsEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "roles": [],
                        "builtinRoles": [],
                        "allowedActions": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/access/users/{userId}/roles/update": {
      "post": {
        "operationId": "replaceUserRoles",
        "tags": [
          "access"
        ],
        "summary": "替换用户在当前租户的本地角色 / Replace a user's local roles in the current tenant",
        "description": "**中文**\n\n在同一事务内替换 rel_user_role 中该用户的角色分配。所有角色须属于当前租户，roleUids 传空数组时清空分配。\n\n**English**\n\nReplace the role assignments of this user in rel_user_role within one transaction. All roles must belong to the current tenant. An empty roleUids array clears the assignments.",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceUserRolesRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "roleUids": [
                      "3f212b18-a24f-5259-8a1d-2602a45ab26e"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n替换后的角色分配\n\n**English**\n\nRole assignments after replacement",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserRolesEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "roleUids": [
                          "3f212b18-a24f-5259-8a1d-2602a45ab26e"
                        ],
                        "tenantAdmin": false
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440330"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "x-controller": "TenantAccessAdminController"
      }
    },
    "/api/platform/access/site-scopes": {
      "get": {
        "operationId": "listUserSiteScopes",
        "tags": [
          "access"
        ],
        "summary": "查询租户内用户场所范围列表 / List user site scopes within the tenant",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "description": "**中文**\n\n按认证中心用户标识筛选。\n\n**English**\n\nFilter by the identity provider user identifier.",
            "schema": {
              "$ref": "#/components/schemas/IdString"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n用户场所范围列表\n\n**English**\n\nList of user site scopes",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSiteScopeListEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [
                          {
                            "userId": "kc-user-001",
                            "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                            "scopeType": "ORG_UNIT",
                            "scopeIds": [
                              "01a2319e-215e-74f1-b5e0-b964d945b260"
                            ]
                          }
                        ]
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440303"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "x-controller": "TenantAccessAdminController",
        "description": "**中文**\n\n查询当前租户内存储的直接场所范围授权。可按单个用户查询，无直接授权记录的用户不会出现在结果中。\n\n**English**\n\nRead stored direct site-scope grants within the current tenant. An optional user identifier narrows the query. Users without direct grant records are absent from the result."
      }
    },
    "/api/platform/access/site-scopes/{userId}/options": {
      "get": {
        "operationId": "getSiteScopeOptions",
        "tags": [
          "access"
        ],
        "summary": "分页读取租户成员的候选场所范围 / Read paged site-scope candidates for a tenant member",
        "description": "**中文**\n\n读取 orgUnitsPage 和 sitesPage 并继续分页。省略的分页结果绝不能视为完整选择范围。分配时会重新校验候选项。\n\n**English**\n\nRead orgUnitsPage and sitesPage and continue pagination; an omitted page is never a complete selection. Candidates are revalidated on assignment.",
        "x-controller": "TenantAccessAdminController",
        "x-spring-provide-args": [
          "jakarta.servlet.http.HttpServletRequest request"
        ],
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "orgUnitSearch",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "**中文**\n\n按组织单元基础名称搜索候选项。\n\n**English**\n\nSearch org unit candidates by their base name."
          },
          {
            "name": "orgUnitLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "**中文**\n\n组织单元候选页的最大条数。\n\n**English**\n\nMaximum number of org unit candidates per page."
          },
          {
            "name": "orgUnitOffset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "**中文**\n\n组织单元候选页之前跳过的条数。\n\n**English**\n\nNumber of org unit candidates skipped before this page."
          },
          {
            "name": "siteSearch",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "**中文**\n\n按场所基础名称搜索候选项。\n\n**English**\n\nSearch site candidates by their base name."
          },
          {
            "name": "siteLimit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "description": "**中文**\n\n场所候选页的最大条数。\n\n**English**\n\nMaximum number of site candidates per page."
          },
          {
            "name": "siteOffset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            },
            "description": "**中文**\n\n场所候选页之前跳过的条数。\n\n**English**\n\nNumber of site candidates skipped before this page."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n请求成功。\n\n**English**\n\nSuccess",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteScopeOptionsEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "allowedScopeTypes": [],
                        "orgUnits": [],
                        "sites": [],
                        "orgUnitsPage": {
                          "limit": 1,
                          "offset": 0,
                          "hasMore": false
                        },
                        "sitesPage": {
                          "limit": 1,
                          "offset": 0,
                          "hasMore": false
                        },
                        "allowedActions": []
                      },
                      "message": "OK",
                      "requestId": "00000000-0000-4000-8000-000000000001"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/api/platform/access/site-scopes/{userId}/update": {
      "post": {
        "operationId": "assignUserSiteScope",
        "tags": [
          "access"
        ],
        "summary": "分配或更新用户场所范围 / Assign or update a user's site scope",
        "parameters": [
          {
            "name": "X-Tenant-Id",
            "in": "header",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n请求的租户。在已认证令牌尚未选择租户时必须提供。服务端验证当前身份、成员资格和租户资格。\n\n**English**\n\nRequested tenant, required if the authenticated token does not already select one. The server verifies current identity, membership, and tenant eligibility."
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/IdString"
            },
            "description": "**中文**\n\n目标用户的认证中心主体标识。\n\n**English**\n\nIdentity provider subject identifier of the target user."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignUserSiteScopeRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "scopeType": "ORG_UNIT",
                    "scopeIds": [
                      "01a2319e-215e-74f1-b5e0-b964d945b260"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n更新后的用户场所范围\n\n**English**\n\nUpdated user site scope",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSiteScopeEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "userId": "kc-user-001",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "scopeType": "ORG_UNIT",
                        "scopeIds": [
                          "01a2319e-215e-74f1-b5e0-b964d945b260"
                        ]
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440304"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          }
        },
        "x-controller": "TenantAccessAdminController",
        "description": "**中文**\n\n在当前租户替换成员的直接场所范围，须在调用方可授予的范围内。ALL、ORG_UNIT、SITE 三选一，显式传入 ORG_UNIT/SITE 与空 scopeIds 清空直接授权。\n\n**English**\n\nReplace the member's direct site scope in the current tenant within the caller's grantable scope. Select one of ALL, ORG_UNIT, or SITE. An explicit ORG_UNIT or SITE with empty scopeIds clears direct grants."
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "beginLogin",
        "tags": [
          "access"
        ],
        "summary": "发起旧版原生客户端组织授权 / Begin legacy native organization authorization",
        "x-controller": "AuthenticationController",
        "x-spring-provide-args": [
          "jakarta.servlet.http.HttpServletRequest request",
          "jakarta.servlet.http.HttpServletResponse response"
        ],
        "security": [],
        "description": "**中文**\n\n仅为尚未迁移的原生机密客户端保留。不接受请求体或查询参数。\n使用带 PKCE S256 的授权码流程。请求头仅用于选择固定的客户端和回调地址。\n返回 200 后，由旧版调用方打开 authorizationUrl。Web 改用 keycloak-js。\n\n**English**\n\nRetained only for unmigrated native confidential clients. No request body or query parameters.\nUses authorization code with PKCE S256. Header selects only a fixed client and callback.\nReturns 200; the legacy caller opens authorizationUrl. Web uses keycloak-js instead.",
        "parameters": [
          {
            "name": "X-Client-Type",
            "in": "header",
            "required": false,
            "description": "**中文**\n\n选择已注册的固定旧版客户端配置，不作为身份或权限证明。\n为保持传输协议兼容，保留已有的配置名称及默认值。web 值并不表示当前的 Web 公共客户端 SDK 集成。\n\n**English**\n\nSelects a fixed registered legacy client profile; not an identity or permission proof.\nExisting profile names and defaults are retained for wire compatibility. The web value does not\ndescribe the current public Web SDK integration.",
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "ios",
                "android"
              ],
              "default": "web"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n登录事务 Cookie 和固定授权 URL。业务授权范围包含 organization。\n\n**English**\n\nLogin transaction cookie and fixed authorization URL. The business scope includes organization.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              },
              "Set-Cookie": {
                "description": "**中文**\n\n采用认证加密的短时登录事务 Cookie。生产环境中为 Secure 和 HttpOnly，并使用 SameSite=Lax、仅当前主机及 Path=/。不包含用户令牌。\n\n**English**\n\nAuthenticated-encrypted short-lived login transaction cookie. Secure and HttpOnly in production, SameSite=Lax, host-only, Path=/. Contains no user tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthLoginResponse"
                },
                "examples": {
                  "success": {
                    "value": {
                      "authorizationUrl": "https://identity.example.com/realms/vion-platform/protocol/openid-connect/auth?client_id=native-legacy-example&response_type=code&redirect_uri=https%3A%2F%2Fnative.example.com%2Flogin%2Fcallback&scope=openid%20profile%20email%20organization&state=state-placeholder&nonce=nonce-placeholder&code_challenge=challenge-placeholder&code_challenge_method=S256&ui_locales=en"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/auth/platform/login": {
      "post": {
        "operationId": "beginPlatformLogin",
        "tags": [
          "access"
        ],
        "summary": "发起旧版原生客户端平台管理员授权 / Begin legacy native platform administrator authorization",
        "x-controller": "AuthenticationController",
        "x-spring-provide-args": [
          "jakarta.servlet.http.HttpServletRequest request",
          "jakarta.servlet.http.HttpServletResponse response"
        ],
        "security": [],
        "description": "**中文**\n\n仅为尚未迁移的原生机密客户端保留。不接受请求体，也不请求 organization 授权范围。\n回调必须验证平台管理员身份。Web 改用 keycloak-js。\n\n**English**\n\nRetained only for unmigrated native confidential clients. No request body or organization scope;\ncallback must verify platform administrator identity. Web uses keycloak-js instead.",
        "parameters": [
          {
            "name": "X-Client-Type",
            "in": "header",
            "required": false,
            "description": "**中文**\n\n选择已注册的固定旧版客户端配置，不作为身份或权限证明。\n为保持传输协议兼容，保留已有的配置名称及默认值。web 值并不表示当前的 Web 公共客户端 SDK 集成。\n\n**English**\n\nSelects a fixed registered legacy client profile; not an identity or permission proof.\nExisting profile names and defaults are retained for wire compatibility. The web value does not\ndescribe the current public Web SDK integration.",
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "ios",
                "android"
              ],
              "default": "web"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n旧版登录事务 Cookie 和固定平台授权 URL，不含 organization 授权范围。\n\n**English**\n\nLegacy login transaction cookie and fixed platform authorization URL without organization scope.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              },
              "Set-Cookie": {
                "description": "**中文**\n\n采用认证加密的短时登录事务 Cookie。生产环境中为 Secure 和 HttpOnly，并使用 SameSite=Lax、仅当前主机及 Path=/。不包含用户令牌。\n\n**English**\n\nAuthenticated-encrypted short-lived login transaction cookie. Secure and HttpOnly in production, SameSite=Lax, host-only, Path=/. Contains no user tokens.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthLoginResponse"
                },
                "examples": {
                  "success": {
                    "value": {
                      "authorizationUrl": "https://identity.example.com/realms/vion-platform/protocol/openid-connect/auth?client_id=native-legacy-example&response_type=code&redirect_uri=https%3A%2F%2Fnative.example.com%2Flogin%2Fcallback&scope=openid%20profile%20email&state=state-placeholder&nonce=nonce-placeholder&code_challenge=challenge-placeholder&code_challenge_method=S256&ui_locales=en"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        }
      }
    },
    "/auth/callback": {
      "post": {
        "operationId": "completeLogin",
        "tags": [
          "access"
        ],
        "summary": "使用受保护的 Cookie 处理旧版授权回调并换票 / Exchange the legacy authorization callback using its protected cookie",
        "x-controller": "AuthenticationController",
        "x-spring-provide-args": [
          "jakarta.servlet.http.HttpServletRequest request",
          "jakarta.servlet.http.HttpServletResponse response"
        ],
        "security": [],
        "description": "**中文**\n\n仅为尚未迁移的原生机密客户端保留。code 和 error 必须且只能提供其中一个。\n在交付令牌前，验证事务 Cookie、state、issuer、PKCE、nonce 和租户。固定的客户端配置来自 Cookie，不接受请求头覆盖。\nWeb 通过 keycloak-js 直接交换授权码。\n\n**English**\n\nRetained only for unmigrated native confidential clients. Exactly one of code or error. Verify transaction\ncookie, state, issuer, PKCE, nonce and tenant before token delivery. Fixed profile is taken from the cookie,\nnot an override header. Web exchanges its authorization code directly through keycloak-js.",
        "responses": {
          "200": {
            "description": "**中文**\n\n向客户端交付令牌，禁止缓存，并清除匹配的事务 Cookie。\n\n**English**\n\nNo-store client token delivery; clears the matching transaction cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              },
              "Set-Cookie": {
                "description": "**中文**\n\n仅使用原始名称和 Path 将匹配的临时登录 Cookie 设为过期。\n\n**English**\n\nExpires only the matched temporary login cookie using its original name and Path.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthTokenResponse"
                },
                "examples": {
                  "success": {
                    "value": {
                      "accessToken": "access-token-placeholder",
                      "refreshToken": "refresh-token-placeholder",
                      "expiresIn": 300,
                      "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthCallbackRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "state": "login-transaction-state",
                    "code": "authorization-code-placeholder"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "operationId": "refreshAuthentication",
        "tags": [
          "access"
        ],
        "summary": "刷新旧版调用方持有的凭证，无服务端会话 / Refresh legacy caller-held credentials without a server session",
        "x-controller": "AuthenticationController",
        "x-spring-provide-args": [
          "jakarta.servlet.http.HttpServletRequest request"
        ],
        "security": [],
        "description": "**中文**\n\n仅为尚未迁移的原生机密客户端保留。使用固定的客户端配置和调用方提供的 Refresh Token。\n不接受 tenantId、mode 或认证上下文 ID。不缓存用户状态，也不自动重试。\nWeb 通过 keycloak-js 直接刷新令牌。\n\n**English**\n\nRetained only for unmigrated native confidential clients. Uses the fixed client profile and supplied Refresh\nToken. Does not accept tenantId, mode or authentication context IDs. No user-state cache or automatic retry.\nWeb refreshes tokens directly through keycloak-js.",
        "parameters": [
          {
            "name": "X-Client-Type",
            "in": "header",
            "required": false,
            "description": "**中文**\n\n选择已注册的固定旧版客户端配置，不作为身份或权限证明。\n为保持传输协议兼容，保留已有的配置名称及默认值。web 值并不表示当前的 Web 公共客户端 SDK 集成。\n\n**English**\n\nSelects a fixed registered legacy client profile; not an identity or permission proof.\nExisting profile names and defaults are retained for wire compatibility. The web value does not\ndescribe the current public Web SDK integration.",
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "ios",
                "android"
              ],
              "default": "web"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n返回轮换后的令牌对，不设置会话 Cookie。\n\n**English**\n\nReturns the rotated token pair without setting a session cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthTokenResponse"
                },
                "examples": {
                  "success": {
                    "value": {
                      "accessToken": "access-token-placeholder",
                      "refreshToken": "refresh-token-placeholder",
                      "expiresIn": 300,
                      "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthRefreshRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "refreshToken": "refresh-token-placeholder"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "logoutAuthentication",
        "tags": [
          "access"
        ],
        "summary": "仅结束已证明归属的旧版客户端会话 / End only the proven legacy client session",
        "x-controller": "AuthenticationController",
        "x-spring-provide-args": [
          "jakarta.servlet.http.HttpServletRequest request"
        ],
        "security": [],
        "description": "**中文**\n\n仅为尚未迁移的原生机密客户端保留。使用有效的 Bearer Access Token，或者提供通过固定客户端验证的 Refresh Token。\n不接受 SID 或 userId 入参，不建立服务端会话，也不执行持久化补偿。缺失或未激活的刷新凭证不能作为退出成功的证明。\nWeb 使用 keycloak.logout()，携带其保留的 ID Token 和已注册的返回 URL，无须预先刷新令牌或请求 Access 退出接口。\nWeb 退出失败时必须通过受控的错误和重试流程处理。仅清除本地令牌不能确认 SSO 已退出。\n\n**English**\n\nRetained only for unmigrated native confidential clients. Use a valid Bearer Access Token, or a supplied Refresh\nToken validated through the fixed client. No SID/userId input, server session or durable compensation. Missing\nor inactive refresh proof is not confirmation of logout. Web uses keycloak.logout() with its retained ID Token\nand the registered return URL, without a prior refresh or Access logout request. A failed Web logout requires\na controlled error and retry path. Clearing local tokens alone does not confirm SSO logout.",
        "parameters": [
          {
            "name": "X-Client-Type",
            "in": "header",
            "required": false,
            "description": "**中文**\n\n选择已注册的固定旧版客户端配置，不作为身份或权限证明。\n为保持传输协议兼容，保留已有的配置名称及默认值。web 值并不表示当前的 Web 公共客户端 SDK 集成。\n\n**English**\n\nSelects a fixed registered legacy client profile; not an identity or permission proof.\nExisting profile names and defaults are retained for wire compatibility. The web value does not\ndescribe the current public Web SDK integration.",
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "ios",
                "android"
              ],
              "default": "web"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "**中文**\n\nBearer Access Token。仅当请求体提供可验证的 Refresh Token 时才可省略。\n\n**English**\n\nBearer Access Token. Optional only when the body provides a verifiable Refresh Token."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthLogoutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n已证明归属的 SID 经确认不存在。不返回重定向或恢复 Cookie。\n\n**English**\n\nThe proven SID is confirmed absent; no redirect or recovery cookie.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogoutStatus"
                },
                "examples": {
                  "success": {
                    "value": {
                      "status": "COMPLETE"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "504": {
            "description": "**中文**\n\n旧版退出请求超时。reason=LOGOUT_TIMEOUT，远端执行结果未知。\n\n**English**\n\nThe legacy logout request timed out. reason=LOGOUT_TIMEOUT; remote outcome is unknown.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout/status": {
      "get": {
        "operationId": "getLogoutStatus",
        "tags": [
          "access"
        ],
        "summary": "退役的旧版退出恢复接口 / Retired legacy logout recovery endpoint",
        "x-controller": "AuthenticationController",
        "description": "**中文**\n\n仅为旧版客户端保留，始终返回 HTTP 410。Web 使用 SDK 退出。\n\n**English**\n\nRetained for legacy clients only; always returns HTTP 410. Web uses SDK logout.",
        "security": [],
        "deprecated": true,
        "responses": {
          "410": {
            "description": "**中文**\n\n接口已退役。不恢复用户会话、恢复 Cookie、队列任务或上游重定向。\n\n**English**\n\nRetired. No user session, recovery cookie, queued task or upstream redirect is restored.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthFlowRetiredResponse"
                },
                "examples": {
                  "retired": {
                    "value": {
                      "reason": "AUTH_FLOW_RETIRED"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout/continue": {
      "get": {
        "operationId": "continueLogout",
        "tags": [
          "access"
        ],
        "summary": "退役的旧版退出恢复接口 / Retired legacy logout recovery endpoint",
        "x-controller": "AuthenticationController",
        "description": "**中文**\n\n仅为旧版客户端保留，始终返回 HTTP 410。Web 使用 SDK 退出。\n\n**English**\n\nRetained for legacy clients only; always returns HTTP 410. Web uses SDK logout.",
        "security": [],
        "deprecated": true,
        "responses": {
          "410": {
            "description": "**中文**\n\n接口已退役。不恢复用户会话、恢复 Cookie、队列任务或上游重定向。\n\n**English**\n\nRetired. No user session, recovery cookie, queued task or upstream redirect is restored.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthFlowRetiredResponse"
                },
                "examples": {
                  "retired": {
                    "value": {
                      "reason": "AUTH_FLOW_RETIRED"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout/callback": {
      "get": {
        "operationId": "completeLogout",
        "tags": [
          "access"
        ],
        "summary": "退役的旧版退出恢复接口 / Retired legacy logout recovery endpoint",
        "x-controller": "AuthenticationController",
        "description": "**中文**\n\n仅为旧版客户端保留，始终返回 HTTP 410。Web 使用 SDK 退出。\n\n**English**\n\nRetained for legacy clients only; always returns HTTP 410. Web uses SDK logout.",
        "security": [],
        "deprecated": true,
        "responses": {
          "410": {
            "description": "**中文**\n\n接口已退役。不恢复用户会话、恢复 Cookie、队列任务或上游重定向。\n\n**English**\n\nRetired. No user session, recovery cookie, queued task or upstream redirect is restored.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "no-store"
                  ]
                },
                "description": "**中文**\n\n此响应使用 no-store 指令，禁止缓存。\n\n**English**\n\nThis response uses the no-store directive and must not be cached."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthFlowRetiredResponse"
                },
                "examples": {
                  "retired": {
                    "value": {
                      "reason": "AUTH_FLOW_RETIRED"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "**中文**\n\nKeycloak 签发的 OpenID Connect 访问令牌（Bearer JWT）。\n\n**English**\n\nOpenID Connect access token issued by Keycloak (Bearer JWT)."
      }
    },
    "schemas": {
      "LoginCompletion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "success"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "**中文**\n\n登录确认是否成功。成功响应固定为 true。\n\n**English**\n\nWhether login confirmation succeeded. It is always true in a successful response."
          }
        }
      },
      "LoginCompletionEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/LoginCompletion"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "AuthLogoutRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "refreshToken"
        ],
        "properties": {
          "refreshToken": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n旧版原生客户端持有并提交的刷新令牌。\n\n**English**\n\nRefresh token held and supplied by the legacy native client."
          }
        }
      },
      "AuthRefreshRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "refreshToken"
        ],
        "properties": {
          "refreshToken": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n旧版原生客户端持有并提交的刷新令牌。\n\n**English**\n\nRefresh token held and supplied by the legacy native client."
          }
        }
      },
      "AuthLoginResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "authorizationUrl"
        ],
        "properties": {
          "authorizationUrl": {
            "type": "string",
            "format": "uri",
            "description": "**中文**\n\n旧版客户端发起授权时打开的固定授权 URL。\n\n**English**\n\nFixed authorization URL opened by the legacy client to begin authorization."
          }
        }
      },
      "UserSiteScopeItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "tenantId",
          "scopeType",
          "scopeIds"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "scopeType": {
            "type": "string",
            "enum": [
              "ALL",
              "ORG_UNIT",
              "SITE"
            ],
            "description": "**中文**\n\n场所范围类型：ALL 为本租户所有场所，ORG_UNIT 为指定组织单元及其下辖场所，SITE 为指定场所。\n\n**English**\n\nSite scope type. ALL covers all sites of the tenant, ORG_UNIT covers specified org units and their subordinate sites, and SITE covers specified sites."
          },
          "scopeIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n直接授权节点的 ID 集合，不展开下辖场所。ALL 时为空数组。\n\n**English**\n\nIDs of directly granted nodes, without expanding subordinate sites. Empty for ALL."
          }
        }
      },
      "AssignUserSiteScopeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scopeType",
          "scopeIds"
        ],
        "properties": {
          "scopeType": {
            "type": "string",
            "enum": [
              "ALL",
              "ORG_UNIT",
              "SITE"
            ],
            "description": "**中文**\n\n场所范围类型：ALL 为本租户所有场所，ORG_UNIT 为指定组织单元及其下辖场所，SITE 为指定场所。\n\n**English**\n\nSite scope type. ALL covers all sites of the tenant, ORG_UNIT covers specified org units and their subordinate sites, and SITE covers specified sites."
          },
          "scopeIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n按 scopeType 提交同类组织单元或场所 ID。ALL 必须传空数组，ORG_UNIT 或 SITE 的空数组表示清空直接授权。\n\n**English**\n\nSupply org unit or site IDs of the type specified by scopeType. ALL requires an empty array. An empty array for ORG_UNIT or SITE clears direct grants."
          }
        },
        "description": "**中文**\n\nscopeIds 必须提供且不可为 null。ALL 要求传入 []，ORG_UNIT 或 SITE 传入 [] 表示显式清空用户的全部直接场所范围授权。管理员的有效 ALL 范围由身份推导，不属于存储的授权记录。\n\n**English**\n\nscopeIds is required and non-null. ALL requires []; ORG_UNIT/SITE [] explicitly clears all direct user scope grants. Administrator effective ALL is derived from identity and is not a stored grant."
      },
      "UserSiteScopeListData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserSiteScopeItem"
            },
            "description": "**中文**\n\n已存储的用户直接场所范围列表。\n\n**English**\n\nList of stored direct user site scopes."
          }
        }
      },
      "UserSiteScopeListEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/UserSiteScopeListData"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "UserSiteScopeEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/UserSiteScopeItem"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "CreateTenantRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantCode",
          "name",
          "defaultTimezone"
        ],
        "properties": {
          "tenantCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n租户的稳定业务编码，创建后不可修改。\n\n**English**\n\nStable business code of the tenant, immutable after creation."
          },
          "defaultTimezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n租户默认 IANA 时区。\n\n**English**\n\nDefault IANA time zone of the tenant."
          },
          "firstDayOfWeek": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7,
            "default": 1,
            "description": "**中文**\n\n周统计起始日，1 至 7 依次代表周一至周日。\n\n**English**\n\nFirst day of the reporting week, with values 1 through 7 representing Monday through Sunday."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "expireDate": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "**中文**\n\n租户有效期截止的当地日期，按租户默认时区计算且包含当日。null 表示未设置截止日期。\n\n**English**\n\nLast local date of tenant validity, inclusive in the tenant's default time zone. null means no expiration date is configured."
          }
        }
      },
      "Role": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roleUid",
          "tenantId",
          "name",
          "nameI18n",
          "status"
        ],
        "properties": {
          "roleUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n租户本地角色的不可变 UID。\n\n**English**\n\nImmutable UID of the tenant-local role."
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          },
          "userCount": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n已分配该本地角色的用户数量。\n\n**English**\n\nNumber of users assigned this local role."
          }
        }
      },
      "CreateRoleRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          }
        }
      },
      "UpdateRoleRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "description": "**中文**\n\n名称与完整翻译字典须一同提供。允许仅更新状态。\n\n**English**\n\nName and the complete translation dictionary are supplied together; status-only updates are allowed.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          }
        }
      },
      "ReplaceUserRolesRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roleUids"
        ],
        "properties": {
          "roleUids": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n替换后的本地角色 UID 集合，须为当前租户可分配的启用本地角色。空数组清空分配。\n\n**English**\n\nThe replacement local role UID set, containing enabled assignable local roles in the current tenant. An empty array clears assignments."
          }
        }
      },
      "UserRoles": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "tenantId",
          "roleUids",
          "tenantAdmin"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "roleUids": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "description": "**中文**\n\n目标用户在当前租户获授的本地角色 UID 列表，不包含身份源管理员角色。\n\n**English**\n\nUIDs of local roles assigned to the target user in the current tenant, excluding identity-source administrator roles."
          },
          "tenantAdmin": {
            "type": "boolean",
            "description": "**中文**\n\n目标用户在当前租户是否具有租户管理员身份。\n\n**English**\n\nWhether the target user has tenant administrator identity in the current tenant."
          }
        }
      },
      "RoleEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/Role"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "BuiltinRoleSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "code",
          "name",
          "nameI18n",
          "isBuiltin",
          "status",
          "userCount"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "code": {
            "type": "string",
            "enum": [
              "tenant_admin"
            ],
            "description": "**中文**\n\n内置租户管理员的固定业务标识 tenant_admin。\n\n**English**\n\nFixed business identifier tenant_admin for the built-in tenant administrator."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "isBuiltin": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "**中文**\n\n内置管理员摘要固定为 true。\n\n**English**\n\nAlways true for the built-in administrator summary."
          },
          "status": {
            "type": "integer",
            "enum": [
              1
            ],
            "description": "**中文**\n\n内置管理员摘要固定为启用状态 1。\n\n**English**\n\nThe built-in administrator summary always has enabled status 1."
          },
          "userCount": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n当前组织管理员组去重后的已分配人数，包含禁用账号；不因平台超管继承能力自动增加。\n\n**English**\n\nDeduplicated number of users assigned to the administrator group of the current organization, including disabled users. Inherited capabilities of platform administrators do not automatically increase this count."
          }
        }
      },
      "RoleListData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "builtinRoles"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Role"
            },
            "description": "**中文**\n\n当前租户本地角色列表。\n\n**English**\n\nList of local roles in the current tenant."
          },
          "builtinRoles": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/BuiltinRoleSummary"
            },
            "description": "**中文**\n\n身份源的只读内置管理员摘要，不含本地角色 UID。\n\n**English**\n\nRead-only built-in administrator summaries from the identity source, without local role UIDs."
          }
        }
      },
      "RoleListEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/RoleListData"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "UserRolesEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/UserRoles"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "AccessPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "limit",
          "offset",
          "hasMore"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "**中文**\n\n本页最多返回的记录条数。\n\n**English**\n\nMaximum number of records returned in this page."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n本页之前跳过的记录条数。\n\n**English**\n\nNumber of records skipped before this page."
          },
          "hasMore": {
            "type": "boolean",
            "description": "**中文**\n\n本页之后是否还有更多记录。\n\n**English**\n\nWhether additional records exist after this page."
          }
        }
      },
      "UpdateTenantRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "**中文**\n\n编辑名称时，名称与完整翻译字典须一同提供。\n\n**English**\n\nName and the complete translation dictionary are supplied together when editing the name.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "defaultTimezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n租户默认 IANA 时区。\n\n**English**\n\nDefault IANA time zone of the tenant."
          },
          "firstDayOfWeek": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7,
            "description": "**中文**\n\n周统计起始日，1 至 7 依次代表周一至周日。\n\n**English**\n\nFirst day of the reporting week, with values 1 through 7 representing Monday through Sunday."
          },
          "expireDate": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "**中文**\n\n租户有效期截止的当地日期，按租户默认时区计算且包含当日。null 表示未设置截止日期。\n\n**English**\n\nLast local date of tenant validity, inclusive in the tenant's default time zone. null means no expiration date is configured."
          }
        },
        "minProperties": 1
      },
      "SelectTenantRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          }
        }
      },
      "SelectTenantResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          }
        }
      },
      "MenuNode": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "menuUid",
          "parentMenuUid",
          "code",
          "name",
          "nameI18n",
          "menuType",
          "routeType",
          "sortOrder",
          "status"
        ],
        "properties": {
          "menuUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n菜单节点的 UID。\n\n**English**\n\nUID of the menu node."
          },
          "parentMenuUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "nullable": true,
            "description": "**中文**\n\n父菜单节点的 UID，根节点为 null。\n\n**English**\n\nUID of the parent menu node, or null for a root node."
          },
          "code": {
            "type": "string",
            "description": "**中文**\n\n菜单节点的稳定业务编码。\n\n**English**\n\nStable business code of the menu node."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "menuType": {
            "type": "string",
            "enum": [
              "APP",
              "DIRECTORY",
              "PAGE"
            ],
            "description": "**中文**\n\n菜单节点类型：应用 APP、目录 DIRECTORY、页面 PAGE。\n\n**English**\n\nMenu node type: APP for application, DIRECTORY for directory, and PAGE for page."
          },
          "routePath": {
            "type": "string",
            "nullable": true,
            "description": "**中文**\n\n菜单指向的路由地址，无对应路由时为 null。\n\n**English**\n\nRoute addressed by the menu, or null when no route is associated."
          },
          "routeType": {
            "type": "string",
            "enum": [
              "INTERNAL",
              "EXTERNAL"
            ],
            "description": "**中文**\n\n路由类型，INTERNAL 为内部路由，EXTERNAL 为外部链接。\n\n**English**\n\nRoute type. INTERNAL denotes an internal route and EXTERNAL an external link."
          },
          "sortOrder": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n同级节点的展示排序号。\n\n**English**\n\nDisplay order among sibling nodes."
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MenuNode"
            },
            "description": "**中文**\n\n该菜单节点的直接子节点列表。\n\n**English**\n\nList of direct child menu nodes."
          }
        }
      },
      "PermissionItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "permissionUid",
          "appMenuUid",
          "code",
          "name",
          "nameI18n",
          "status"
        ],
        "properties": {
          "permissionUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n功能权限点的 UID。\n\n**English**\n\nUID of the permission."
          },
          "appMenuUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n功能权限点所属顶层应用菜单的 UID。\n\n**English**\n\nUID of the top-level application menu owning the permission."
          },
          "code": {
            "type": "string",
            "description": "**中文**\n\n功能权限点的完整业务权限码。\n\n**English**\n\nFull business permission code."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          }
        }
      },
      "AuthorizationApp": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app",
          "menus",
          "permissions"
        ],
        "properties": {
          "app": {
            "$ref": "#/components/schemas/MenuNode"
          },
          "menus": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MenuNode"
            },
            "description": "**中文**\n\n该应用下可选的菜单树。\n\n**English**\n\nSelectable menu tree within the application."
          },
          "permissions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PermissionItem"
            },
            "description": "**中文**\n\n该应用下可选的功能权限点。\n\n**English**\n\nSelectable permissions within the application."
          }
        }
      },
      "AuthorizationSelectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "menuUids",
          "permissionUids"
        ],
        "properties": {
          "menuUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n提交的完整菜单 UID 集合，空数组清空菜单授权。\n\n**English**\n\nComplete submitted set of menu UIDs. An empty array clears menu grants."
          },
          "permissionUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n提交的完整功能权限 UID 集合，独立于菜单，空数组清空功能权限授权。\n\n**English**\n\nComplete submitted set of permission UIDs, independent of menus. An empty array clears permission grants."
          }
        }
      },
      "AuthorizationResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "menuUids",
          "permissionUids"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "roleUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n角色授权时的目标本地角色 UID。租户授权时不返回该字段。\n\n**English**\n\nTarget local role UID for role authorization. Omitted for tenant entitlements."
          },
          "menuUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n已授予的菜单 UID 集合。\n\n**English**\n\nSet of granted menu UIDs."
          },
          "permissionUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n已授予的功能权限 UID 集合。\n\n**English**\n\nSet of granted permission UIDs."
          }
        }
      },
      "AuthorizationDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "menuUids",
          "permissionUids",
          "apps"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "roleUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n角色授权查询时的目标本地角色 UID。租户授权查询时不返回该字段。\n\n**English**\n\nTarget local role UID for a role authorization query. Omitted for a tenant entitlement query."
          },
          "menuUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n已授予的菜单 UID 集合。\n\n**English**\n\nSet of granted menu UIDs."
          },
          "permissionUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n已授予的功能权限 UID 集合。\n\n**English**\n\nSet of granted permission UIDs."
          },
          "apps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuthorizationApp"
            },
            "description": "**中文**\n\n按应用组织的可选菜单和功能权限。\n\n**English**\n\nSelectable menus and permissions grouped by application."
          }
        }
      },
      "Member": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "tenantId",
          "username",
          "displayName",
          "email",
          "enabled",
          "roleUids",
          "tenantAdmin",
          "allowedActions"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "username": {
            "type": "string",
            "description": "**中文**\n\n身份源中的全局用户名。\n\n**English**\n\nGlobal username in the identity source."
          },
          "displayName": {
            "type": "string",
            "description": "**中文**\n\n共享用户的显示名称。\n\n**English**\n\nDisplay name of the shared user."
          },
          "email": {
            "type": "string",
            "description": "**中文**\n\n共享用户的电子邮箱地址。\n\n**English**\n\nEmail address of the shared user."
          },
          "enabled": {
            "type": "boolean",
            "description": "**中文**\n\n身份源中全局用户的启用状态。\n\n**English**\n\nGlobal user's enabled status in the identity source."
          },
          "roleUids": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            },
            "uniqueItems": true,
            "description": "**中文**\n\n目标用户在当前租户获授的本地角色 UID 列表，不包含身份源管理员角色。\n\n**English**\n\nUIDs of local roles assigned to the target user in the current tenant, excluding identity-source administrator roles."
          },
          "tenantAdmin": {
            "type": "boolean",
            "description": "**中文**\n\n目标用户在当前租户是否具有租户管理员身份。\n\n**English**\n\nWhether the target user has tenant administrator identity in the current tenant."
          },
          "allowedActions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "edit_profile",
                "assign_role",
                "assign_scope",
                "remove"
              ]
            },
            "description": "**中文**\n\n当前调用方对该租户成员允许的管理动作，以 edit_profile、assign_role、assign_scope、remove 表示。\n\n**English**\n\nAdministration actions the current caller may perform on this tenant member, represented by edit_profile, assign_role, assign_scope, and remove."
          }
        }
      },
      "MemberPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "page"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            },
            "description": "**中文**\n\n当前租户成员的本页记录。\n\n**English**\n\nCurrent page of tenant member records."
          },
          "page": {
            "$ref": "#/components/schemas/AccessPage"
          }
        }
      },
      "CreateMemberRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "username",
          "displayName",
          "email",
          "password"
        ],
        "properties": {
          "username": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "**中文**\n\n身份源中的全局用户名。\n\n**English**\n\nGlobal username in the identity source."
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n共享用户的显示名称。\n\n**English**\n\nDisplay name of the shared user."
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 254,
            "description": "**中文**\n\n共享用户的电子邮箱地址。\n\n**English**\n\nEmail address of the shared user."
          },
          "password": {
            "type": "string",
            "format": "password",
            "minLength": 12,
            "maxLength": 256,
            "writeOnly": true,
            "description": "**中文**\n\n新全局用户的初始密码，依据身份源密码策略校验。\n\n**English**\n\nInitial password of the new global user, validated against the identity-source password policy."
          }
        }
      },
      "MemberProfile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "displayName",
          "email"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "displayName": {
            "type": "string",
            "description": "**中文**\n\n共享用户的显示名称。\n\n**English**\n\nDisplay name of the shared user."
          },
          "email": {
            "type": "string",
            "description": "**中文**\n\n共享用户的电子邮箱地址。\n\n**English**\n\nEmail address of the shared user."
          }
        }
      },
      "UpdateMemberRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n修改后的共享用户显示名称，省略时保留原值。\n\n**English**\n\nUpdated shared user display name. Omission preserves its existing value."
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "description": "**中文**\n\n空字符串表示清空电子邮箱，省略时保留原值。非空值必须为有效的电子邮箱地址。\n\n**English**\n\nEmpty string clears email; omission preserves it. Non-empty values must be valid email addresses."
          }
        },
        "minProperties": 1
      },
      "RemoveMemberResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "tenantId",
          "removed"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "removed": {
            "type": "boolean",
            "description": "**中文**\n\n目标租户成员关系是否已移除。\n\n**English**\n\nWhether the target tenant membership has been removed."
          }
        }
      },
      "DeleteRoleResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roleUid",
          "deleted"
        ],
        "properties": {
          "roleUid": {
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
            "description": "**中文**\n\n已删除本地角色的 UID。\n\n**English**\n\nUID of the deleted local role."
          },
          "deleted": {
            "type": "boolean",
            "description": "**中文**\n\n是否已删除目标本地角色。\n\n**English**\n\nWhether the target local role has been deleted."
          }
        }
      },
      "TenantStatusResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "status"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "status": {
            "type": "string",
            "enum": [
              "DISABLED"
            ],
            "description": "**中文**\n\n停用后的租户生命周期状态，固定为 DISABLED。\n\n**English**\n\nTenant lifecycle status after disabling, always DISABLED."
          }
        }
      },
      "BuiltinRoleOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "key",
          "name",
          "nameI18n",
          "source",
          "assignable"
        ],
        "properties": {
          "key": {
            "type": "string",
            "enum": [
              "tenant_admin"
            ],
            "description": "**中文**\n\n内置租户管理员选项的稳定标识 tenant_admin。\n\n**English**\n\nStable identifier tenant_admin of the built-in tenant administrator option."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "source": {
            "type": "string",
            "enum": [
              "KEYCLOAK"
            ],
            "description": "**中文**\n\n内置管理员身份的来源，固定为 KEYCLOAK。\n\n**English**\n\nSource of the built-in administrator identity, always KEYCLOAK."
          },
          "assignable": {
            "type": "boolean",
            "description": "**中文**\n\n调用方是否可修改租户管理员身份。仅平台管理员为 true。\n\n**English**\n\nWhether the caller can modify tenant administrator identity. True only for platform administrators."
          }
        }
      },
      "OrgUnitOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "orgUnitId",
          "parentOrgUnitId",
          "name"
        ],
        "properties": {
          "orgUnitId": {
            "$ref": "#/components/schemas/UidString"
          },
          "parentOrgUnitId": {
            "$ref": "#/components/schemas/NullableUidString",
            "description": "**中文**\n\n父组织单元 ID，根节点为 null。\n\n**English**\n\nParent org unit ID, or null for a root node."
          },
          "name": {
            "type": "string",
            "description": "**中文**\n\n组织单元显示名称，按请求语言解析。\n\n**English**\n\nOrg unit display name resolved for the requested language."
          }
        }
      },
      "SiteOption": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "siteId",
          "orgUnitId",
          "name"
        ],
        "properties": {
          "siteId": {
            "$ref": "#/components/schemas/UidString"
          },
          "orgUnitId": {
            "$ref": "#/components/schemas/NullableUidString",
            "description": "**中文**\n\n所属组织单元 ID，场所直属租户时为 null。\n\n**English**\n\nOwning org unit ID, or null if the site belongs directly to the tenant."
          },
          "name": {
            "type": "string",
            "description": "**中文**\n\n场所显示名称，按请求语言解析。\n\n**English**\n\nSite display name resolved for the requested language."
          }
        }
      },
      "UserRoleOptions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roles",
          "builtinRoles",
          "allowedActions"
        ],
        "properties": {
          "roles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Role"
            },
            "description": "**中文**\n\n当前租户的启用本地角色候选项。\n\n**English**\n\nEnabled local role candidates in the current tenant."
          },
          "builtinRoles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuiltinRoleOption"
            },
            "description": "**中文**\n\n身份源内置管理员选项，独立于本地角色。\n\n**English**\n\nBuilt-in administrator options from the identity source, separate from local roles."
          },
          "allowedActions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "**中文**\n\n仅在调用方允许对目标成员分配角色时包含 assign_role，否则为空数组。\n\n**English**\n\nContains assign_role only when the caller may assign roles to the target member. Otherwise the array is empty."
          }
        }
      },
      "SiteScopeOptions": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "allowedScopeTypes",
          "orgUnits",
          "sites",
          "orgUnitsPage",
          "sitesPage",
          "allowedActions"
        ],
        "properties": {
          "allowedScopeTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ALL",
                "ORG_UNIT",
                "SITE"
              ]
            },
            "description": "**中文**\n\n可选场所范围类型为 ALL、ORG_UNIT、SITE，直接赋权时选择其中一种。\n\n**English**\n\nAvailable site scope types are ALL, ORG_UNIT, and SITE. Select one when granting direct scope."
          },
          "orgUnits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgUnitOption"
            },
            "description": "**中文**\n\n组织单元候选项的当前页。\n\n**English**\n\nCurrent page of org unit candidates."
          },
          "sites": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SiteOption"
            },
            "description": "**中文**\n\n场所候选项的当前页。\n\n**English**\n\nCurrent page of site candidates."
          },
          "orgUnitsPage": {
            "$ref": "#/components/schemas/AccessPage"
          },
          "sitesPage": {
            "$ref": "#/components/schemas/AccessPage"
          },
          "allowedActions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "**中文**\n\n仅在调用方允许对目标成员分配场所范围时包含 assign_scope，否则为空数组。\n\n**English**\n\nContains assign_scope only when the caller may assign site scope to the target member. Otherwise the array is empty."
          }
        }
      },
      "GlobalUser": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "username",
          "displayName",
          "email",
          "enabled",
          "tenants"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "username": {
            "type": "string",
            "description": "**中文**\n\n身份源中的全局用户名。\n\n**English**\n\nGlobal username in the identity source."
          },
          "displayName": {
            "type": "string",
            "description": "**中文**\n\n共享用户的显示名称。\n\n**English**\n\nDisplay name of the shared user."
          },
          "email": {
            "type": "string",
            "description": "**中文**\n\n共享用户的电子邮箱地址。\n\n**English**\n\nEmail address of the shared user."
          },
          "enabled": {
            "type": "boolean",
            "description": "**中文**\n\n身份源中全局用户的启用状态。\n\n**English**\n\nGlobal user's enabled status in the identity source."
          },
          "tenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantMembership"
            },
            "description": "**中文**\n\n全局用户在平台租户中的完整成员关系。\n\n**English**\n\nComplete memberships of the global user in platform tenants."
          }
        }
      },
      "GlobalUserPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "page"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalUser"
            },
            "description": "**中文**\n\n本页全局用户及其租户成员关系。\n\n**English**\n\nGlobal users in this page and their tenant memberships."
          },
          "page": {
            "$ref": "#/components/schemas/AccessPage"
          }
        }
      },
      "UpdateGlobalUserRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n修改后的共享用户显示名称，省略时保留原值。\n\n**English**\n\nUpdated shared user display name. Omission preserves its existing value."
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "description": "**中文**\n\n空字符串表示清空电子邮箱，省略时保留原值。非空值必须为有效的电子邮箱地址。\n\n**English**\n\nEmpty string clears email; omission preserves it. Non-empty values must be valid email addresses."
          },
          "enabled": {
            "type": "boolean",
            "description": "**中文**\n\n更新全局启用状态，省略时保留原值。不得停用本人或平台管理员。\n\n**English**\n\nUpdate the global enabled status. Omission preserves its existing value. The caller and platform administrators must not be disabled."
          }
        },
        "minProperties": 1
      },
      "GlobalUserProfile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "displayName",
          "email",
          "enabled"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "displayName": {
            "type": "string",
            "description": "**中文**\n\n共享用户的显示名称。\n\n**English**\n\nDisplay name of the shared user."
          },
          "email": {
            "type": "string",
            "description": "**中文**\n\n共享用户的电子邮箱地址。\n\n**English**\n\nEmail address of the shared user."
          },
          "enabled": {
            "type": "boolean",
            "description": "**中文**\n\n身份源中全局用户的启用状态。\n\n**English**\n\nGlobal user's enabled status in the identity source."
          }
        }
      },
      "ResetGlobalUserPasswordRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "password",
          "temporary"
        ],
        "properties": {
          "password": {
            "type": "string",
            "format": "password",
            "minLength": 12,
            "maxLength": 256,
            "writeOnly": true,
            "description": "**中文**\n\n目标用户的新密码，依据身份源密码策略校验。\n\n**English**\n\nNew password for the target user, validated against the identity-source password policy."
          },
          "temporary": {
            "type": "boolean",
            "description": "**中文**\n\n是否将新密码设为临时密码，要求用户后续登录时修改。\n\n**English**\n\nWhether to make the new password temporary, requiring the user to change it at the next login."
          }
        }
      },
      "ResetPasswordResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "reset"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "reset": {
            "type": "boolean",
            "description": "**中文**\n\n是否完成目标用户的密码重置。\n\n**English**\n\nWhether the target user's password reset completed."
          }
        }
      },
      "UpdateTenantAdminRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled"
        ],
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "**中文**\n\ntrue 授予当前目标租户的管理员身份，false 撤销该身份。\n\n**English**\n\ntrue grants administrator identity in the current target tenant, and false revokes it."
          }
        }
      },
      "TenantAdminResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "tenantId",
          "tenantAdmin"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantAdmin": {
            "type": "boolean",
            "description": "**中文**\n\n目标用户在当前租户是否具有租户管理员身份。\n\n**English**\n\nWhether the target user has tenant administrator identity in the current tenant."
          }
        }
      },
      "GlobalUserTenants": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "items"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/IdString"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantMembership"
            },
            "description": "**中文**\n\n目标全局用户在平台租户中的完整成员关系列表。\n\n**English**\n\nComplete list of the target global user's memberships in platform tenants."
          }
        }
      },
      "UpdateGlobalUserTenantsRequest": {
        "type": "object",
        "additionalProperties": false,
        "description": "**中文**\n\n两个数组均为必填且必须互不相交。传入两个空数组是幂等的无操作请求。\n\n**English**\n\nBoth arrays are required and must be disjoint. Empty arrays are an idempotent no-op.",
        "required": [
          "addTenantIds",
          "removeTenantIds"
        ],
        "properties": {
          "addTenantIds": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n显式请求新增成员关系的租户 ID 集合。\n\n**English**\n\nSet of tenant IDs for which membership additions are explicitly requested."
          },
          "removeTenantIds": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n显式请求移除成员关系的租户 ID 集合。\n\n**English**\n\nSet of tenant IDs for which membership removals are explicitly requested."
          }
        }
      },
      "SelectTenantResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/SelectTenantResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "AuthorizationResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/AuthorizationResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "AuthorizationDetailEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/AuthorizationDetail"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "MemberEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/Member"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "MemberPageEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/MemberPage"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "MemberProfileEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/MemberProfile"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "RemoveMemberResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/RemoveMemberResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "DeleteRoleResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/DeleteRoleResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "TenantStatusResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/TenantStatusResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "UserRoleOptionsEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/UserRoleOptions"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "SiteScopeOptionsEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/SiteScopeOptions"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "GlobalUserPageEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/GlobalUserPage"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "GlobalUserProfileEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/GlobalUserProfile"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "ResetPasswordResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/ResetPasswordResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "TenantAdminResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/TenantAdminResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "GlobalUserTenantsEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/GlobalUserTenants"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "AuthCallbackRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state"
        ],
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n身份提供方授权回调中的授权码。\n\n**English**\n\nAuthorization code from the identity provider's authorization callback."
          },
          "state": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n与先前登录事务匹配的 OAuth state 值。\n\n**English**\n\nOAuth state value matching the preceding login transaction."
          },
          "iss": {
            "type": "string",
            "format": "uri",
            "description": "**中文**\n\n授权回调的签发方 URI。\n\n**English**\n\nIssuer URI of the authorization callback."
          },
          "error": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n身份提供方返回的授权错误。与 code 二选一。\n\n**English**\n\nAuthorization error returned by the identity provider. Mutually exclusive with code."
          }
        },
        "description": "**中文**\n\ncode 和 error 必须且只能提供其中一个。返回凭证前，依据加密的临时事务 Cookie 校验 state，依据固定配置校验 issuer，并校验 PKCE 和 nonce。该 Cookie 不引用服务端会话。\n\n**English**\n\nExactly one of code or error is required. Validate state against the encrypted temporary transaction cookie, issuer against fixed configuration and PKCE/nonce before returning credentials. The cookie is not a server-session reference."
      },
      "LogoutStatus": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "COMPLETE"
            ],
            "description": "**中文**\n\n旧版退出完成状态，固定为 COMPLETE。\n\n**English**\n\nLegacy logout completion status, always COMPLETE."
          }
        },
        "description": "**中文**\n\n旧版退出响应。请求中已证明归属的 SID 经确认不存在。不保留待处理状态或补偿任务。\n\n**English**\n\nLegacy logout response. The requested proven SID has been confirmed absent. No pending state or compensation task is retained."
      },
      "AuthFlowRetiredResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reason"
        ],
        "properties": {
          "reason": {
            "type": "string",
            "enum": [
              "AUTH_FLOW_RETIRED"
            ],
            "description": "**中文**\n\n已退役认证流程的固定原因标识 AUTH_FLOW_RETIRED。\n\n**English**\n\nFixed reason identifier AUTH_FLOW_RETIRED for a retired authentication flow."
          }
        }
      },
      "AuthTokenResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accessToken",
          "refreshToken",
          "expiresIn",
          "tenantId"
        ],
        "properties": {
          "accessToken": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n身份源签发的访问令牌。用于后续 Bearer 认证。\n\n**English**\n\nAccess token issued by the identity source, used for subsequent Bearer authentication."
          },
          "refreshToken": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n身份源签发的刷新令牌，用于后续令牌续期。\n\n**English**\n\nRefresh token issued by the identity source for subsequent token refresh."
          },
          "expiresIn": {
            "type": "integer",
            "minimum": 1,
            "description": "**中文**\n\n访问令牌的有效时长，单位为秒。\n\n**English**\n\nAccess token validity duration in seconds."
          },
          "tenantId": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NullableUidString"
              }
            ],
            "description": "**中文**\n\n由已验证的组织解析出的租户。已验证的平台登录时为 null。\n\n**English**\n\nTenant resolved from the verified organization. Null for verified platform login."
          }
        }
      },
      "TenantMembership": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "tenantCode",
          "name",
          "nameI18n",
          "status"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantCode": {
            "type": "string",
            "description": "**中文**\n\n租户的稳定业务编码，创建后不可修改。\n\n**English**\n\nStable business code of the tenant, immutable after creation."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "**中文**\n\n默认语言的基础名称，用于编辑、搜索、排序与缺译回退。\n\n**English**\n\nDefault-language base name used for editing, search, sorting and fallback."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "ACTIVE",
              "DISABLED"
            ],
            "description": "**中文**\n\n租户生命周期状态：PENDING 为待开通，ACTIVE 为启用，DISABLED 为停用。\n\n**English**\n\nTenant lifecycle status. PENDING means pending provisioning, ACTIVE means enabled, and DISABLED means disabled."
          }
        }
      },
      "EnableTenantResultEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/EnableTenantResult"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "EnableTenantResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "status"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE"
            ],
            "description": "**中文**\n\n启用后的租户生命周期状态，固定为 ACTIVE。\n\n**English**\n\nTenant lifecycle status after enabling, always ACTIVE."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "minimum": 1,
            "description": "**中文**\n\n稳定非零业务错误码，与 HTTP 错误状态共同表达失败。\n\n**English**\n\nStable nonzero business error code. It represents failure together with the HTTP error status."
          },
          "data": {
            "type": "object",
            "nullable": true,
            "maxProperties": 0,
            "description": "**中文**\n\n失败响应固定为 `null`。\n\n**English**\n\nAlways null in failure responses."
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的英文错误描述，不包含内部 SQL、凭据或隐藏对象详情。\n\n**English**\n\nEnglish error description for callers and troubleshooting, excluding internal SQL, credentials, and details of hidden objects."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n与响应头 `X-Request-Id` 相同，用于日志定位。\n\n**English**\n\nMatches X-Request-Id in the response header and is used to locate log entries."
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "**中文**\n\n`40002` 必须返回 `UNSUPPORTED_*` 或 `TARGET_*` 错误子码。\n`40301` 可以附带 `SCOPE_NOT_AUTHORIZED`。\n`40901` 可附带租户启用失败或组织关联冲突的错误子码。\n其余错误可省略此字段或返回 `null`。\n\n**English**\n\n40002 must return a UNSUPPORTED_* or TARGET_* error subcode.\n40301 may include SCOPE_NOT_AUTHORIZED.\n40901 may include an error subcode for tenant enablement failure or organization association conflict.\nOther errors may omit this field or return null.",
            "enum": [
              "UNSUPPORTED_ROLLUP_ORG",
              "UNSUPPORTED_ROLLUP_SPACE",
              "UNSUPPORTED_ROLLUP_TIME",
              "TARGET_DIMENSION_MISSING",
              "TARGET_SCOPE_CONFLICT",
              "UNSUPPORTED_SPACE_TYPE",
              "UNSUPPORTED_SLOT_TYPE",
              "UNSUPPORTED_GRANULARITY",
              "UNSUPPORTED_DIMENSION",
              "UNSUPPORTED_FILTER_OPERATOR",
              "SCOPE_NOT_AUTHORIZED",
              "INVALID_TOKEN",
              "INVALID_REQUEST",
              "ORGANIZATION_REQUIRED",
              "TENANT_ACCESS_DENIED",
              "ACCESS_DENIED",
              "ADMIN_GROUP_CONFLICT",
              "IDENTITY_UNAVAILABLE",
              "IDENTITY_REQUEST_FAILED",
              "MEMBERSHIP_UPDATE_INCOMPLETE",
              "TENANT_EXPIRED",
              "TENANT_NOT_PROVISIONED",
              "ORGANIZATION_CONFLICT",
              null,
              "IDENTITY_CREATE_UNCONFIRMED",
              "USER_CREATE_INCOMPLETE",
              "USER_CREATE_FAILED",
              "TENANT_PROVISIONING_INCOMPLETE",
              "TENANT_PROVISIONING_UNCONFIRMED",
              "ORGANIZATION_DISABLED"
            ]
          },
          "params": {
            "type": "object",
            "description": "**中文**\n\n由错误标识对应的契约定义的文案插值参数，仅供文案插值，不得包含敏感数据。\n\n**English**\n\nMessage interpolation parameters as defined by the contract for the error identifier, used only for interpolation. They must not contain sensitive data.",
            "additionalProperties": {
              "$ref": "#/components/schemas/ErrorParamValue"
            }
          }
        }
      },
      "ErrorParamValue": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "type": "number"
          }
        ],
        "description": "**中文**\n\n错误文案插值参数的值，支持字符串或数值。\n\n**English**\n\nError message interpolation parameter value, either a string or a number."
      },
      "UidString": {
        "type": "string",
        "minLength": 1,
        "maxLength": 36,
        "description": "**中文**\n\n双键实体的不可变外部标识 uid。新建实体使用 UUIDv7，6.0 迁移沿用非空、合法且唯一的源 unid。\nAPI 字段名及 X-Tenant-Id 请求头保持现有名称。纯数字值不得回退解析为内部自增 id。\n仅在字段明确约定时允许字符串 \"0\" 作为预置或无关联哨兵。\n\n**English**\n\nImmutable external UID of a dual-key entity. New entities use UUIDv7. Migration from 6.0 retains nonempty, valid and unique source UNIDs.\nAPI field names and the X-Tenant-Id request header retain their existing names. Purely numeric values must not fall back to parsing as internal auto-increment IDs.\nThe string \"0\" is permitted as a built-in or unassociated sentinel only where the field explicitly defines it."
      },
      "TenantEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "**中文**\n\n业务响应状态码，成功固定为 0。\n\n**English**\n\nBusiness response status code, always 0 on success."
          },
          "data": {
            "$ref": "#/components/schemas/TenantDetail"
          },
          "message": {
            "type": "string",
            "description": "**中文**\n\n面向调用方与排查的可读提示信息。\n\n**English**\n\nHuman-readable message for callers and troubleshooting."
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "**中文**\n\n本次请求的唯一追踪标识。\n\n**English**\n\nUnique trace identifier for this request."
          }
        }
      },
      "TenantDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "tenantCode",
          "name",
          "nameI18n",
          "status",
          "firstDayOfWeek"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantCode": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n租户的稳定业务编码，创建后不可修改。\n\n**English**\n\nStable business code of the tenant, immutable after creation."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n默认语言基础值。\n\n**English**\n\nBase value in the default language."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "defaultTimezone": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n租户默认 IANA 时区。\n\n**English**\n\nDefault IANA time zone of the tenant."
          },
          "firstDayOfWeek": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7,
            "description": "**中文**\n\n周统计起始日，1 至 7 依次代表周一至周日。\n\n**English**\n\nFirst day of the reporting week, with values 1 through 7 representing Monday through Sunday."
          },
          "expireDate": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "**中文**\n\n租户有效期截止的当地日期，按租户默认时区计算且包含当日。null 表示未设置截止日期。\n\n**English**\n\nLast local date of tenant validity, inclusive in the tenant's default time zone. null means no expiration date is configured."
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "ACTIVE",
              "DISABLED"
            ],
            "description": "**中文**\n\n租户生命周期状态：PENDING 为待开通，ACTIVE 为启用，DISABLED 为停用。\n\n**English**\n\nTenant lifecycle status. PENDING means pending provisioning, ACTIVE means enabled, and DISABLED means disabled."
          }
        }
      },
      "LocalizedText": {
        "type": "object",
        "additionalProperties": false,
        "description": "**中文**\n\n完整翻译字典。键为平台支持的规范语言标识，值去除首尾 Unicode White_Space 后非空。创建时可省略，更新翻译字段时必须提供，空字典表示无翻译。\n\n**English**\n\nComplete translation dictionary. Keys are canonical language identifiers supported by the platform, and values must remain non-empty after trimming leading and trailing Unicode White_Space. The dictionary may be omitted during creation, is required when updating a translatable field, and an empty dictionary means no translations.",
        "properties": {
          "en-US": {
            "type": "string",
            "minLength": 1,
            "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]",
            "description": "**中文**\n\n英文译文（en-US）。\n\n**English**\n\nEnglish translation (en-US)."
          },
          "zh-CN": {
            "type": "string",
            "minLength": 1,
            "pattern": "[^\\u0009-\\u000D\\u0020\\u0085\\u00A0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]",
            "description": "**中文**\n\n简体中文译文（zh-CN）。\n\n**English**\n\nSimplified Chinese translation (zh-CN)."
          }
        }
      },
      "IdString": {
        "type": "string",
        "minLength": 1,
        "description": "**中文**\n\n非双键实体的既有标识（如角色、用户、行政区划、绑定关系），以字符串传递。\n\n**English**\n\nExisting identifiers for entities without dual keys (such as roles, users, administrative regions and bindings), transmitted as strings."
      },
      "NullableUidString": {
        "type": "string",
        "nullable": true,
        "description": "**中文**\n\n可以为 null 的 UidString，用于可空的双键实体关联。\n\n**English**\n\nA UidString that may be null, used for nullable relationships between dual-key entities.",
        "anyOf": [
          {
            "$ref": "#/components/schemas/UidString"
          },
          {
            "type": "string",
            "nullable": true,
            "enum": [
              null
            ]
          }
        ]
      }
    },
    "responses": {
      "BadRequest": {
        "description": "**中文**\n\n请求参数或业务组合无效（code 40001 / 40002）。\n\n**English**\n\nInvalid request parameters or business combination (code 40001 / 40002).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40001,
              "data": null,
              "message": "Invalid request parameter.",
              "requestId": "550e8400-e29b-41d4-a716-446655440000"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "**中文**\n\n凭证缺失、无效或已过期（code 40101）。\n\n**English**\n\nCredentials missing, invalid, or expired (code 40101).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40101,
              "data": null,
              "message": "Authentication required or token expired.",
              "requestId": "550e8400-e29b-41d4-a716-446655440001"
            }
          }
        }
      },
      "Forbidden": {
        "description": "**中文**\n\n无权访问目标资源（code 40301）。\n\n**English**\n\nUnauthorized access to the target resource (code 40301).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40301,
              "data": null,
              "message": "Access denied for the requested scope or resource.",
              "requestId": "550e8400-e29b-41d4-a716-446655440002"
            }
          }
        }
      },
      "NotFound": {
        "description": "**中文**\n\n目标资源不存在（code 40401）。\n\n**English**\n\nTarget resource not found (code 40401).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40401,
              "data": null,
              "message": "Requested resource not found.",
              "requestId": "550e8400-e29b-41d4-a716-446655440003"
            }
          }
        }
      },
      "Conflict": {
        "description": "**中文**\n\n资源唯一性或生效区间冲突（code 40901）。\n\n**English**\n\nResource uniqueness or effective interval conflict (code 40901).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40901,
              "data": null,
              "message": "Resource conflict or overlapping effective period.",
              "requestId": "550e8400-e29b-41d4-a716-446655440004"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "**中文**\n\n业务规则或协议校验失败（code 42201）。\n\n**English**\n\nBusiness rule or protocol validation failed (code 42201).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 42201,
              "data": null,
              "message": "Business validation failed.",
              "requestId": "550e8400-e29b-41d4-a716-446655440005"
            }
          }
        }
      },
      "BadGateway": {
        "description": "**中文**\n\n上游依赖异常（code 50201）。\n\n**English**\n\nUpstream dependency returned an error (code 50201).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 50201,
              "data": null,
              "message": "Upstream service returned an invalid response.",
              "requestId": "550e8400-e29b-41d4-a716-446655440008"
            }
          }
        }
      },
      "Unavailable": {
        "description": "**中文**\n\n依赖服务不可用（code 50301）。\n\n**English**\n\nDependent service unavailable (code 50301).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 50301,
              "data": null,
              "message": "Dependent service unavailable.",
              "requestId": "550e8400-e29b-41d4-a716-446655440009"
            }
          }
        }
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "**中文**\n\n本次请求唯一追踪标识，与响应体 `requestId` 一致。\n\n**English**\n\nUnique trace identifier for this request, matching requestId in the response body.",
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "parameters": {
      "AcceptLanguage": {
        "name": "Accept-Language",
        "in": "header",
        "required": false,
        "description": "**中文**\n\n业务数据显示语言。按权重匹配 en-US、zh-CN 或对应语言前缀，无法匹配时使用基础字段。\n\n**English**\n\nLanguage for business data display. Match en-US, zh-CN, or the corresponding language prefixes by preference weight. Fall back to base fields if no language matches.",
        "schema": {
          "type": "string"
        }
      }
    }
  }
}
