{
  "openapi": "3.0.3",
  "info": {
    "title": "Vion Platform Dashboard Web API",
    "version": "0.1.0",
    "description": "**中文**\n\n看板 Web 接口提供共享看板、租户分配与排序、逐角色授权、分析部件管理及个人版面。看板、来源模板和部件使用 UID。平台预置的 tenantId 为 \"0\"。共享写入限管理员，普通成员须具备看板菜单、dashboard:query 权限、有效的租户分配和角色授权。\n\n**English**\n\nThe dashboard API manages shared dashboards, tenant assignments and ordering, role grants, analytics widgets and personal layouts. Dashboards, source templates and widgets use UIDs. Platform records have tenantId \"0\". Administrators manage shared definitions. Members need the dashboard menu, dashboard:query permission, an active tenant assignment and an effective role grant."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "dashboard",
      "description": "**中文**\n\n看板定义、RDL 校验与存取\n\n**English**\n\nDashboard definition and RDL validation and storage"
    }
  ],
  "x-doc-groups": [
    {
      "id": "dashboards",
      "title": "看板 / Dashboards",
      "operations": [
        "listDashboards",
        "getDashboard",
        "createDashboard",
        "updateDashboard",
        "pageDashboardCatalog"
      ]
    },
    {
      "id": "widgets",
      "title": "分析部件 / Analytics Widgets",
      "operations": [
        "listAnalyticsWidgets",
        "pageWidgetCatalog",
        "getAnalyticsWidget",
        "createAnalyticsWidget",
        "updateAnalyticsWidget",
        "listWidgetMetrics"
      ]
    },
    {
      "id": "personal-layouts",
      "title": "个人版面 / Personal Layouts",
      "operations": [
        "getPersonalDashboardLayout",
        "savePersonalDashboardLayout",
        "savePersonalDashboardOrder"
      ]
    },
    {
      "id": "tenant-assignments",
      "title": "租户看板分配与角色授权 / Tenant Dashboard Assignments and Role Grants",
      "operations": [
        "listTenantDashboardAssignments",
        "listTenantDashboardSelection",
        "updateTenantDashboardSelection",
        "listRoleDashboardSelection",
        "updateRoleDashboardSelection",
        "previewTenantDashboardAssignment",
        "saveTenantDashboardAssignment",
        "getDashboardRoleGrants",
        "replaceDashboardRoleGrants"
      ]
    }
  ],
  "paths": {
    "/api/platform/dashboard/dashboards": {
      "get": {
        "operationId": "listDashboards",
        "tags": [
          "dashboard"
        ],
        "summary": "查询当前用户可见的看板列表 / List dashboards visible to the current user",
        "description": "**中文**\n\n当前租户仅列出有效分配且启用的共享看板。普通成员查看其有效本地角色获授的并集，管理员查看当前租户全部有效分配。成员的个人排序优先，其余按租户排序值、共享看板 UID 排列。无租户的平台管理员查看启用的平台定义。\n\n**English**\n\nOnly enabled shared dashboards with active tenant assignments are listed. Members see the union granted to their active local roles. Administrators see all active assignments for their tenant. Personal ordering takes precedence, followed by tenant sort order and shared dashboard UID. Platform administrators without a selected tenant see enabled platform definitions.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "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\nPaginated list of dashboards",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPageEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [
                          {
                            "dashboardId": "01a2319e-2167-7240-bc32-25e4e1718502",
                            "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                            "dashboardCode": "site-overview",
                            "name": "场所客流与货架触达总览",
                            "dashboardType": "SITE_TRAFFIC",
                            "versionNo": 1,
                            "status": 1
                          },
                          {
                            "dashboardId": "01a2319e-2168-7404-a22a-1700c665c46b",
                            "tenantId": "0",
                            "dashboardCode": "region-traffic-overview",
                            "name": "区域客流总览",
                            "dashboardType": "ORG_UNIT_TRAFFIC",
                            "versionNo": 1,
                            "status": 1
                          },
                          {
                            "dashboardId": "01a2319e-2168-7404-a22a-16fed79c3f15",
                            "tenantId": "0",
                            "dashboardCode": "org-unit-traffic-overview",
                            "name": "组织客流总览",
                            "dashboardType": "ORG_UNIT_TRAFFIC",
                            "versionNo": 1,
                            "status": 1
                          }
                        ],
                        "page": {
                          "limit": 20,
                          "offset": 0,
                          "hasMore": false,
                          "total": 3
                        }
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440312"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "operationId": "createDashboard",
        "tags": [
          "dashboard"
        ],
        "summary": "新建看板并按 RDL JSON Schema 校验 / Create a dashboard and validate it against the RDL JSON Schema",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveDashboardRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "dashboardCode": "shelf-touch-overview",
                    "name": "货架触达分析看板",
                    "nameI18n": {},
                    "dashboardType": "SITE_TRAFFIC",
                    "rdl": {
                      "rdlVersion": "1.0",
                      "title": "Shelf Touch Overview",
                      "filters": {
                        "time": {
                          "granularity": "day"
                        },
                        "scope": {
                          "level": "site"
                        }
                      },
                      "widgets": [
                        {
                          "widgetCode": "shelf-touch-heatmap",
                          "x": 0,
                          "y": 0,
                          "w": 6,
                          "h": 4
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n新建看板结果\n\n**English**\n\nNewly created dashboard",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardDetailEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "dashboardId": "01a2319e-2168-7404-a22a-16fd97235111",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "dashboardCode": "shelf-touch-overview",
                        "name": "货架触达分析看板",
                        "nameI18n": {},
                        "dashboardType": "SITE_TRAFFIC",
                        "versionNo": 1,
                        "status": 1,
                        "rdl": {
                          "rdlVersion": "1.0",
                          "title": "Shelf Touch Overview",
                          "titleI18n": {},
                          "filters": {
                            "time": {
                              "granularity": "day"
                            },
                            "scope": {
                              "level": "site"
                            }
                          },
                          "widgets": [
                            {
                              "widgetCode": "shelf-touch-heatmap",
                              "x": 0,
                              "y": 0,
                              "w": 6,
                              "h": 4
                            }
                          ]
                        }
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440313"
                    }
                  }
                }
              }
            }
          },
          "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"
          }
        },
        "description": "**中文**\n\n新建看板时提交基础名称、页型和 RDL 定义，并按 RDL JSON Schema 校验。租户创建共享看板时，同一事务写入租户自建的可用关系。角色授权单独设置。\n\n**English**\n\nSupply the base name, dashboard type and RDL definition. The RDL is validated against its JSON Schema. Creating a shared tenant dashboard registers its tenant-owned assignment in the same transaction. Role grants are managed separately."
      }
    },
    "/api/platform/dashboard/dashboards/{dashboardId}": {
      "get": {
        "operationId": "getDashboard",
        "tags": [
          "dashboard"
        ],
        "summary": "获取看板编辑详情与完整 RDL 定义 / Read dashboard details for editing and the complete RDL definition",
        "parameters": [
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n目标看板 ID。\n\n**English**\n\nID of the target dashboard."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n看板详情\n\n**English**\n\nDashboard details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardDetailEnvelope"
                },
                "examples": {
                  "tenantDashboard": {
                    "value": {
                      "code": 0,
                      "data": {
                        "dashboardId": "01a2319e-2167-7240-bc32-25e4e1718502",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "dashboardCode": "site-overview",
                        "name": "Site Traffic & Shelf Engagement Overview",
                        "nameI18n": {
                          "zh-CN": "场所客流与货架触达总览"
                        },
                        "dashboardType": "SITE_TRAFFIC",
                        "versionNo": 1,
                        "status": 1,
                        "rdl": {
                          "rdlVersion": "1.0",
                          "title": "Site Traffic & Shelf Engagement Overview",
                          "titleI18n": {
                            "zh-CN": "场所客流与货架触达总览"
                          },
                          "filters": {
                            "time": {
                              "granularity": "day"
                            },
                            "scope": {
                              "level": "site"
                            }
                          },
                          "widgets": []
                        }
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440314"
                    }
                  },
                  "globalTemplate": {
                    "value": {
                      "code": 0,
                      "data": {
                        "dashboardId": "01a2319e-2167-7240-bc32-25e5b1bcb674",
                        "tenantId": "0",
                        "dashboardCode": "site-overview",
                        "name": "Site Traffic & Shelf Engagement Overview",
                        "nameI18n": {
                          "zh-CN": "场所客流与货架触达总览"
                        },
                        "dashboardType": "SITE_TRAFFIC",
                        "versionNo": 1,
                        "status": 1,
                        "rdl": {
                          "rdlVersion": "1.0",
                          "title": "Site Traffic & Shelf Engagement Overview",
                          "titleI18n": {
                            "zh-CN": "场所客流与货架触达总览"
                          },
                          "filters": {
                            "time": {
                              "granularity": "day"
                            },
                            "scope": {
                              "level": "site"
                            }
                          },
                          "widgets": []
                        },
                        "sourceTemplateId": "0",
                        "sourceVersion": 0,
                        "isDetached": false,
                        "detachedAt": null,
                        "detachedTenantCount": 2
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440340"
                    }
                  },
                  "regionTemplate": {
                    "value": {
                      "code": 0,
                      "data": {
                        "dashboardId": "01a2319e-2168-7404-a22a-1700c665c46b",
                        "tenantId": "0",
                        "dashboardCode": "region-traffic-overview",
                        "name": "Regional Traffic Overview",
                        "nameI18n": {
                          "zh-CN": "区域客流总览"
                        },
                        "dashboardType": "ORG_UNIT_TRAFFIC",
                        "versionNo": 1,
                        "status": 1,
                        "rdl": {
                          "rdlVersion": "1.0",
                          "filters": {
                            "time": {
                              "granularity": "day"
                            },
                            "scope": {
                              "level": "orgUnit"
                            }
                          },
                          "widgets": [
                            {
                              "widgetCode": "org-unit-entrance-traffic",
                              "x": 0,
                              "y": 0,
                              "w": 4,
                              "h": 2
                            }
                          ]
                        }
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440341"
                    }
                  },
                  "orgUnitTemplate": {
                    "value": {
                      "code": 0,
                      "data": {
                        "dashboardId": "01a2319e-2168-7404-a22a-16fed79c3f15",
                        "tenantId": "0",
                        "dashboardCode": "org-unit-traffic-overview",
                        "name": "Organization Traffic Overview",
                        "nameI18n": {
                          "zh-CN": "组织客流总览"
                        },
                        "dashboardType": "ORG_UNIT_TRAFFIC",
                        "versionNo": 1,
                        "status": 1,
                        "rdl": {
                          "rdlVersion": "1.0",
                          "filters": {
                            "time": {
                              "granularity": "week"
                            },
                            "scope": {
                              "level": "orgUnit"
                            }
                          },
                          "widgets": [
                            {
                              "widgetId": "01a2319e-2168-7404-a22a-16ffe3258411",
                              "x": 0,
                              "y": 0,
                              "w": 4,
                              "h": 2
                            }
                          ]
                        }
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440342"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "description": "**中文**\n\n编辑详情包含基础名称、完整的名称翻译字典和 RDL 管理投影。\n\n**English**\n\nEditing details include the base name, complete name translation dictionary, and the RDL management projection."
      }
    },
    "/api/platform/dashboard/dashboards/{dashboardId}/update": {
      "post": {
        "operationId": "updateDashboard",
        "tags": [
          "dashboard"
        ],
        "summary": "更新看板名称或 RDL 定义 / Update dashboard name or RDL definition",
        "description": "**中文**\n\n租户只能编辑可管理的共享看板。首次保存已分配的平台模板时，在同一事务内创建独立租户副本、保留分配顺序、迁移角色授权并撤下原模板分配。接口返回副本的 UID，后续编辑作用于该副本。\n\n**English**\n\nA tenant may edit only shared dashboards it manages. The first save of an assigned platform template creates an independent tenant copy, preserves its assignment order, transfers role grants and withdraws the original assignment in one transaction. The response identifies the copy by UID for subsequent edits.",
        "parameters": [
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            },
            "description": "**中文**\n\n目标看板 ID。\n\n**English**\n\nID of the target dashboard."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDashboardRequest"
              },
              "examples": {
                "request": {
                  "value": {
                    "dashboardCode": "site-overview",
                    "name": "场所客流与货架触达总览（更新）",
                    "nameI18n": {},
                    "dashboardType": "SITE_TRAFFIC",
                    "rdl": {
                      "rdlVersion": "1.0",
                      "title": "场所客流与货架触达总览（更新）",
                      "titleI18n": {},
                      "filters": {
                        "time": {
                          "granularity": "day"
                        },
                        "scope": {
                          "level": "site"
                        }
                      },
                      "widgets": [
                        {
                          "widgetCode": "site-entrance-traffic",
                          "x": 0,
                          "y": 0,
                          "w": 4,
                          "h": 2
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n更新后的看板详情\n\n**English**\n\nUpdated dashboard details",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardDetailEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": {
                        "dashboardId": "01a2319e-2167-7240-bc32-25e4e1718502",
                        "tenantId": "01a2319e-215e-74f1-b5e0-b9650e2a3f98",
                        "dashboardCode": "site-overview",
                        "name": "场所客流与货架触达总览（更新）",
                        "nameI18n": {},
                        "dashboardType": "SITE_TRAFFIC",
                        "versionNo": 2,
                        "status": 1,
                        "rdl": {
                          "rdlVersion": "1.0",
                          "title": "场所客流与货架触达总览（更新）",
                          "titleI18n": {},
                          "filters": {
                            "time": {
                              "granularity": "day"
                            },
                            "scope": {
                              "level": "site"
                            }
                          },
                          "widgets": [
                            {
                              "widgetCode": "site-entrance-traffic",
                              "x": 0,
                              "y": 0,
                              "w": 4,
                              "h": 2
                            }
                          ]
                        },
                        "sourceTemplateId": "01a2319e-2167-7240-bc32-25e5b1bcb674",
                        "sourceVersion": 1,
                        "isDetached": true,
                        "detachedAt": "2026-11-23T09:00:00Z"
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440315"
                    }
                  }
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/dashboard/dashboard-catalog": {
      "get": {
        "operationId": "pageDashboardCatalog",
        "tags": [
          "dashboard"
        ],
        "summary": "分页查询管理员看板目录 / Page through the dashboard management catalog",
        "description": "**中文**\n\n仅管理员可用。PLATFORM 返回有效分配给本租户的启用平台看板，无租户的平台管理员返回启用的平台定义；TENANT 返回当前租户自建的启用共享看板，不包含个人副本。\n\n**English**\n\nOnly administrators can access this catalog. PLATFORM returns enabled platform dashboards actively assigned to the tenant, or all enabled platform definitions for a platform administrator without a tenant. TENANT returns enabled shared dashboards owned by the tenant and excludes personal copies.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "source",
            "in": "query",
            "required": true,
            "description": "**中文**\n\n按平台或租户来源筛选目录。\n\n**English**\n\nFilter catalog entries by platform or tenant ownership.",
            "schema": {
              "type": "string",
              "pattern": "^(PLATFORM|TENANT)$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "**中文**\n\n每页最多返回的条数。\n\n**English**\n\nMaximum number of entries per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 6
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "**中文**\n\n跳过的条数。\n\n**English**\n\nNumber of entries to skip.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n按来源筛选后的看板及分页信息。\n\n**English**\n\nDashboard page filtered by source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardPageEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "items": [],
                    "page": {
                      "limit": 6,
                      "offset": 0,
                      "total": 0,
                      "hasMore": false
                    }
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/platform/dashboard/widgets": {
      "get": {
        "operationId": "listAnalyticsWidgets",
        "tags": [
          "dashboard"
        ],
        "summary": "查询当前租户可见的启用分析部件 / List enabled analytics widgets visible to the current tenant",
        "description": "**中文**\n\n合并平台预置（`tenantId = \"0\"`）和当前租户的启用部件。指定 `dashboardType` 时，仅返回适用该页型的部件。\n平台预置项排在租户项前。同一个 `widgetCode` 有两项时，按代码引用优先匹配租户项，与顺序无关；按 `widgetId` 引用精确匹配各自的定义。\n\n**English**\n\nMerge enabled platform built-in widgets (tenantId = \"0\") with enabled widgets of the current tenant. When dashboardType is specified, return only widgets applicable to that dashboard type.\nPlatform built-in entries precede tenant entries. If two entries share a widgetCode, a code reference prefers the tenant entry regardless of array order. A widgetId reference matches its exact definition.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "dashboardType",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/DashboardType"
            },
            "description": "**中文**\n\n按部件适用的看板页型筛选。\n\n**English**\n\nFilter by the dashboard type to which widgets apply."
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n可用的分析部件定义列表\n\n**English**\n\nList of available analytics widget definitions",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsWidgetListEnvelope"
                },
                "examples": {
                  "success": {
                    "value": {
                      "code": 0,
                      "data": [
                        {
                          "widgetId": "01a2319e-2167-7240-bc32-25e6264722eb",
                          "tenantId": "0",
                          "widgetCode": "site-entrance-traffic",
                          "name": "场所进入客流",
                          "widgetType": "kpi",
                          "definition": {
                            "metricCode": "entrance_traffic",
                            "dashboardTypeScope": [
                              "SITE_TRAFFIC"
                            ]
                          },
                          "versionNo": 1,
                          "status": 1
                        },
                        {
                          "widgetId": "01a2319e-2168-7404-a22a-16ffe3258411",
                          "tenantId": "0",
                          "widgetCode": "org-unit-entrance-traffic",
                          "name": "组织进入客流",
                          "widgetType": "kpi",
                          "definition": {
                            "metricCode": "entrance_traffic",
                            "dimensions": [
                              "orgUnitId"
                            ],
                            "dashboardTypeScope": [
                              "ORG_UNIT_TRAFFIC"
                            ]
                          },
                          "versionNo": 1,
                          "status": 1
                        }
                      ],
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440343"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "post": {
        "operationId": "createAnalyticsWidget",
        "tags": [
          "dashboard"
        ],
        "summary": "创建平台或租户分析部件；可用当前租户编码另存平台定义 / Create a platform or tenant widget, including a tenant copy of a platform definition",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveAnalyticsWidgetRequest"
              },
              "example": {
                "widgetCode": "entrances",
                "name": "Entrances",
                "nameI18n": {},
                "widgetType": "kpi",
                "definition": {
                  "metricCode": "entrance_traffic"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsWidgetDetailEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "widgetId": "widget-entrances-uid",
                    "tenantId": "tenant-retail-uid",
                    "widgetCode": "entrances",
                    "name": "Entrances",
                    "nameI18n": {},
                    "widgetType": "kpi",
                    "definition": {
                      "metricCode": "entrance_traffic"
                    },
                    "versionNo": 1,
                    "status": 1
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/dashboard/widget-catalog": {
      "get": {
        "operationId": "pageWidgetCatalog",
        "tags": [
          "dashboard"
        ],
        "summary": "分页查询分析部件目录 / Page through the analytics widget catalog",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "source",
            "in": "query",
            "description": "**中文**\n\n按平台或租户来源筛选目录。\n\n**English**\n\nFilter catalog entries by platform or tenant ownership.",
            "schema": {
              "type": "string",
              "default": "ALL",
              "pattern": "^(ALL|PLATFORM|TENANT)$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "**中文**\n\n按名称、编码或指标筛选部件。\n\n**English**\n\nFilter widgets by name, code or metric.",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "form",
            "in": "query",
            "description": "**中文**\n\n筛选部件的展示形式。\n\n**English**\n\nFilter widgets by presentation type.",
            "schema": {
              "type": "string",
              "default": "all",
              "pattern": "^(all|kpi|chart|table|other)$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "**中文**\n\n每页最多返回的条数。\n\n**English**\n\nMaximum number of entries per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 24
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "**中文**\n\n跳过的条数。\n\n**English**\n\nNumber of entries to skip.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "dashboardType",
            "in": "query",
            "description": "**中文**\n\n筛选适用此页型的分析部件。\n\n**English**\n\nFilter widgets applicable to this dashboard type.",
            "schema": {
              "$ref": "#/components/schemas/DashboardType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n返回当前可见且符合筛选条件的已保存部件及分页信息。\n\n**English**\n\nSaved widgets visible to the caller that match the filters, including pagination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetCatalogEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "items": [],
                    "page": {
                      "limit": 24,
                      "offset": 0,
                      "total": 0,
                      "hasMore": false
                    }
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/platform/dashboard/widgets/{widgetId}": {
      "get": {
        "operationId": "getAnalyticsWidget",
        "tags": [
          "dashboard"
        ],
        "summary": "获取管理员可编辑的原始部件定义和译名 / Get the editable widget definition and translations",
        "parameters": [
          {
            "name": "widgetId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n分析部件的 UID。\n\n**English**\n\nUID of the analytics widget.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsWidgetDetailEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "widgetId": "widget-entrances-uid",
                    "tenantId": "tenant-retail-uid",
                    "widgetCode": "entrances",
                    "name": "Entrances",
                    "nameI18n": {},
                    "widgetType": "kpi",
                    "definition": {
                      "metricCode": "entrance_traffic"
                    },
                    "versionNo": 1,
                    "status": 1
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/platform/dashboard/widgets/{widgetId}/update": {
      "post": {
        "operationId": "updateAnalyticsWidget",
        "tags": [
          "dashboard"
        ],
        "summary": "按版本更新本级部件；租户不得改写平台定义 / Update the owning tenant or platform widget using its expected version",
        "parameters": [
          {
            "name": "widgetId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n分析部件的 UID。\n\n**English**\n\nUID of the analytics widget.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAnalyticsWidgetRequest"
              },
              "example": {
                "widgetCode": "entrances",
                "name": "Entrances",
                "nameI18n": {},
                "widgetType": "kpi",
                "definition": {
                  "metricCode": "entrance_traffic"
                },
                "expectedVersion": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsWidgetDetailEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "widgetId": "widget-entrances-uid",
                    "tenantId": "tenant-retail-uid",
                    "widgetCode": "entrances",
                    "name": "Entrances",
                    "nameI18n": {},
                    "widgetType": "kpi",
                    "definition": {
                      "metricCode": "entrance_traffic"
                    },
                    "versionNo": 1,
                    "status": 1
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/dashboard/widget-metrics": {
      "get": {
        "description": "**中文**\n\n无租户的平台超管通过 Analytics 读取已部署 Cube 的公开指标元数据。平台预览在浏览器生成模拟值。租户预览按授权范围查询事实数据。\n\n**English**\n\nPlatform administrators without a tenant read published metric metadata from the deployed Cube through Analytics. Platform previews use simulated values in the browser. Tenant previews query facts within the authorized scope.",
        "operationId": "listWidgetMetrics",
        "tags": [
          "dashboard"
        ],
        "summary": "管理员配置部件时使用的已发布指标目录；无需选择租户，仅返回指标定义 / List published metric definitions for widget authors without selecting a tenant",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n当前语言的指标定义\n\n**English**\n\nMetric definitions in the requested language.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WidgetMetricListEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": [
                    {
                      "code": "entrance_traffic",
                      "name": "Entrances",
                      "unit": "people",
                      "dimensions": [
                        "siteId"
                      ],
                      "granularities": [
                        "day"
                      ]
                    }
                  ],
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          }
        }
      }
    },
    "/api/platform/dashboard/dashboards/{dashboardId}/personal-layout": {
      "get": {
        "operationId": "getPersonalDashboardLayout",
        "tags": [
          "dashboard"
        ],
        "summary": "读取当前成员获授的共享看板和生效版面 / Get the member’s effective layout for an assigned dashboard",
        "parameters": [
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n共享看板的 UID。\n\n**English**\n\nUID of the shared dashboard.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonalDashboardLayoutEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "dashboardId": "dashboard-traffic-uid",
                    "sharedVersion": 1,
                    "personalVersion": 0,
                    "rdl": {
                      "rdlVersion": "1.0",
                      "widgets": []
                    }
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "operationId": "savePersonalDashboardLayout",
        "tags": [
          "dashboard"
        ],
        "summary": "按共享及个人版本保存原有卡位的位置、尺寸和显隐 / Save widget positions, dimensions and visibility against the shared and personal versions",
        "parameters": [
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n共享看板的 UID。\n\n**English**\n\nUID of the shared dashboard.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonalDashboardLayoutRequest"
              },
              "example": {
                "expectedSharedVersion": 1,
                "expectedPersonalVersion": 0,
                "widgets": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonalDashboardLayoutEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "dashboardId": "dashboard-traffic-uid",
                    "sharedVersion": 1,
                    "personalVersion": 0,
                    "rdl": {
                      "rdlVersion": "1.0",
                      "widgets": []
                    }
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/dashboard/dashboards/personal-order": {
      "post": {
        "operationId": "savePersonalDashboardOrder",
        "tags": [
          "dashboard"
        ],
        "summary": "按已读取的完整可见看板顺序保存本人排序 / Save personal order against the complete previous list of visible dashboards",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonalDashboardOrderRequest"
              },
              "example": {
                "previousDashboardIds": [
                  "dashboard-traffic-uid"
                ],
                "dashboardIds": [
                  "dashboard-traffic-uid"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PersonalDashboardOrderEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "dashboardIds": [
                      "dashboard-traffic-uid"
                    ]
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/dashboards": {
      "get": {
        "operationId": "listTenantDashboardAssignments",
        "tags": [
          "dashboard"
        ],
        "summary": "查询租户看板可用关系 / List the target tenant’s dashboard assignments",
        "description": "**中文**\n\n平台管理员可指定租户；租户管理员仅限当前租户。包含撤下记录，按 sort_no、uid 排序。\n\n**English**\n\nPlatform administrators can select the target tenant. Tenant administrators are restricted to their own tenant. Includes withdrawn assignments, ordered by sort number and dashboard UID.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n目标租户的 UID。\n\n**English**\n\nUID of the target tenant.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardAssignmentListEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": [
                    {
                      "tenantId": "tenant-retail-uid",
                      "dashboardId": "dashboard-traffic-uid",
                      "sourceType": "PLATFORM_ASSIGNED",
                      "sortNo": 10,
                      "status": 1,
                      "assignedBy": "platform-admin",
                      "assignedAt": "2026-12-02T00:00:00Z"
                    }
                  ],
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/dashboard-selection": {
      "get": {
        "operationId": "listTenantDashboardSelection",
        "tags": [
          "dashboard"
        ],
        "summary": "查询租户看板分配 / List tenant dashboard assignments",
        "description": "**中文**\n\n返回可管理的共享看板及其勾选状态。\n\n**English**\n\nReturns eligible shared dashboards and their selection state.",
        "parameters": [
          {
            "name": "tenantId",
            "description": "**中文**\n\n租户 UID。\n\n**English**\n\nTenant UID.",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n当前选择。\n\n**English**\n\nCurrent selection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSelectionEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": [
                    {
                      "dashboardId": "dashboard-traffic-uid",
                      "name": "Traffic",
                      "selected": true
                    }
                  ],
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      },
      "post": {
        "operationId": "updateTenantDashboardSelection",
        "tags": [
          "dashboard"
        ],
        "summary": "批量保存租户看板分配 / Update tenant dashboard assignments",
        "description": "**中文**\n\n仅提交新增和移除的看板。当前状态与预期不符时整批回滚。\n\n**English**\n\nSubmit additions and removals only. A stale selection rolls back the entire batch.",
        "parameters": [
          {
            "name": "tenantId",
            "description": "**中文**\n\n租户 UID。\n\n**English**\n\nTenant UID.",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardSelectionChanges"
              },
              "example": {
                "addedDashboardIds": [
                  "dashboard-traffic-uid"
                ],
                "removedDashboardIds": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n当前选择。\n\n**English**\n\nCurrent selection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSelectionEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": [
                    {
                      "dashboardId": "dashboard-traffic-uid",
                      "name": "Traffic",
                      "selected": true
                    }
                  ],
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/roles/{roleUid}/dashboards": {
      "get": {
        "operationId": "listRoleDashboardSelection",
        "tags": [
          "dashboard"
        ],
        "summary": "查询角色看板授权 / List role dashboard grants",
        "description": "**中文**\n\n返回可管理的共享看板及其勾选状态。\n\n**English**\n\nReturns eligible shared dashboards and their selection state.",
        "parameters": [
          {
            "name": "tenantId",
            "description": "**中文**\n\n租户 UID。\n\n**English**\n\nTenant UID.",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "name": "roleUid",
            "description": "**中文**\n\n目标角色 UID。\n\n**English**\n\nTarget role UID.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n当前选择。\n\n**English**\n\nCurrent selection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSelectionEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": [
                    {
                      "dashboardId": "dashboard-traffic-uid",
                      "name": "Traffic",
                      "selected": true
                    }
                  ],
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      },
      "post": {
        "operationId": "updateRoleDashboardSelection",
        "tags": [
          "dashboard"
        ],
        "summary": "批量保存角色看板授权 / Update role dashboard grants",
        "description": "**中文**\n\n仅提交新增和移除的看板。当前状态与预期不符时整批回滚。\n\n**English**\n\nSubmit additions and removals only. A stale selection rolls back the entire batch.",
        "parameters": [
          {
            "name": "tenantId",
            "description": "**中文**\n\n租户 UID。\n\n**English**\n\nTenant UID.",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "name": "roleUid",
            "description": "**中文**\n\n目标角色 UID。\n\n**English**\n\nTarget role UID.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardSelectionChanges"
              },
              "example": {
                "addedDashboardIds": [
                  "dashboard-traffic-uid"
                ],
                "removedDashboardIds": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n当前选择。\n\n**English**\n\nCurrent selection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSelectionEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": [
                    {
                      "dashboardId": "dashboard-traffic-uid",
                      "name": "Traffic",
                      "selected": true
                    }
                  ],
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/dashboards/{dashboardId}/preview": {
      "get": {
        "operationId": "previewTenantDashboardAssignment",
        "tags": [
          "dashboard"
        ],
        "summary": "预览待分配平台模板或本租户可用看板 / Preview a platform template or an assigned tenant dashboard",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n目标租户的 UID。\n\n**English**\n\nUID of the target tenant.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n共享看板的 UID。\n\n**English**\n\nUID of the shared dashboard.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n预览布局与引用的部件定义。\n\n**English**\n\nLayout preview and referenced widget definitions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AssignmentPreviewEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "rdl": {
                      "rdlVersion": "1.0",
                      "widgets": []
                    },
                    "widgets": []
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/dashboards/{dashboardId}/assignment": {
      "post": {
        "operationId": "saveTenantDashboardAssignment",
        "tags": [
          "dashboard"
        ],
        "summary": "设置租户看板分配、排序或撤下 / Assign, reorder or withdraw a tenant dashboard",
        "description": "**中文**\n\n仅平台管理员可新增或重新启用平台看板分配。租户管理员可排序或撤下已有平台分配、管理本租户共享看板；不能访问其他租户。status=0 在同一事务清理该租户该看板的全部角色授权，重新启用后须重新授权。sourceType 由看板归属确定。\n\n**English**\n\nOnly platform administrators can create or reactivate platform dashboard assignments. Tenant administrators may reorder or withdraw existing platform assignments and manage their own shared dashboards. Setting status to zero removes every role grant for that tenant and dashboard in the same transaction. Reactivation requires new grants. The dashboard owner determines sourceType.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n目标租户的 UID。\n\n**English**\n\nUID of the target tenant.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n共享看板的 UID。\n\n**English**\n\nUID of the shared dashboard.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardAssignmentRequest"
              },
              "example": {
                "sortNo": 10,
                "status": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardAssignmentEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "tenantId": "tenant-retail-uid",
                    "dashboardId": "dashboard-traffic-uid",
                    "sourceType": "PLATFORM_ASSIGNED",
                    "sortNo": 10,
                    "status": 1,
                    "assignedBy": "platform-admin",
                    "assignedAt": "2026-12-02T00:00:00Z"
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/dashboards/{dashboardId}/roles": {
      "get": {
        "operationId": "getDashboardRoleGrants",
        "tags": [
          "dashboard"
        ],
        "summary": "查询租户看板的有效本地角色授权 / Get active tenant role grants for the dashboard",
        "description": "**中文**\n\n平台或当前租户管理员读取；角色使用外部 roleUids，内部角色键不对外暴露。\n\n**English**\n\nPlatform administrators and administrators of the current tenant may read the grants. Roles are identified by their external UIDs.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n目标租户的 UID。\n\n**English**\n\nUID of the target tenant.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n共享看板的 UID。\n\n**English**\n\nUID of the shared dashboard.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardRoleGrantEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "tenantId": "tenant-retail-uid",
                    "dashboardId": "dashboard-traffic-uid",
                    "roleUids": [
                      "01900000-0000-7000-8000-000000000007"
                    ]
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    },
    "/api/platform/admin/dashboard/tenants/{tenantId}/dashboards/{dashboardId}/roles/update": {
      "post": {
        "operationId": "replaceDashboardRoleGrants",
        "tags": [
          "dashboard"
        ],
        "summary": "替换租户看板角色授权 / Replace the dashboard’s tenant role grants",
        "description": "**中文**\n\n平台或当前租户管理员操作。看板须为启用共享看板且租户关系生效；所有 roleUids 须属于目标租户的有效本地角色。空数组清空授权。撤下与授权按共享看板加锁，在同一事务完成。\n\n**English**\n\nPlatform administrators and administrators of the current tenant can replace grants on an enabled shared dashboard with an active tenant assignment. Every role UID must identify an active local role in that tenant. An empty list clears all grants. Grant updates and withdrawals lock the shared dashboard and apply their changes transactionally.",
        "parameters": [
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n目标租户的 UID。\n\n**English**\n\nUID of the target tenant.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          {
            "name": "dashboardId",
            "in": "path",
            "required": true,
            "description": "**中文**\n\n共享看板的 UID。\n\n**English**\n\nUID of the shared dashboard.",
            "schema": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardRoleGrantRequest"
              },
              "example": {
                "roleUids": [
                  "01900000-0000-7000-8000-000000000007"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n操作结果\n\n**English**\n\nResult of the requested operation.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardRoleGrantEnvelope"
                },
                "example": {
                  "code": 0,
                  "data": {
                    "tenantId": "tenant-retail-uid",
                    "dashboardId": "dashboard-traffic-uid",
                    "roleUids": [
                      "01900000-0000-7000-8000-000000000007"
                    ]
                  },
                  "message": "OK",
                  "requestId": "01900000-0000-7000-8000-000000000000"
                }
              }
            }
          },
          "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"
          }
        }
      }
    }
  },
  "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": {
      "WidgetMetric": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "name",
          "unit",
          "dimensions",
          "granularities"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "granularities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "supportsTotal": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "requiredDimensions": {
            "$ref": "#/components/schemas/Names"
          },
          "subject": {
            "$ref": "#/components/schemas/SubjectCapability"
          },
          "orgUnitGranularities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "orgRollup": {
            "type": "string"
          },
          "spatialRollup": {
            "type": "string"
          },
          "timeRollup": {
            "type": "string"
          },
          "dimensionDetails": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Dimension"
            }
          }
        }
      },
      "WidgetMetricListEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetMetric"
            }
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "SaveAnalyticsWidgetRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "widgetCode",
          "name",
          "widgetType",
          "definition"
        ],
        "properties": {
          "widgetCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "widgetType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "definition": {
            "$ref": "#/components/schemas/AnalyticsWidgetDefinition"
          }
        }
      },
      "UpdateAnalyticsWidgetRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "widgetCode",
          "name",
          "nameI18n",
          "widgetType",
          "definition",
          "expectedVersion"
        ],
        "properties": {
          "widgetCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "widgetType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "definition": {
            "$ref": "#/components/schemas/AnalyticsWidgetDefinition"
          },
          "expectedVersion": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "AnalyticsWidgetDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "widgetId",
          "tenantId",
          "widgetCode",
          "name",
          "nameI18n",
          "widgetType",
          "definition",
          "versionNo",
          "status"
        ],
        "properties": {
          "widgetId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantId": {
            "description": "**中文**\n\n租户隔离键。\"0\" 表示平台预置部件。\n\n**English**\n\nTenant UID. The value \"0\" denotes a platform widget.",
            "allOf": [
              {
                "$ref": "#/components/schemas/UidString"
              }
            ]
          },
          "widgetCode": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string"
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "widgetType": {
            "type": "string"
          },
          "definition": {
            "$ref": "#/components/schemas/AnalyticsWidgetDefinition"
          },
          "versionNo": {
            "type": "integer"
          },
          "status": {
            "type": "integer"
          }
        }
      },
      "PersonalDashboardLayout": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dashboardId",
          "sharedVersion",
          "personalVersion",
          "rdl"
        ],
        "properties": {
          "dashboardId": {
            "$ref": "#/components/schemas/UidString"
          },
          "sharedVersion": {
            "type": "integer",
            "minimum": 1
          },
          "personalVersion": {
            "type": "integer",
            "minimum": 0
          },
          "rdl": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "PersonalDashboardLayoutRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedSharedVersion",
          "expectedPersonalVersion",
          "widgets"
        ],
        "properties": {
          "expectedSharedVersion": {
            "type": "integer",
            "minimum": 1
          },
          "expectedPersonalVersion": {
            "type": "integer",
            "minimum": 0
          },
          "widgets": {
            "type": "array",
            "description": "**中文**\n\n原顺序与引用不可改变；校验 RDL WidgetPlacement。\n\n**English**\n\nKeep the original order and widget references. Placements are validated against RDL WidgetPlacement.",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "PersonalDashboardOrderRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "previousDashboardIds",
          "dashboardIds"
        ],
        "properties": {
          "previousDashboardIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          "dashboardIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        }
      },
      "PersonalDashboardOrder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dashboardIds"
        ],
        "properties": {
          "dashboardIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        }
      },
      "DashboardSelectionChanges": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "addedDashboardIds",
          "removedDashboardIds"
        ],
        "properties": {
          "addedDashboardIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            }
          },
          "removedDashboardIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UidString"
            }
          }
        }
      },
      "DashboardSelectionItem": {
        "type": "object",
        "required": [
          "dashboardId",
          "name",
          "selected"
        ],
        "properties": {
          "dashboardId": {
            "$ref": "#/components/schemas/UidString"
          },
          "name": {
            "type": "string"
          },
          "selected": {
            "type": "boolean"
          }
        }
      },
      "DashboardSelectionEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardSelectionItem"
            }
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DashboardAssignmentRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sortNo",
          "status"
        ],
        "properties": {
          "sortNo": {
            "type": "integer",
            "minimum": 0,
            "maximum": 999999
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          }
        }
      },
      "DashboardAssignment": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "dashboardId",
          "sourceType",
          "sortNo",
          "status",
          "assignedBy",
          "assignedAt"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "dashboardId": {
            "$ref": "#/components/schemas/UidString"
          },
          "sourceType": {
            "type": "string",
            "enum": [
              "PLATFORM_ASSIGNED",
              "TENANT_OWNED"
            ]
          },
          "sortNo": {
            "type": "integer",
            "minimum": 0,
            "maximum": 999999
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1
            ]
          },
          "assignedBy": {
            "type": "string",
            "minLength": 1
          },
          "assignedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DashboardRoleGrantRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "roleUids"
        ],
        "properties": {
          "expectedGrant": {
            "$ref": "#/components/schemas/DashboardRoleGrant"
          },
          "roleUids": {
            "type": "array",
            "uniqueItems": true,
            "maxItems": 1000,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "DashboardRoleGrant": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "dashboardId",
          "roleUids"
        ],
        "properties": {
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "dashboardId": {
            "$ref": "#/components/schemas/UidString"
          },
          "roleUids": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "AnalyticsWidgetDetailEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/AnalyticsWidgetDetail"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "PersonalDashboardLayoutEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PersonalDashboardLayout"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "PersonalDashboardOrderEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/PersonalDashboardOrder"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DashboardAssignmentEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/DashboardAssignment"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DashboardAssignmentListEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardAssignment"
            }
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DashboardRoleGrantEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/DashboardRoleGrant"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DashboardType": {
        "type": "string",
        "description": "**中文**\n\n看板业务页型。SITE_TRAFFIC 对应场所客流看板，ORG_UNIT_TRAFFIC 对应组织客流看板。\n\n**English**\n\nDashboard business type. SITE_TRAFFIC is a site traffic dashboard and ORG_UNIT_TRAFFIC is an org unit traffic dashboard.",
        "enum": [
          "SITE_TRAFFIC",
          "ORG_UNIT_TRAFFIC"
        ]
      },
      "DashboardSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dashboardId",
          "tenantId",
          "dashboardCode",
          "name",
          "dashboardType",
          "versionNo",
          "status"
        ],
        "properties": {
          "dashboardId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "dashboardCode": {
            "type": "string",
            "description": "**中文**\n\n看板的业务编码。\n\n**English**\n\nBusiness code of the dashboard."
          },
          "name": {
            "type": "string",
            "description": "**中文**\n\n按请求语言解析的看板显示名称。\n\n**English**\n\nDashboard display name resolved for the requested language."
          },
          "dashboardType": {
            "$ref": "#/components/schemas/DashboardType"
          },
          "versionNo": {
            "type": "integer",
            "description": "**中文**\n\n当前定义的修订版本号。\n\n**English**\n\nRevision number of the current definition."
          },
          "status": {
            "type": "integer",
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          },
          "sourceTemplateId": {
            "allOf": [
              {
                "$ref": "#/components/schemas/UidString"
              }
            ],
            "description": "**中文**\n\n来源全局模板的不可变 uid。没有来源模板时为字符串 \"0\"。\n\n**English**\n\nImmutable UID of the source global template. The string \"0\" indicates no source template."
          },
          "sourceVersion": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n首次脱离时的全局模板版本。没有来源模板时为 0。\n\n**English**\n\nGlobal template version at the first detachment. Use 0 when there is no source template."
          },
          "isDetached": {
            "type": "boolean",
            "description": "**中文**\n\n当前行是否为租户脱离后的独立副本。\n\n**English**\n\nWhether the current record is the independent copy created when the tenant detached."
          },
          "detachedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "**中文**\n\n首次脱离发生的时间。\n\n**English**\n\nTime when the first detachment occurred."
          }
        }
      },
      "DashboardDetail": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dashboardId",
          "tenantId",
          "dashboardCode",
          "name",
          "nameI18n",
          "dashboardType",
          "versionNo",
          "status",
          "rdl"
        ],
        "properties": {
          "dashboardId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantId": {
            "$ref": "#/components/schemas/UidString"
          },
          "dashboardCode": {
            "type": "string",
            "description": "**中文**\n\n看板的业务编码。\n\n**English**\n\nBusiness code of the dashboard."
          },
          "name": {
            "type": "string",
            "description": "**中文**\n\n默认语言基础值。\n\n**English**\n\nBase value in the default language."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "dashboardType": {
            "$ref": "#/components/schemas/DashboardType"
          },
          "versionNo": {
            "type": "integer",
            "description": "**中文**\n\n当前定义的修订版本号。\n\n**English**\n\nRevision number of the current definition."
          },
          "status": {
            "type": "integer",
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          },
          "rdl": {
            "type": "object",
            "additionalProperties": true,
            "description": "**中文**\n\n页面的元信息、全局筛选配置与部件栅格布局。按 rdl.schema.json#/$defs/UpdateRdl 校验（R17）。\n有 title 时返回完整 titleI18n；没有译文时返回 {}。读取仅有 title 的旧存储时，管理投影补上 titleI18n: {}。\n\n**English**\n\nPage metadata, global filter configuration, and widget grid layout, validated against rdl.schema.json#/$defs/UpdateRdl (R17).\nReturn the complete titleI18n when title is present. If no translation exists, return {}. When reading legacy storage containing only title, add titleI18n: {} to the management projection."
          },
          "sourceTemplateId": {
            "allOf": [
              {
                "$ref": "#/components/schemas/UidString"
              }
            ],
            "description": "**中文**\n\n来源全局模板的不可变 uid。没有来源模板时为字符串 \"0\"。\n\n**English**\n\nImmutable UID of the source global template. The string \"0\" indicates no source template."
          },
          "sourceVersion": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n首次脱离时的全局模板版本。没有来源模板时为 0。\n\n**English**\n\nGlobal template version at the first detachment. Use 0 when there is no source template."
          },
          "isDetached": {
            "type": "boolean",
            "description": "**中文**\n\n当前行是否为租户脱离后的独立副本。\n\n**English**\n\nWhether the current record is the independent copy created when the tenant detached."
          },
          "detachedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "**中文**\n\n首次脱离发生的时间。\n\n**English**\n\nTime when the first detachment occurred."
          },
          "detachedTenantCount": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n平台超管查看全局模板时，已从该模板脱离的租户数量。\n\n**English**\n\nNumber of tenants detached from this global template when viewed by a platform administrator."
          }
        }
      },
      "SaveDashboardRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dashboardCode",
          "name",
          "dashboardType",
          "rdl"
        ],
        "properties": {
          "pendingWidgets": {
            "description": "**中文**\n\n随本次保存创建的独立部件。每个 draft.<uuid> 编码必须出现在本次 RDL 中，服务端在同一事务替换为部件 UID。\n\n**English**\n\nIndependent widgets created with this save. Each draft.<uuid> code must appear in the submitted RDL. The server replaces it with the persisted widget UID in the same transaction.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SaveAnalyticsWidgetRequest"
            }
          },
          "dashboardCode": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n看板的业务编码。\n\n**English**\n\nBusiness code of the dashboard."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n默认语言基础值。\n\n**English**\n\nBase value in the default language."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "dashboardType": {
            "$ref": "#/components/schemas/DashboardType"
          },
          "rdl": {
            "type": "object",
            "additionalProperties": true,
            "description": "**中文**\n\n页面的元信息、全局筛选配置与部件栅格布局。按 rdl.schema.json 根 Schema 校验（R17），有 title 时可省略 titleI18n。\n\n**English**\n\nPage metadata, global filter configuration, and widget grid layout, validated against the root schema of rdl.schema.json (R17). If title is present, titleI18n may be omitted."
          }
        }
      },
      "UpdateDashboardRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dashboardCode",
          "name",
          "nameI18n",
          "dashboardType",
          "rdl"
        ],
        "properties": {
          "pendingWidgets": {
            "description": "**中文**\n\n随本次保存创建的独立部件。每个 draft.<uuid> 编码必须出现在本次 RDL 中，服务端在同一事务替换为部件 UID。\n\n**English**\n\nIndependent widgets created with this save. Each draft.<uuid> code must appear in the submitted RDL. The server replaces it with the persisted widget UID in the same transaction.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SaveAnalyticsWidgetRequest"
            }
          },
          "expectedVersion": {
            "type": "integer",
            "minimum": 1
          },
          "dashboardCode": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n看板的业务编码。\n\n**English**\n\nBusiness code of the dashboard."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n默认语言基础值。\n\n**English**\n\nBase value in the default language."
          },
          "nameI18n": {
            "$ref": "#/components/schemas/LocalizedText"
          },
          "dashboardType": {
            "$ref": "#/components/schemas/DashboardType"
          },
          "rdl": {
            "type": "object",
            "additionalProperties": true,
            "description": "**中文**\n\n页面的元信息、全局筛选配置与部件栅格布局。按 rdl.schema.json#/$defs/UpdateRdl 校验（R17），有 title 时必须提供完整 titleI18n。\n\n**English**\n\nPage metadata, global filter configuration, and widget grid layout, validated against rdl.schema.json#/$defs/UpdateRdl (R17). If title is present, the complete titleI18n must be supplied."
          }
        }
      },
      "AssignmentPreviewData": {
        "type": "object",
        "required": [
          "rdl",
          "widgets"
        ],
        "properties": {
          "rdl": {
            "type": "object",
            "additionalProperties": true
          },
          "widgets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsWidget"
            }
          }
        }
      },
      "AssignmentPreviewEnvelope": {
        "type": "object",
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/AssignmentPreviewData"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "WidgetCatalogData": {
        "type": "object",
        "required": [
          "items",
          "page"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsWidget"
            }
          },
          "page": {
            "$ref": "#/components/schemas/PageMeta"
          }
        }
      },
      "WidgetCatalogEnvelope": {
        "type": "object",
        "required": [
          "code",
          "data",
          "message",
          "requestId"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "data": {
            "$ref": "#/components/schemas/WidgetCatalogData"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "DashboardPageData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "page"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardSummary"
            },
            "description": "**中文**\n\n本页当前用户可见的看板列表。\n\n**English**\n\nList of dashboards visible to the current user in this page."
          },
          "page": {
            "$ref": "#/components/schemas/PageMeta"
          }
        }
      },
      "DashboardPageEnvelope": {
        "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/DashboardPageData"
          },
          "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."
          }
        }
      },
      "DashboardDetailEnvelope": {
        "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/DashboardDetail"
          },
          "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."
          }
        }
      },
      "AnalyticsWidget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "widgetId",
          "tenantId",
          "widgetCode",
          "name",
          "widgetType",
          "definition",
          "versionNo",
          "status"
        ],
        "properties": {
          "widgetId": {
            "$ref": "#/components/schemas/UidString"
          },
          "tenantId": {
            "description": "**中文**\n\n租户隔离键。\"0\" 表示平台预置部件。\n\n**English**\n\nTenant isolation key. \"0\" denotes a platform built-in widget.",
            "allOf": [
              {
                "$ref": "#/components/schemas/UidString"
              }
            ]
          },
          "widgetCode": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n分析部件的业务编码，按编码引用时租户项可覆盖平台预置项。\n\n**English**\n\nBusiness code of the analytics widget. Tenant entries can override platform built-in entries for code references."
          },
          "name": {
            "type": "string",
            "description": "**中文**\n\n分析部件名称。\n\n**English**\n\nName of the analytics widget."
          },
          "widgetType": {
            "type": "string",
            "description": "**中文**\n\n决定部件展示类型的键，例如 kpi。\n\n**English**\n\nKey identifying the widget's presentation type, such as kpi."
          },
          "definition": {
            "$ref": "#/components/schemas/AnalyticsWidgetDefinition"
          },
          "versionNo": {
            "type": "integer",
            "description": "**中文**\n\n当前定义的修订版本号。\n\n**English**\n\nRevision number of the current definition."
          },
          "status": {
            "type": "integer",
            "description": "**中文**\n\n启用状态，1 表示启用，0 表示停用。\n\n**English**\n\nEnabled status. 1 means enabled and 0 means disabled."
          }
        }
      },
      "WidgetScopeInput": {
        "type": "object",
        "x-class-extra-annotation": "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "page",
              "local",
              "fixed"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "site",
              "orgUnit"
            ]
          },
          "ids": {
            "$ref": "#/components/schemas/Names"
          }
        }
      },
      "WidgetDateInput": {
        "type": "object",
        "x-class-extra-annotation": "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "page",
              "local",
              "fixed"
            ]
          },
          "preset": {
            "type": "string",
            "enum": [
              "today",
              "yesterday",
              "last7Days",
              "last30Days",
              "last7CompleteDays",
              "last30CompleteDays",
              "weekToDate",
              "previousWeek",
              "monthToDate",
              "previousMonth"
            ]
          },
          "range": {
            "$ref": "#/components/schemas/DateRange"
          }
        }
      },
      "WidgetDimensionInput": {
        "type": "object",
        "x-class-extra-annotation": "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)",
        "required": [
          "member",
          "mode"
        ],
        "properties": {
          "member": {
            "type": "string",
            "minLength": 1
          },
          "mode": {
            "type": "string",
            "enum": [
              "page",
              "local",
              "fixed"
            ]
          },
          "values": {
            "$ref": "#/components/schemas/Names"
          }
        }
      },
      "WidgetInputs": {
        "type": "object",
        "x-class-extra-annotation": "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL)",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/WidgetScopeInput"
          },
          "dateRange": {
            "$ref": "#/components/schemas/WidgetDateInput"
          },
          "dimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WidgetDimensionInput"
            }
          }
        }
      },
      "WidgetResultOrder": {
        "type": "object",
        "required": [
          "metric",
          "by",
          "direction"
        ],
        "properties": {
          "metric": {
            "type": "string",
            "minLength": 1
          },
          "by": {
            "type": "string",
            "enum": [
              "current",
              "difference",
              "changeRate"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ]
          }
        }
      },
      "AnalyticsWidgetDefinition": {
        "type": "object",
        "additionalProperties": true,
        "x-class-extra-annotation": "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY)",
        "required": [
          "metricCode"
        ],
        "properties": {
          "metricCode": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n分析部件绑定的单一指标编码，引用已发布的指标目录。\n\n**English**\n\nCode of the single metric bound to the analytics widget, referencing the published metric catalog."
          },
          "timeGrain": {
            "type": "string",
            "enum": [
              "total",
              "10min",
              "hour",
              "day",
              "week",
              "month"
            ]
          },
          "visualization": {
            "type": "object",
            "additionalProperties": true
          },
          "additionalMetrics": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "inputs": {
            "$ref": "#/components/schemas/WidgetInputs"
          },
          "comparison": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "mode": {
                "type": "string"
              },
              "unit": {
                "type": "string",
                "enum": [
                  "week",
                  "month",
                  "year"
                ]
              },
              "extent": {
                "type": "string",
                "enum": [
                  "elapsed",
                  "full"
                ]
              },
              "inputs": {
                "$ref": "#/components/schemas/WidgetInputs"
              }
            }
          },
          "grouping": {
            "type": "string",
            "enum": [
              "organization"
            ]
          },
          "calculation": {
            "type": "string",
            "enum": [
              "perAuthorizedSite"
            ]
          },
          "resultOrder": {
            "$ref": "#/components/schemas/WidgetResultOrder"
          },
          "target": {
            "$ref": "#/components/schemas/SubjectTarget"
          },
          "dimensions": {
            "$ref": "#/components/schemas/Names"
          },
          "filters": {
            "$ref": "#/components/schemas/Filters"
          },
          "order": {
            "$ref": "#/components/schemas/QueryOrder"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "**中文**\n\n部件查询的最大结果行数。\n\n**English**\n\nMaximum number of result rows for the widget query."
          },
          "dashboardTypeScope": {
            "description": "**中文**\n\n适用的看板页型。省略时适用于所有页型。\n\n**English**\n\nApplicable dashboard types. If omitted, the widget applies to all dashboard types.",
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/DashboardType"
            }
          }
        }
      },
      "AnalyticsWidgetListEnvelope": {
        "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": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsWidget"
            },
            "description": "**中文**\n\n当前租户可用的启用分析部件定义列表。\n\n**English**\n\nList of enabled analytics widget definitions available to the current tenant."
          },
          "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."
          }
        }
      },
      "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."
      },
      "Names": {
        "type": "array",
        "uniqueItems": true,
        "items": {
          "type": "string",
          "minLength": 1
        },
        "description": "**中文**\n\n去重的非空名称或编码列表。\n\n**English**\n\nUnique list of non-empty names or codes."
      },
      "SubjectCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scopes",
          "targets"
        ],
        "properties": {
          "scopes": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/Level"
            },
            "description": "**中文**\n\n指标支持的查询范围层级。\n\n**English**\n\nQuery scope levels supported by the metric."
          },
          "targets": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/TargetCapability"
            },
            "description": "**中文**\n\n指标支持的统计对象及各对象的能力。\n\n**English**\n\nStatistical subjects supported by the metric and their capabilities."
          }
        }
      },
      "Level": {
        "type": "string",
        "enum": [
          "orgUnit",
          "site",
          "space",
          "slot"
        ],
        "description": "**中文**\n\n查询范围层级：orgUnit 组织单元、site 场所、space 空间、slot 槽位。\n\n**English**\n\nQuery scope level: orgUnit for org unit, site for site, space for space, and slot for slot."
      },
      "TargetCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "target"
        ],
        "properties": {
          "target": {
            "$ref": "#/components/schemas/SubjectTarget"
          },
          "spaceTypes": {
            "description": "**中文**\n\n统计对象为 `space` 时支持的空间类型。\n\n**English**\n\nSupported space types when the statistical subject is space.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Names"
              }
            ]
          },
          "slotTypes": {
            "type": "array",
            "uniqueItems": true,
            "description": "**中文**\n\n统计对象为 `slot` 时支持的槽位类型。\n\n**English**\n\nSupported slot types when the statistical subject is slot.",
            "items": {
              "$ref": "#/components/schemas/SlotType"
            }
          }
        }
      },
      "SubjectTarget": {
        "type": "string",
        "enum": [
          "site",
          "space",
          "slot"
        ],
        "description": "**中文**\n\n指标查询的统计对象类型：site 场所整体、space 空间、slot 槽位。\n\n**English**\n\nMetric query subject type: site for whole sites, space for spaces, and slot for slots."
      },
      "SlotType": {
        "type": "string",
        "enum": [
          "ELEVATION",
          "TIER",
          "CELL",
          "BAY",
          "STATION",
          "SCREEN"
        ],
        "description": "**中文**\n\n空间槽位类型：ELEVATION 立面、TIER 层、CELL 格位、BAY 节、STATION 工位、SCREEN 互动屏。\n\n**English**\n\nSpace slot type: ELEVATION for elevation, TIER for tier, CELL for cell, BAY for bay, STATION for station, and SCREEN for interactive screen."
      },
      "Dimension": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "title",
          "type",
          "operators"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "**中文**\n\n维度在查询中使用的名称。\n\n**English**\n\nDimension name used in queries."
          },
          "title": {
            "type": "string",
            "description": "**中文**\n\n维度的展示标题。\n\n**English**\n\nDisplay title of the dimension."
          },
          "type": {
            "type": "string",
            "description": "**中文**\n\n维度值的类型标识。\n\n**English**\n\nDimension value type identifier."
          },
          "description": {
            "type": "string",
            "description": "**中文**\n\n维度的业务含义说明。\n\n**English**\n\nBusiness meaning of the dimension."
          },
          "operators": {
            "$ref": "#/components/schemas/Names"
          }
        }
      },
      "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)."
          }
        }
      },
      "PageMeta": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "limit",
          "offset",
          "hasMore"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "description": "**中文**\n\n本页最大条数。\n\n**English**\n\nMaximum number of records in this page."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n跳过的记录条数。\n\n**English**\n\nNumber of records skipped."
          },
          "hasMore": {
            "type": "boolean",
            "description": "**中文**\n\n当前页之后是否还有更多记录。\n\n**English**\n\nWhether additional records exist after this page."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "**中文**\n\n符合条件的总条数；未请求总数统计时可为 `null` 或省略。\n\n**English**\n\nTotal number of matching records. It may be null or omitted when a total count was not requested."
          }
        }
      },
      "DateRange": {
        "description": "**中文**\n\n有界起止时间范围（含首尾），两端同为 `YYYY-MM-DD HH:mm:ss` 或同为 `YYYY-MM-DD`，不可混用；单次范围不超过 366 天。\n\n**English**\n\nBounded start and end time range, inclusive at both ends. Both endpoints must use YYYY-MM-DD HH:mm:ss or both must use YYYY-MM-DD, with no mixing. Each range must not exceed 366 days.",
        "oneOf": [
          {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/LocalDateTime"
            }
          },
          {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/LocalDate"
            }
          }
        ]
      },
      "LocalDateTime": {
        "type": "string",
        "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01]) ([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d$",
        "description": "**中文**\n\n`YYYY-MM-DD HH:mm:ss`，按 `meta.timezone` 解释，不带 Z、时区偏移或毫秒。\n\n**English**\n\nYYYY-MM-DD HH:mm:ss, interpreted in meta.timezone, without Z, time-zone offsets, or milliseconds."
      },
      "LocalDate": {
        "type": "string",
        "pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$",
        "description": "**中文**\n\n`YYYY-MM-DD`；按营业日 `stat_date` 或本地日期解释。\n\n**English**\n\nYYYY-MM-DD, interpreted as the business date (stat_date) or local date."
      },
      "Filters": {
        "type": "array",
        "description": "**中文**\n\n顶层数组元素取 AND；筛选维度不必出现在结果分组 `dimensions` 中。\n\n**English**\n\nCombine top-level array elements with AND. Filter dimensions need not appear in the dimensions used for result grouping.",
        "items": {
          "$ref": "#/components/schemas/DimensionFilter"
        }
      },
      "DimensionFilter": {
        "description": "**中文**\n\n叶子条件或 `and`/`or` 逻辑节点；每个叶子只能引用对应指标允许的维度。\n\n**English**\n\nA leaf predicate or an and/or logical node. Each leaf may reference only dimensions allowed by the corresponding metric.",
        "x-class-extra-annotation": "@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION)\n@JsonSubTypes({@JsonSubTypes.Type(FilterPredicate.class), @JsonSubTypes.Type(FilterAnd.class), @JsonSubTypes.Type(FilterOr.class)})\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/FilterPredicate"
          },
          {
            "$ref": "#/components/schemas/FilterAnd"
          },
          {
            "$ref": "#/components/schemas/FilterOr"
          }
        ]
      },
      "FilterPredicate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "member",
          "operator"
        ],
        "properties": {
          "member": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n`meta` 发布的维度名称。\n\n**English**\n\nDimension name published in meta."
          },
          "operator": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n必须出现在该维度的 `operators` 列表中。\n\n**English**\n\nMust be listed in operators for the dimension."
          },
          "values": {
            "type": "array",
            "x-field-extra-annotation": "@com.fasterxml.jackson.annotation.JsonInclude(com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY)",
            "items": {
              "type": "string",
              "nullable": true
            },
            "description": "**中文**\n\n双键实体 ID 维度的非空值遵循 UidString；行政区划 ID 与其他文本或数值维度沿用各自标识或字符串值。仅当操作符明确支持时可含 `null`。\n\n**English**\n\nNon-null values for dual-key entity ID dimensions conform to UidString. Administrative region IDs and other textual or numeric dimensions retain their own identifiers or string values. null is allowed only when explicitly supported by the operator."
          }
        }
      },
      "FilterAnd": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "and"
        ],
        "properties": {
          "and": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/DimensionFilter"
            },
            "description": "**中文**\n\n须同时满足的筛选子条件列表。\n\n**English**\n\nList of child filter conditions that must all be satisfied."
          }
        }
      },
      "FilterOr": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "or"
        ],
        "properties": {
          "or": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/DimensionFilter"
            },
            "description": "**中文**\n\n须至少满足其中一项的筛选子条件列表。\n\n**English**\n\nList of child filter conditions of which at least one must be satisfied."
          }
        }
      },
      "QueryOrder": {
        "type": "array",
        "description": "**中文**\n\n实体 ID 维度按内部主键排序，非实体维度按基础值或时间顺序排序。\n\n**English**\n\nEntity ID dimensions are sorted by internal primary key; other dimensions are sorted by base value or chronological order.",
        "items": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "member",
            "direction"
          ],
          "properties": {
            "member": {
              "type": "string",
              "description": "**中文**\n\n排序字段名称，使用查询支持的维度、时间分组或指标名称。\n\n**English**\n\nSort member name, using a dimension, time grouping, or metric name supported by the query."
            },
            "direction": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "description": "**中文**\n\n排序方向，asc 为升序，desc 为降序。\n\n**English**\n\nSort direction. asc means ascending and desc means descending."
            }
          }
        }
      }
    },
    "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"
        }
      }
    },
    "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"
        }
      }
    },
    "responses": {
      "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"
            }
          }
        }
      },
      "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"
            }
          }
        }
      },
      "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"
            }
          }
        }
      },
      "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"
            }
          }
        }
      },
      "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"
            }
          }
        }
      },
      "GatewayTimeout": {
        "description": "**中文**\n\n上游依赖超时（code 50401）。\n\n**English**\n\nUpstream dependency timed out (code 50401).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 50401,
              "data": null,
              "message": "Upstream service timed out.",
              "requestId": "550e8400-e29b-41d4-a716-446655440010"
            }
          }
        }
      }
    }
  }
}
