{
  "openapi": "3.0.3",
  "info": {
    "title": "Vion 7.0 Metrics Query API",
    "version": "0.1.0",
    "description": "**中文**\n\nVion 7.0 平台 analytics 模块的指标查询契约。每次查询分别选择统计对象、数据范围与分组。\n指标能力由鉴权后的 `/api/metrics/v1/meta` 发布。所有响应携带响应头 `X-Request-Id`，与响应体 `requestId` 一致。成功 `code` 为 `0`，失败 `data` 为 `null`。\n双键实体维度（如 siteId、orgUnitId、spaceId、slotId、productId）及其范围、筛选值、维度选项和结果使用 UidString 的不可变 uid。cityId 仍使用行政区划 ID。\n时间按 `meta.timezone` 解释，包含首尾。\n\n**English**\n\nVion 7.0 platform analytics module metric query contract. Each query selects the statistical subject, data scope and grouping separately.\nMetric capabilities are published by the authenticated /api/metrics/v1/meta endpoint. All responses include the X-Request-Id header, matching requestId in the response body. Success has code 0; failures have null data.\nDual-key entity dimensions (such as siteId, orgUnitId, spaceId, slotId and productId), their scopes, filters, dimension options and results use immutable UIDs conforming to UidString. cityId retains the administrative region ID.\nTime is interpreted in meta.timezone, with both endpoints inclusive."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Metadata",
      "description": "**中文**\n\n指标能力目录与维度可选值发现\n\n**English**\n\nMetric capabilities catalog and dimension option discovery"
    },
    {
      "name": "Queries",
      "description": "**中文**\n\n指标多维聚合查询\n\n**English**\n\nMultidimensional metric aggregation queries"
    }
  ],
  "x-doc-groups": [
    {
      "id": "metadata",
      "title": "指标目录与维度选项 / Metric Catalog and Dimension Options",
      "operations": [
        "getMetricMetadata",
        "queryDimensionValues"
      ]
    },
    {
      "id": "queries",
      "title": "指标查询 / Metric Queries",
      "operations": [
        "queryMetrics"
      ]
    }
  ],
  "paths": {
    "/api/metrics/v1/meta": {
      "get": {
        "operationId": "getMetricMetadata",
        "tags": [
          "Metadata"
        ],
        "summary": "获取授权指标查询能力目录 / Read the authorized metric query capabilities catalog",
        "description": "**中文**\n\n返回当前部署及租户能力范围内已发布的业务指标、维度、操作符与默认时区。不返回组织单元树或场所清单（组织单元树与场所清单由平台接口提供）。\n\n**English**\n\nReturn published business metrics, dimensions, operators, and the default time zone within the scope of the current deployment and tenant capabilities. The org unit tree and site directory are excluded and are provided by the platform API.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "responses": {
          "200": {
            "description": "**中文**\n\n公开业务指标、维度与逐指标能力目录\n\n**English**\n\nPublic catalog of business metrics, dimensions, and per-metric capabilities",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataResponse"
                },
                "examples": {
                  "catalog": {
                    "summary": "7.0 指标能力目录示例 / Example 7.0 metric capabilities catalog",
                    "value": {
                      "code": 0,
                      "data": {
                        "timezone": "Asia/Shanghai",
                        "metrics": [
                          {
                            "code": "avg_dwell_minutes",
                            "name": "Average dwell time",
                            "type": "number",
                            "unit": "minutes",
                            "description": "Total matched dwell seconds divided by matched visits and converted to minutes.",
                            "dimensions": [
                              "siteId",
                              "siteName",
                              "cityId",
                              "city",
                              "orgUnitId",
                              "spaceId",
                              "spaceType",
                              "parentSpaceId",
                              "ancestorSpaceId"
                            ],
                            "requiredDimensions": [],
                            "subject": {
                              "scopes": [
                                "orgUnit",
                                "site",
                                "space"
                              ],
                              "targets": [
                                {
                                  "target": "site"
                                },
                                {
                                  "target": "space",
                                  "spaceTypes": [
                                    "floor",
                                    "zone",
                                    "shop",
                                    "shelf",
                                    "display_table"
                                  ]
                                }
                              ]
                            },
                            "time": {
                              "granularities": [
                                "10min",
                                "hour",
                                "day",
                                "week",
                                "month"
                              ],
                              "orgUnitGranularities": [
                                "day",
                                "week",
                                "month"
                              ],
                              "supportsTotal": true
                            },
                            "orgRollup": "RATIO_OF_SUMS",
                            "spatialRollup": "NONE",
                            "timeRollup": "RATIO_OF_SUMS",
                            "formulaVersion": "v1"
                          },
                          {
                            "code": "entrance_traffic",
                            "name": "Entrance traffic",
                            "type": "number",
                            "unit": "count",
                            "description": "Sum of entrances.",
                            "dimensions": [
                              "siteId",
                              "siteName",
                              "cityId",
                              "city",
                              "orgUnitId",
                              "spaceId",
                              "spaceType",
                              "parentSpaceId",
                              "ancestorSpaceId"
                            ],
                            "requiredDimensions": [],
                            "subject": {
                              "scopes": [
                                "orgUnit",
                                "site",
                                "space"
                              ],
                              "targets": [
                                {
                                  "target": "site"
                                },
                                {
                                  "target": "space",
                                  "spaceTypes": [
                                    "building",
                                    "floor",
                                    "escalator",
                                    "portal",
                                    "zone",
                                    "shop"
                                  ]
                                }
                              ]
                            },
                            "time": {
                              "granularities": [
                                "10min",
                                "hour",
                                "day",
                                "week",
                                "month"
                              ],
                              "orgUnitGranularities": [
                                "day",
                                "week",
                                "month"
                              ],
                              "supportsTotal": true
                            },
                            "orgRollup": "ADDITIVE",
                            "spatialRollup": "NONE",
                            "timeRollup": "ADDITIVE",
                            "formulaVersion": "v1"
                          },
                          {
                            "code": "entry_rate",
                            "name": "Entry rate",
                            "type": "number",
                            "unit": "ratio",
                            "description": "Entrances divided by total passersby.",
                            "dimensions": [
                              "siteId",
                              "siteName",
                              "cityId",
                              "city",
                              "orgUnitId",
                              "spaceId",
                              "spaceType",
                              "parentSpaceId",
                              "ancestorSpaceId"
                            ],
                            "requiredDimensions": [],
                            "subject": {
                              "scopes": [
                                "orgUnit",
                                "site",
                                "space"
                              ],
                              "targets": [
                                {
                                  "target": "site"
                                },
                                {
                                  "target": "space",
                                  "spaceTypes": [
                                    "building",
                                    "floor",
                                    "escalator",
                                    "portal",
                                    "zone",
                                    "shop"
                                  ]
                                }
                              ]
                            },
                            "time": {
                              "granularities": [
                                "10min",
                                "hour",
                                "day",
                                "week",
                                "month"
                              ],
                              "orgUnitGranularities": [
                                "day",
                                "week",
                                "month"
                              ],
                              "supportsTotal": true
                            },
                            "orgRollup": "RATIO_OF_SUMS",
                            "spatialRollup": "NONE",
                            "timeRollup": "RATIO_OF_SUMS",
                            "formulaVersion": "v1"
                          },
                          {
                            "code": "outside_traffic",
                            "name": "Pass-by traffic",
                            "type": "number",
                            "unit": "count",
                            "description": "Sum of passersby in both directions.",
                            "dimensions": [
                              "siteId",
                              "siteName",
                              "cityId",
                              "city",
                              "orgUnitId",
                              "spaceId",
                              "spaceType",
                              "parentSpaceId",
                              "ancestorSpaceId"
                            ],
                            "requiredDimensions": [],
                            "subject": {
                              "scopes": [
                                "orgUnit",
                                "site",
                                "space"
                              ],
                              "targets": [
                                {
                                  "target": "site"
                                },
                                {
                                  "target": "space",
                                  "spaceTypes": [
                                    "building",
                                    "floor",
                                    "escalator",
                                    "portal",
                                    "zone",
                                    "shop"
                                  ]
                                }
                              ]
                            },
                            "time": {
                              "granularities": [
                                "10min",
                                "hour",
                                "day",
                                "week",
                                "month"
                              ],
                              "orgUnitGranularities": [
                                "day",
                                "week",
                                "month"
                              ],
                              "supportsTotal": true
                            },
                            "orgRollup": "ADDITIVE",
                            "spatialRollup": "NONE",
                            "timeRollup": "ADDITIVE",
                            "formulaVersion": "v1"
                          }
                        ],
                        "dimensions": [
                          {
                            "name": "siteId",
                            "title": "Site ID",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "siteName",
                            "title": "Site name",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "contains",
                              "notContains",
                              "startsWith",
                              "notStartsWith",
                              "endsWith",
                              "notEndsWith",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "cityId",
                            "title": "City ID",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "city",
                            "title": "City",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "contains",
                              "notContains",
                              "startsWith",
                              "notStartsWith",
                              "endsWith",
                              "notEndsWith",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "orgUnitId",
                            "title": "Organization unit ID",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "spaceId",
                            "title": "Space ID",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "spaceType",
                            "title": "Space type",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "parentSpaceId",
                            "title": "Parent space ID",
                            "type": "string",
                            "operators": [
                              "equals",
                              "notEquals",
                              "set",
                              "notSet"
                            ]
                          },
                          {
                            "name": "ancestorSpaceId",
                            "title": "Ancestor space ID",
                            "type": "string",
                            "operators": [
                              "equals"
                            ]
                          }
                        ]
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440400"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/metrics/v1/dimension-values/query": {
      "post": {
        "operationId": "queryDimensionValues",
        "tags": [
          "Metadata"
        ],
        "summary": "查询维度可选值 / Query dimension options",
        "description": "**中文**\n\n查询 `meta` 中已发布维度的去重取值与展示标签。范围与筛选受当前用户数据权限限制。\n实体选择使用 ID 维度（如 siteId、cityId）。双键实体的 value 为 uid，行政区划的 value 为既有 ID，label 按请求语言显示。同名实体分别返回，选中后以同一 ID 维度的 equals 条件提交 value。\nsiteName、city 的取值用于基础文本查询，按数据库的文本比较规则去重，value 与 label 均为基础文本。搜索基于基础字段，排序与分页基于内部主键或基础值，实体维度不保证按 uid 字典序排列。\ncityId 的选项只含实际城市 ID，在分页前排除未设置城市的记录。查询未设置城市的指标使用 cityId 的 notSet 条件。\n\n**English**\n\nQuery distinct values and display labels for dimensions published in meta. Scope and filters are restricted by the current user's data permissions.\nUse ID dimensions (such as siteId and cityId) for entity selection. For dual-key entities, value is the UID; for administrative regions, value is the existing ID. label is localized according to the request language. Entities with identical names are returned separately. Submit the selected value in an equals predicate on the same ID dimension.\nValues of siteName and city support base-text queries and are deduplicated according to the database's text comparison rules. Both value and label use base text. Search uses base fields, while sorting and pagination use internal primary keys or base values. Entity dimensions are not guaranteed to be sorted lexicographically by UID.\nOptions for cityId include only actual city IDs and exclude records with no city before pagination. Query metrics for unset cities using a notSet predicate on cityId.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DimensionValuesRequest"
              },
              "examples": {
                "cities": {
                  "summary": "查询授权场所覆盖的城市列表 / Query cities covered by authorized sites",
                  "value": {
                    "dimension": "cityId",
                    "scope": {
                      "siteIds": [
                        "01a2319e-2165-70ab-b75b-6059601deb62",
                        "01a2319e-2165-70ab-b75b-605a7196c4c1"
                      ]
                    },
                    "filters": [
                      {
                        "member": "siteName",
                        "operator": "contains",
                        "values": [
                          "Site"
                        ]
                      }
                    ],
                    "search": "city",
                    "limit": 100,
                    "offset": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n去重维度取值与展示标签页\n\n**English**\n\nPage of distinct dimension values and display labels",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DimensionValuePageResponse"
                },
                "examples": {
                  "cities": {
                    "summary": "城市维度可选值响应 / City dimension options response",
                    "value": {
                      "code": 0,
                      "data": {
                        "items": [
                          {
                            "value": "11",
                            "label": "Fixture city"
                          },
                          {
                            "value": "12",
                            "label": "Second city"
                          }
                        ],
                        "hasMore": false
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440401"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "default": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/api/metrics/v1/query": {
      "post": {
        "operationId": "queryMetrics",
        "tags": [
          "Queries"
        ],
        "summary": "按统计对象、时间及额外维度查询指标 / Query metrics by subject, time, and additional dimensions",
        "description": "**中文**\n\n查询入口要求当前租户的 dashboard:query 功能权限，平台管理员和当前租户管理员可直接通过功能检查。查询仍受有效租户与授权数据范围约束。\n缺少功能权限、没有授权数据范围或请求范围越权时返回 40301。授权依赖不可用时返回 50301。\n`subject.target` 选择场所整体、空间或槽位，`subject.scope` 限定查询范围。`dimensions` 给出单层结果的分组字段。\n名称筛选和排序使用基础值。按 siteName 或 city 分组时同时按对应 siteId 或 cityId 区分实体，并在结果中返回该标识；名称字段按请求语言显示。\nsiteId、cityId 支持按 ID 分组和筛选，实体选项的 value 可直接用于同一 ID 维度。cityId 在当前授权的数据范围内筛选，未设置城市的分组返回 null。\n实体维度排序（如 siteId asc）沿用内部主键顺序，不保证与返回的 uid 字典序一致。\n`time.range` 选择时间范围。按 `time.granularity` 分组，省略粒度时返回期间合计。\nCube 按完整业务键对齐各事实表行并保留行并集。必要数据缺失或指标的分母为零时返回 `null`。\n响应始终包含 `data.hasMore`。请求 `total: true` 时同时返回过滤与授权后的总行数 `data.total`。\n\n**English**\n\nThe query endpoint requires the dashboard:query permission in the current tenant. Platform administrators and administrators of the current tenant satisfy the function permission check directly. Queries remain subject to the effective tenant and authorized data scope.\nRequests with missing permission, no authorized data scope or an unauthorized requested scope return 40301. Unavailable authorization dependencies return 50301.\nsubject.target selects the whole site, space or slot, while subject.scope limits the query scope. dimensions specifies the grouping fields of the single-level result.\nName filtering and sorting use base values. Grouping by siteName or city also distinguishes entities by the corresponding siteId or cityId and returns that identifier; name fields use the requested language.\nsiteId and cityId support grouping and filtering by ID. An entity option's value can be used directly in the same ID dimension. cityId is filtered within the currently authorized data scope, and groups with an unset city return null.\nEntity dimension sorting (such as siteId asc) follows internal primary key order and is not guaranteed to match the lexicographic order of returned UIDs.\ntime.range selects the time range. Group by time.granularity; omitting granularity returns the period total.\nCube aligns fact-table rows by their complete business keys and retains the union of rows. Missing required data or a zero metric denominator yields null.\nThe response always includes data.hasMore. With total: true, it also includes data.total, the number of rows after filtering and authorization.",
        "parameters": [
          {
            "$ref": "#/components/parameters/AcceptLanguage"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryRequest"
              },
              "examples": {
                "dailySites": {
                  "summary": "两个场所的逐日查询 / Daily query for two sites",
                  "value": {
                    "subject": {
                      "scope": {
                        "siteIds": [
                          "01a2319e-2165-70ab-b75b-6059601deb62",
                          "01a2319e-2165-70ab-b75b-605a7196c4c1"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01 00:00:00",
                        "2026-11-02 23:59:59"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "entrance_traffic",
                      "outside_traffic",
                      "entry_rate",
                      "avg_dwell_minutes"
                    ],
                    "dimensions": [
                      "siteId",
                      "siteName"
                    ],
                    "filters": [
                      {
                        "and": [
                          {
                            "member": "cityId",
                            "operator": "equals",
                            "values": [
                              "11",
                              "12"
                            ]
                          },
                          {
                            "or": [
                              {
                                "member": "siteName",
                                "operator": "contains",
                                "values": [
                                  "Fixture"
                                ]
                              },
                              {
                                "member": "siteName",
                                "operator": "contains",
                                "values": [
                                  "Other"
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "order": [
                      {
                        "member": "siteId",
                        "direction": "asc"
                      },
                      {
                        "member": "time",
                        "direction": "asc"
                      },
                      {
                        "member": "siteName",
                        "direction": "asc"
                      }
                    ],
                    "limit": 4,
                    "offset": 0,
                    "total": true
                  }
                },
                "weeklySites": {
                  "summary": "秒级入参、ISO 周标签与分页 / Second-precision input, ISO week labels, and pagination",
                  "value": {
                    "subject": {
                      "scope": {
                        "siteIds": [
                          "01a2319e-2165-70ab-b75b-6059601deb62",
                          "01a2319e-2165-70ab-b75b-605a7196c4c1"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2025-12-29 00:00:00",
                        "2026-01-11 23:59:59"
                      ],
                      "granularity": "week"
                    },
                    "metrics": [
                      "entrance_traffic"
                    ],
                    "dimensions": [
                      "siteId",
                      "siteName"
                    ],
                    "filters": [
                      {
                        "and": [
                          {
                            "member": "cityId",
                            "operator": "equals",
                            "values": [
                              "11",
                              "12"
                            ]
                          },
                          {
                            "or": [
                              {
                                "member": "siteName",
                                "operator": "contains",
                                "values": [
                                  "Fixture"
                                ]
                              },
                              {
                                "member": "siteName",
                                "operator": "contains",
                                "values": [
                                  "Other"
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ],
                    "order": [
                      {
                        "member": "time",
                        "direction": "asc"
                      },
                      {
                        "member": "siteId",
                        "direction": "asc"
                      },
                      {
                        "member": "siteName",
                        "direction": "asc"
                      }
                    ],
                    "limit": 2,
                    "offset": 0,
                    "total": false
                  }
                },
                "orgUnitTotals": {
                  "summary": "按组织单元 ID 汇总其范围内场所指标 / Aggregate metrics of sites within an org unit by its ID",
                  "value": {
                    "subject": {
                      "scope": {
                        "orgUnitIds": [
                          "01a2319e-215e-74f1-b5e0-b964d945b260"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01",
                        "2026-11-01"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "entrance_traffic"
                    ],
                    "dimensions": [
                      "orgUnitId"
                    ],
                    "order": [
                      {
                        "member": "orgUnitId",
                        "direction": "asc"
                      },
                      {
                        "member": "time",
                        "direction": "asc"
                      }
                    ]
                  }
                },
                "emptyOrgUnit": {
                  "summary": "已授权但没有业务数据的组织单元 / Authorized org unit without business data",
                  "value": {
                    "subject": {
                      "scope": {
                        "orgUnitIds": [
                          "01a2319e-2165-70ab-b75b-605bac92b467"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01",
                        "2026-11-01"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "entrance_traffic"
                    ],
                    "dimensions": [
                      "siteId"
                    ]
                  }
                },
                "unauthorizedSite": {
                  "summary": "请求未授权场所（预期 HTTP 403，code 40301） / Request an unauthorized site (expected HTTP 403, code 40301)",
                  "value": {
                    "subject": {
                      "scope": {
                        "siteIds": [
                          "01a2319e-2166-7055-b769-0974d13dd420"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01",
                        "2026-11-01"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "entrance_traffic"
                    ],
                    "dimensions": [
                      "siteId"
                    ]
                  }
                },
                "siteZones": {
                  "summary": "查询某场所内的全部区域 / Query all zones within a site",
                  "value": {
                    "subject": {
                      "target": "space",
                      "scope": {
                        "siteIds": [
                          "01a2319e-2165-70ab-b75b-6059601deb62"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01",
                        "2026-11-01"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "entrance_traffic"
                    ],
                    "dimensions": [
                      "spaceId",
                      "spaceType"
                    ],
                    "filters": [
                      {
                        "member": "spaceType",
                        "operator": "equals",
                        "values": [
                          "zone"
                        ]
                      }
                    ],
                    "order": [
                      {
                        "member": "spaceId",
                        "direction": "asc"
                      }
                    ]
                  }
                },
                "regionGates": {
                  "summary": "查询大区各场所的全部出入口 / Query all entrances and exits at the sites in a regional org unit",
                  "value": {
                    "subject": {
                      "target": "space",
                      "scope": {
                        "orgUnitIds": [
                          "01a2319e-215e-74f1-b5e0-b964d945b260"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01",
                        "2026-11-01"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "entrance_traffic"
                    ],
                    "dimensions": [
                      "siteId",
                      "spaceId"
                    ],
                    "filters": [
                      {
                        "member": "spaceType",
                        "operator": "equals",
                        "values": [
                          "portal"
                        ]
                      }
                    ],
                    "order": [
                      {
                        "member": "siteId",
                        "direction": "asc"
                      },
                      {
                        "member": "spaceId",
                        "direction": "asc"
                      }
                    ]
                  }
                },
                "floorShelves": {
                  "summary": "查询某楼层下的全部货架 / Query all shelves below a floor",
                  "value": {
                    "subject": {
                      "target": "space",
                      "scope": {
                        "siteIds": [
                          "01a2319e-2165-70ab-b75b-6059601deb62"
                        ]
                      }
                    },
                    "time": {
                      "range": [
                        "2026-11-01",
                        "2026-11-01"
                      ],
                      "granularity": "day"
                    },
                    "metrics": [
                      "avg_dwell_minutes"
                    ],
                    "dimensions": [
                      "spaceId",
                      "spaceType"
                    ],
                    "filters": [
                      {
                        "member": "spaceType",
                        "operator": "equals",
                        "values": [
                          "shelf"
                        ]
                      },
                      {
                        "member": "ancestorSpaceId",
                        "operator": "equals",
                        "values": [
                          "01a2319e-2166-7055-b769-0973674e77f9"
                        ]
                      }
                    ],
                    "order": [
                      {
                        "member": "spaceId",
                        "direction": "asc"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "**中文**\n\n过滤与授权后的指标分页结果\n\n**English**\n\nPaginated metric results after filtering and authorization",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResultResponse"
                },
                "examples": {
                  "dailySites": {
                    "summary": "保留真实零值与缺失空值 / Retain actual zero values and nulls for missing values",
                    "value": {
                      "code": 0,
                      "data": {
                        "rows": [
                          {
                            "siteName": "Fixture Site",
                            "time": "2026-11-01 00:00:00",
                            "time.day": "2026-11-01",
                            "siteId": "01a2319e-2165-70ab-b75b-6059601deb62",
                            "entrance_traffic": "12",
                            "outside_traffic": "48",
                            "entry_rate": 0.25,
                            "avg_dwell_minutes": "5.00"
                          },
                          {
                            "siteName": "Fixture Site",
                            "time": "2026-11-02 00:00:00",
                            "time.day": "2026-11-02",
                            "siteId": "01a2319e-2165-70ab-b75b-6059601deb62",
                            "entrance_traffic": "8",
                            "outside_traffic": "40",
                            "entry_rate": 0.2,
                            "avg_dwell_minutes": "10.00"
                          },
                          {
                            "siteName": "Other Site",
                            "time": "2026-11-01 00:00:00",
                            "time.day": "2026-11-01",
                            "siteId": "01a2319e-2165-70ab-b75b-605a7196c4c1",
                            "entrance_traffic": "0",
                            "outside_traffic": "5",
                            "entry_rate": 0,
                            "avg_dwell_minutes": "0.00"
                          },
                          {
                            "siteName": "Other Site",
                            "time": "2026-11-02 00:00:00",
                            "time.day": "2026-11-02",
                            "siteId": "01a2319e-2165-70ab-b75b-605a7196c4c1",
                            "entrance_traffic": null,
                            "outside_traffic": null,
                            "entry_rate": null,
                            "avg_dwell_minutes": null
                          }
                        ],
                        "hasMore": false,
                        "total": 4
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440402"
                    }
                  },
                  "weeklySites": {
                    "summary": "按 ISO 周分组的第一页响应 / First-page response grouped by ISO week",
                    "value": {
                      "code": 0,
                      "data": {
                        "rows": [
                          {
                            "siteName": "Fixture Site",
                            "time": "2025-12-29 00:00:00",
                            "time.week": "2026W01",
                            "siteId": "01a2319e-2165-70ab-b75b-6059601deb62",
                            "entrance_traffic": null
                          },
                          {
                            "siteName": "Other Site",
                            "time": "2025-12-29 00:00:00",
                            "time.week": "2026W01",
                            "siteId": "01a2319e-2165-70ab-b75b-605a7196c4c1",
                            "entrance_traffic": null
                          }
                        ],
                        "hasMore": true
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440403"
                    }
                  },
                  "emptyOrgUnit": {
                    "summary": "已授权的组织没有业务数据时返回空列表 / Return an empty list when an authorized org unit has no business data",
                    "value": {
                      "code": 0,
                      "data": {
                        "rows": [],
                        "hasMore": false
                      },
                      "message": "ok",
                      "requestId": "550e8400-e29b-41d4-a716-446655440404"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "**中文**\n\n请求无效（40001）或业务组合不受支持（40002，含 reason 子码）\n\n**English**\n\nInvalid request (40001) or unsupported business combination (40002, with a reason subcode)",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "unsupportedCombination": {
                    "summary": "不支持的粒度组合错误 / Unsupported granularity combination error",
                    "value": {
                      "code": 40002,
                      "data": null,
                      "message": "Selected metrics do not jointly support 10min granularity.",
                      "requestId": "550e8400-e29b-41d4-a716-446655440406",
                      "reason": "UNSUPPORTED_GRANULARITY"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "**中文**\n\n缺少查询功能权限、无数据范围，或显式目标未经授权（40301），不会发起 Cube 查询\n\n**English**\n\nMissing query permission, no data scope, or an unauthorized explicit target (40301). No Cube query is issued.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missingPermission": {
                    "summary": "缺少查询功能权限 / Missing query permission",
                    "value": {
                      "code": 40301,
                      "data": null,
                      "message": "Access denied for the requested scope or resource.",
                      "requestId": "550e8400-e29b-41d4-a716-446655440405"
                    }
                  },
                  "unauthorizedSite": {
                    "summary": "请求未授权场所错误响应 / Error response for a request to an unauthorized site",
                    "value": {
                      "code": 40301,
                      "data": null,
                      "message": "Access denied for the requested scope or resource.",
                      "requestId": "550e8400-e29b-41d4-a716-446655440405",
                      "reason": "SCOPE_NOT_AUTHORIZED"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/Unavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          },
          "default": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "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": {
      "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."
      },
      "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."
      },
      "Ids": {
        "type": "array",
        "uniqueItems": true,
        "items": {
          "$ref": "#/components/schemas/UidString"
        },
        "description": "**中文**\n\n去重的字符串标识列表。\n\n**English**\n\nUnique list of string identifiers."
      },
      "EmptyIds": {
        "type": "array",
        "maxItems": 0,
        "items": {
          "$ref": "#/components/schemas/UidString"
        },
        "description": "**中文**\n\n不包含任何标识的数组，用于约束不适用的范围层级。\n\n**English**\n\nArray containing no identifiers, constraining inapplicable scope levels."
      },
      "Scope": {
        "type": "object",
        "additionalProperties": false,
        "description": "**中文**\n\n最多传入一种非空 ID 数组，数组内 ID 取并集。省略、空对象或全空数组表示当前用户全部授权范围。\n`orgUnitIds` 经组织闭包表匹配节点及其下辖场所。`siteIds` 直接匹配场所。\n`spaceIds` 与 `slotIds` 精确匹配 ID。可用 `ancestorSpaceId` 筛选空间子树。\n任一显式请求的 ID 未经授权时，返回 40301。传入多种非空 ID 数组时，返回 40002 和 TARGET_SCOPE_CONFLICT。\n\n**English**\n\nSupply at most one non-empty ID array. IDs within an array are combined as a union. Omission, an empty object, or all-empty arrays represent the full authorized scope of the current user.\norgUnitIds matches nodes and their subordinate sites through the org unit closure table. siteIds matches sites directly.\nspaceIds and slotIds match IDs exactly. ancestorSpaceId can filter a space subtree.\nIf any explicitly requested ID is unauthorized, return 40301. Multiple non-empty ID arrays return 40002 and TARGET_SCOPE_CONFLICT.",
        "properties": {
          "orgUnitIds": {
            "$ref": "#/components/schemas/Ids"
          },
          "siteIds": {
            "$ref": "#/components/schemas/Ids"
          },
          "spaceIds": {
            "$ref": "#/components/schemas/Ids"
          },
          "slotIds": {
            "$ref": "#/components/schemas/Ids"
          }
        },
        "anyOf": [
          {
            "properties": {
              "siteIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "spaceIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "slotIds": {
                "$ref": "#/components/schemas/EmptyIds"
              }
            }
          },
          {
            "properties": {
              "orgUnitIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "spaceIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "slotIds": {
                "$ref": "#/components/schemas/EmptyIds"
              }
            }
          },
          {
            "properties": {
              "orgUnitIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "siteIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "slotIds": {
                "$ref": "#/components/schemas/EmptyIds"
              }
            }
          },
          {
            "properties": {
              "orgUnitIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "siteIds": {
                "$ref": "#/components/schemas/EmptyIds"
              },
              "spaceIds": {
                "$ref": "#/components/schemas/EmptyIds"
              }
            }
          }
        ]
      },
      "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."
          }
        }
      },
      "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"
        }
      },
      "DimensionValuesRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "dimension"
        ],
        "properties": {
          "dimension": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n实体选择使用 ID 维度，例如 siteId 或 cityId。siteName、city 可用于发现基础文本取值。\n\n**English**\n\nUse ID dimensions, such as siteId or cityId, for entity selection. siteName and city can be used to discover base-text values."
          },
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "filters": {
            "$ref": "#/components/schemas/Filters"
          },
          "search": {
            "type": "string",
            "description": "**中文**\n\n包含搜索词。有名称映射的实体 ID 维度按对应基础名称搜索；没有名称映射时，仅支持 contains 运算符的维度可按自身基础值搜索，否则非空 search 返回 40002（不支持的筛选运算符）。\n\n**English**\n\nContains-search term. Entity ID dimensions with a name mapping search the corresponding base name. Without a name mapping, search is supported on the dimension's base value only when it supports the contains operator; otherwise a nonempty search returns 40002 (unsupported filter operator)."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "default": 100,
            "description": "**中文**\n\n本页最多返回的记录条数。\n\n**English**\n\nMaximum number of records returned in this page."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "default": 0,
            "description": "**中文**\n\n本页之前跳过的记录条数。\n\n**English**\n\nNumber of records skipped before this page."
          }
        }
      },
      "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."
      },
      "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."
      },
      "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"
            }
          }
        ]
      },
      "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."
      },
      "Subject": {
        "type": "object",
        "additionalProperties": false,
        "description": "**中文**\n\n`site` 是默认对象，读取 `space_id = 0` 的场所整体行，支持 `orgUnitIds` 或 `siteIds`。\n`space` 支持 `orgUnitIds`、`siteIds` 或 `spaceIds`。\n`slot` 支持 `orgUnitIds`、`siteIds`、`spaceIds` 或 `slotIds`。\n命中多个空间缺少 `spaceId` 分组时返回 40002 和 UNSUPPORTED_ROLLUP_SPACE。命中多个槽位须按 `slotId` 分组。\n跨层范围组合返回 40002 和 TARGET_SCOPE_CONFLICT。\n\n**English**\n\nsite is the default subject, reading whole-site rows with space_id = 0 and supporting orgUnitIds or siteIds.\nspace supports orgUnitIds, siteIds, or spaceIds.\nslot supports orgUnitIds, siteIds, spaceIds, or slotIds.\nIf multiple spaces match without grouping by spaceId, return 40002 and UNSUPPORTED_ROLLUP_SPACE. If multiple slots match, grouping by slotId is required.\nCross-level scope combinations return 40002 and TARGET_SCOPE_CONFLICT.",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/Scope"
          },
          "target": {
            "allOf": [
              {
                "$ref": "#/components/schemas/SubjectTarget"
              }
            ],
            "default": "site",
            "description": "**中文**\n\n本次查询的统计对象，site 为场所整体，space 为空间，slot 为槽位。\n\n**English**\n\nStatistical subject for the query: site for whole sites, space for spaces, and slot for slots."
          }
        },
        "anyOf": [
          {
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "site"
                ],
                "description": "**中文**\n\n场所整体统计对象。\n\n**English**\n\nWhole-site statistical subject."
              },
              "scope": {
                "type": "object",
                "properties": {
                  "spaceIds": {
                    "$ref": "#/components/schemas/EmptyIds"
                  },
                  "slotIds": {
                    "$ref": "#/components/schemas/EmptyIds"
                  }
                },
                "description": "**中文**\n\n场所整体查询范围，不允许非空的 spaceIds 或 slotIds。\n\n**English**\n\nScope for whole-site queries. Non-empty spaceIds or slotIds are not allowed."
              }
            }
          },
          {
            "required": [
              "target"
            ],
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "space"
                ],
                "description": "**中文**\n\n空间统计对象。\n\n**English**\n\nSpace statistical subject."
              },
              "scope": {
                "type": "object",
                "properties": {
                  "slotIds": {
                    "$ref": "#/components/schemas/EmptyIds"
                  }
                },
                "description": "**中文**\n\n空间查询范围，不允许非空的 slotIds。\n\n**English**\n\nScope for space queries. Non-empty slotIds are not allowed."
              }
            }
          },
          {
            "required": [
              "target"
            ],
            "properties": {
              "target": {
                "type": "string",
                "enum": [
                  "slot"
                ],
                "description": "**中文**\n\n槽位统计对象。\n\n**English**\n\nSlot statistical subject."
              }
            }
          }
        ]
      },
      "Granularity": {
        "type": "string",
        "enum": [
          "10min",
          "hour",
          "day",
          "week",
          "month"
        ],
        "description": "**中文**\n\n统计时间分组粒度：10min 十分钟、hour 小时、day 日、week 周、month 月。\n\n**English**\n\nReporting time grouping granularity: ten-minute (10min), hourly (hour), daily (day), weekly (week), or monthly (month)."
      },
      "Time": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "range"
        ],
        "properties": {
          "range": {
            "$ref": "#/components/schemas/DateRange"
          },
          "granularity": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Granularity"
              }
            ],
            "description": "**中文**\n\n省略时合计整个时间范围。所选指标须全部支持该粒度。\n\n**English**\n\nWhen omitted, aggregate across the entire time range. All selected metrics must support this granularity."
          }
        }
      },
      "QueryRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "metrics",
          "time"
        ],
        "properties": {
          "subject": {
            "$ref": "#/components/schemas/Subject"
          },
          "time": {
            "$ref": "#/components/schemas/Time"
          },
          "metrics": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            },
            "description": "**中文**\n\n本次查询的指标编码列表，须为已发布的指标，至少一个且不得重复。\n\n**English**\n\nMetric codes for the query. Supply at least one published metric code with no duplicates."
          },
          "dimensions": {
            "$ref": "#/components/schemas/Names"
          },
          "filters": {
            "$ref": "#/components/schemas/Filters"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "default": 20,
            "description": "**中文**\n\n本页最多返回的记录条数。\n\n**English**\n\nMaximum number of records returned in this page."
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000,
            "default": 0,
            "description": "**中文**\n\n本页之前跳过的记录条数。\n\n**English**\n\nNumber of records skipped before this page."
          },
          "total": {
            "type": "boolean",
            "default": false,
            "description": "**中文**\n\n是否随结果返回过滤与授权后的总行数。\n\n**English**\n\nWhether to return the total row count after filtering and authorization with the result."
          },
          "order": {
            "$ref": "#/components/schemas/QueryOrder"
          }
        }
      },
      "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."
            }
          }
        }
      },
      "Scalar": {
        "description": "**中文**\n\n可空标量，支持字符串、数值、布尔与 `null`。高精度数值或超出安全整数范围的标识序列化为字符串。\n\n**English**\n\nNullable scalar supporting strings, numbers, booleans, and null. High-precision numeric values or identifiers outside the safe integer range are serialized as strings.",
        "anyOf": [
          {
            "type": "string",
            "nullable": true
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "DimensionValuePage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "hasMore"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "**中文**\n\n双键实体维度的 value 遵循 UidString，行政区划维度沿用 ID，label 为本地化标签；名称文本维度的 value 与 label 均为基础值。\n\n**English**\n\nFor dual-key entity dimensions, value conforms to UidString. Administrative region dimensions retain their IDs and label is localized. For name-text dimensions, both value and label are base values.",
              "additionalProperties": false,
              "required": [
                "value",
                "label"
              ],
              "properties": {
                "value": {
                  "$ref": "#/components/schemas/Scalar"
                },
                "label": {
                  "type": "string",
                  "nullable": true,
                  "description": "**中文**\n\n维度取值的展示标签。有名称映射的实体 ID 维度按请求语言解析名称；没有名称映射时，label 等于 value，包括基础文本维度和 parentSpaceId。\n\n**English**\n\nDisplay label for the dimension value. Entity ID dimensions with a name mapping use names resolved for the requested language. Without a name mapping, label equals value, including base-text dimensions and parentSpaceId."
                }
              }
            },
            "description": "**中文**\n\n当前页的去重维度值及展示标签。\n\n**English**\n\nDistinct dimension values and display labels in the current page."
          },
          "hasMore": {
            "type": "boolean",
            "description": "**中文**\n\n本页之后是否还有更多记录。\n\n**English**\n\nWhether additional records exist after this page."
          }
        }
      },
      "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."
      },
      "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"
            }
          }
        }
      },
      "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."
          }
        }
      },
      "TimeCapability": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "granularities",
          "supportsTotal"
        ],
        "properties": {
          "granularities": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/Granularity"
            },
            "description": "**中文**\n\n指标支持的时间分组粒度列表。\n\n**English**\n\nTime grouping granularities supported by the metric."
          },
          "orgUnitGranularities": {
            "description": "**中文**\n\n以 orgUnitId 分组时允许的粒度。仅以 orgUnitId 筛选时仍使用 granularities。\n\n**English**\n\nGranularities permitted when grouping by orgUnitId. Filtering by orgUnitId alone still uses granularities.",
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ]
            }
          },
          "supportsTotal": {
            "type": "boolean",
            "description": "**中文**\n\n指标是否支持省略时间粒度后查询整个期间的合计。\n\n**English**\n\nWhether the metric supports aggregation over the entire period when time granularity is omitted."
          }
        }
      },
      "Rollup": {
        "type": "string",
        "enum": [
          "ADDITIVE",
          "RATIO_OF_SUMS",
          "NONE"
        ],
        "description": "**中文**\n\n汇总能力：ADDITIVE 直接相加，RATIO_OF_SUMS 分子和分母分别汇总后相除，NONE 禁止折叠。\n\n**English**\n\nRollup capability: ADDITIVE for direct summation, RATIO_OF_SUMS for division after separately summing numerator and denominator, and NONE for prohibiting aggregation."
      },
      "Metric": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "name",
          "type",
          "dimensions",
          "requiredDimensions",
          "subject",
          "time",
          "orgRollup",
          "spatialRollup",
          "timeRollup",
          "formulaVersion"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "**中文**\n\n指标编码，与 `meta_metric.metric_code` 一致（唯一来源 `semantic/capabilities/`）。\n\n**English**\n\nMetric code, matching meta_metric.metric_code (the single source is semantic/capabilities/)."
          },
          "name": {
            "type": "string",
            "description": "**中文**\n\n按请求语言解析后的指标名称。\n\n**English**\n\nMetric name resolved according to the requested language."
          },
          "type": {
            "type": "string",
            "description": "**中文**\n\n指标的类型标识。\n\n**English**\n\nMetric type identifier."
          },
          "unit": {
            "type": "string",
            "description": "**中文**\n\n计量单位。单位为 `ratio` 时，有效值按 JSON 数值返回，例如进入率 0.25。分母为零或缺失时返回 null。\n\n**English**\n\nUnit of measure. For the ratio unit, valid values are returned as JSON numbers, such as an entry rate of 0.25. Return null when the denominator is zero or missing."
          },
          "description": {
            "type": "string",
            "description": "**中文**\n\n指标的业务口径说明。\n\n**English**\n\nBusiness definition of the metric."
          },
          "dimensions": {
            "$ref": "#/components/schemas/Names"
          },
          "requiredDimensions": {
            "$ref": "#/components/schemas/Names"
          },
          "subject": {
            "$ref": "#/components/schemas/SubjectCapability"
          },
          "time": {
            "$ref": "#/components/schemas/TimeCapability"
          },
          "orgRollup": {
            "$ref": "#/components/schemas/Rollup"
          },
          "spatialRollup": {
            "type": "string",
            "enum": [
              "NONE",
              "LEAF_ADDITIVE"
            ],
            "default": "NONE",
            "description": "**中文**\n\n跨空间或槽位的汇总能力。NONE 禁止跨空间或跨槽位折叠，LEAF_ADDITIVE 为无重叠叶子空间的相加汇总保留。\n\n**English**\n\nAggregation capability across spaces or slots. NONE prohibits aggregation across spaces or across slots, and LEAF_ADDITIVE is reserved for summing non-overlapping leaf spaces."
          },
          "timeRollup": {
            "$ref": "#/components/schemas/Rollup"
          },
          "formulaVersion": {
            "type": "string",
            "minLength": 1,
            "description": "**中文**\n\n指标公式版本，公式调整时递增。\n\n**English**\n\nMetric formula version, incremented when the formula is changed.",
            "example": "v1"
          }
        }
      },
      "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"
          }
        }
      },
      "Metadata": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "timezone",
          "metrics",
          "dimensions"
        ],
        "properties": {
          "timezone": {
            "type": "string",
            "description": "**中文**\n\n解释查询起止时间的默认时区。\n\n**English**\n\nDefault time zone used to interpret query start and end times."
          },
          "metrics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Metric"
            },
            "description": "**中文**\n\n当前部署和租户范围内发布的指标能力目录。\n\n**English**\n\nCatalog of metric capabilities published for the current deployment and tenant."
          },
          "dimensions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Dimension"
            },
            "description": "**中文**\n\n当前发布的维度定义列表。\n\n**English**\n\nList of currently published dimension definitions."
          }
        }
      },
      "QueryResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "rows",
          "hasMore"
        ],
        "properties": {
          "hasMore": {
            "type": "boolean",
            "description": "**中文**\n\n本页之后是否还有更多记录。\n\n**English**\n\nWhether additional records exist after this page."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "**中文**\n\n过滤与授权后的总行数，在请求总数统计时返回。\n\n**English**\n\nTotal row count after filtering and authorization, returned when a total count is requested."
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "siteId": {
                  "$ref": "#/components/schemas/UidString",
                  "description": "**中文**\n\n场所维度的标识，可用于分组和筛选。\n\n**English**\n\nSite dimension identifier, usable for grouping and filtering."
                },
                "cityId": {
                  "type": "string",
                  "nullable": true,
                  "description": "**中文**\n\n城市标识，可独立用于分组和筛选，按 city 分组时也会返回。未设置城市时为 null。\n\n**English**\n\nCity identifier. It can be used independently for grouping and filtering, and is also returned when grouping by city. null if no city is configured."
                },
                "orgUnitId": {
                  "$ref": "#/components/schemas/NullableUidString",
                  "description": "**中文**\n\n组织单元维度的标识。\n\n**English**\n\nOrg unit dimension identifier."
                },
                "spaceId": {
                  "$ref": "#/components/schemas/NullableUidString",
                  "description": "**中文**\n\n空间维度的标识。\n\n**English**\n\nSpace dimension identifier."
                },
                "spaceType": {
                  "type": "string",
                  "nullable": true,
                  "description": "**中文**\n\n空间类型维度的编码。\n\n**English**\n\nSpace type dimension code."
                },
                "parentSpaceId": {
                  "$ref": "#/components/schemas/NullableUidString",
                  "description": "**中文**\n\n直接父空间的标识。\n\n**English**\n\nDirect parent space identifier."
                },
                "ancestorSpaceId": {
                  "$ref": "#/components/schemas/NullableUidString",
                  "description": "**中文**\n\n祖先空间的标识，用于空间子树筛选。\n\n**English**\n\nAncestor space identifier used to filter space subtrees."
                },
                "slotId": {
                  "$ref": "#/components/schemas/NullableUidString",
                  "description": "**中文**\n\n空间槽位维度的标识。\n\n**English**\n\nSpace slot dimension identifier."
                },
                "slotType": {
                  "$ref": "#/components/schemas/SlotType"
                },
                "productId": {
                  "$ref": "#/components/schemas/NullableUidString",
                  "description": "**中文**\n\n商品维度的标识。\n\n**English**\n\nProduct dimension identifier."
                },
                "time": {
                  "$ref": "#/components/schemas/LocalDateTime"
                },
                "time.10min": {
                  "$ref": "#/components/schemas/LocalDateTime"
                },
                "time.hour": {
                  "$ref": "#/components/schemas/LocalDateTime"
                },
                "time.day": {
                  "$ref": "#/components/schemas/LocalDate"
                },
                "time.week": {
                  "type": "string",
                  "pattern": "^\\d{4}W(0[1-9]|[1-4]\\d|5[0-3])$",
                  "description": "**中文**\n\n租户周序。以周桶第 4 天所在的年份和当年的周序标记。周一为周首时使用 ISO 周序。\n\n**English**\n\nTenant week number. The label uses the year containing the fourth day of the week bucket and the week number within that year. ISO week numbering applies when Monday is the first day of the week."
                },
                "time.month": {
                  "type": "string",
                  "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
                  "description": "**中文**\n\n月分组标签，格式为 YYYY-MM。\n\n**English**\n\nMonth grouping label in YYYY-MM format."
                }
              },
              "additionalProperties": {
                "$ref": "#/components/schemas/Scalar"
              }
            },
            "description": "**中文**\n\n当前页的结果行，包含所请求分组字段及指标编码对应的取值。缺失必要数据时指标值可为 null。\n\n**English**\n\nResult rows in the current page, containing requested grouping fields and values keyed by metric code. Metric values may be null when required data is missing."
          }
        }
      },
      "MetadataResponse": {
        "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/Metadata"
          },
          "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."
          }
        }
      },
      "DimensionValuePageResponse": {
        "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/DimensionValuePage"
          },
          "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."
          }
        }
      },
      "QueryResultResponse": {
        "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/QueryResult"
          },
          "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."
      },
      "NullableUidString": {
        "type": "string",
        "nullable": true,
        "description": "**中文**\n\n可以为 null 的 UidString，用于可空的双键实体关联。\n\n**English**\n\nA UidString that may be null, used for nullable relationships between dual-key entities.",
        "anyOf": [
          {
            "$ref": "#/components/schemas/UidString"
          },
          {
            "type": "string",
            "nullable": true,
            "enum": [
              null
            ]
          }
        ]
      }
    },
    "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": {
      "BadRequest": {
        "description": "**中文**\n\n请求参数或业务组合无效（code 40001 / 40002）。\n\n**English**\n\nInvalid request parameters or business combination (code 40001 / 40002).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40001,
              "data": null,
              "message": "Invalid request parameter.",
              "requestId": "550e8400-e29b-41d4-a716-446655440000"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "**中文**\n\n凭证缺失、无效或已过期（code 40101）。\n\n**English**\n\nCredentials missing, invalid, or expired (code 40101).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40101,
              "data": null,
              "message": "Authentication required or token expired.",
              "requestId": "550e8400-e29b-41d4-a716-446655440001"
            }
          }
        }
      },
      "Forbidden": {
        "description": "**中文**\n\n无权访问目标资源（code 40301）。\n\n**English**\n\nUnauthorized access to the target resource (code 40301).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 40301,
              "data": null,
              "message": "Access denied for the requested scope or resource.",
              "requestId": "550e8400-e29b-41d4-a716-446655440002"
            }
          }
        }
      },
      "RateLimited": {
        "description": "**中文**\n\n请求频率或并发超限（code 42901）。\n\n**English**\n\nRequest rate or concurrency limit exceeded (code 42901).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 42901,
              "data": null,
              "message": "Rate limit exceeded.",
              "requestId": "550e8400-e29b-41d4-a716-446655440006"
            }
          }
        }
      },
      "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"
            }
          }
        }
      },
      "InternalError": {
        "description": "**中文**\n\n平台内部未预期错误（code 50001）。\n\n**English**\n\nUnexpected internal platform error (code 50001).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 50001,
              "data": null,
              "message": "Internal server error.",
              "requestId": "550e8400-e29b-41d4-a716-446655440007"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "**中文**\n\n业务规则或协议校验失败（code 42201）。\n\n**English**\n\nBusiness rule or protocol validation failed (code 42201).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 42201,
              "data": null,
              "message": "Business validation failed.",
              "requestId": "550e8400-e29b-41d4-a716-446655440005"
            }
          }
        }
      },
      "BadGateway": {
        "description": "**中文**\n\n上游依赖异常（code 50201）。\n\n**English**\n\nUpstream dependency returned an error (code 50201).",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/X-Request-Id"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "code": 50201,
              "data": null,
              "message": "Upstream service returned an invalid response.",
              "requestId": "550e8400-e29b-41d4-a716-446655440008"
            }
          }
        }
      },
      "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"
            }
          }
        }
      }
    }
  }
}
