{
  "tags": [
    "四层转发"
  ],
  "description": "分页查询四层转发组。普通用户只能看到自己的转发组；管理员可使用 `uid` 仅查看指定用户的转发组。结果按组 ID 倒序返回。",
  "operationId": "user_get_v1_stream_groups",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "请求已被处理。成功时返回列表与总数；页码或每页数量不是数字时仍返回 HTTP 200，并在 `code` 和 `msg` 中给出业务错误。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "code",
              "count",
              "data"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "description": "业务状态码；成功为 0。",
                "example": 0
              },
              "count": {
                "type": "integer",
                "minimum": 0,
                "description": "符合筛选条件的转发组总数，不受分页限制影响。",
                "example": 2
              },
              "data": {
                "type": "array",
                "description": "四层转发组列表，按 ID 倒序。",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "uid",
                    "name",
                    "des"
                  ],
                  "properties": {
                    "id": {
                      "type": "integer",
                      "description": "转发组 ID。"
                    },
                    "uid": {
                      "type": "integer",
                      "description": "归属用户 ID。"
                    },
                    "name": {
                      "type": "string",
                      "description": "转发组名称。"
                    },
                    "des": {
                      "type": "string",
                      "description": "转发组备注。"
                    },
                    "username": {
                      "type": "string",
                      "nullable": true,
                      "description": "归属用户名，由用户表关联得到。"
                    }
                  }
                }
              }
            }
          },
          "examples": {
            "success": {
              "summary": "查询成功",
              "value": {
                "code": 0,
                "count": 1,
                "data": [
                  {
                    "id": 3,
                    "uid": 12,
                    "name": "生产转发",
                    "des": "TCP 服务",
                    "username": "demo"
                  }
                ]
              }
            },
            "invalidPage": {
              "summary": "页码格式错误",
              "value": {
                "code": "stream_group-4",
                "msg": "page参数格式不正确",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "count": 1,
            "data": [
              {
                "id": 3,
                "uid": 12,
                "name": "生产转发",
                "des": "TCP 服务",
                "username": "demo"
              }
            ]
          }
        }
      }
    }
  },
  "x-python-handler": "stream.StreamGroupAPI",
  "x-python-route-line": 649,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "page",
      "in": "query",
      "schema": {
        "type": "integer",
        "minimum": 1,
        "default": 1,
        "example": 1
      },
      "description": "页码，必须为数字；未传时为 1。"
    },
    {
      "name": "limit",
      "in": "query",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "default": 10,
        "example": 10
      },
      "description": "每页返回数量，必须为数字；未传时为 10，传 0 表示不分页并返回全部。"
    },
    {
      "name": "uid",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "minimum": 1,
        "example": 12
      },
      "description": "管理员可选。仅返回该用户的转发组；普通用户传入此参数不会改变其只能查看自己的范围。"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "stream.StreamGroupAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 649
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/stream-groups",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "查询四层转发组列表",
    "description": {
      "content": "分页查询四层转发组。普通用户只能看到自己的转发组；管理员可使用 `uid` 仅查看指定用户的转发组。结果按组 ID 倒序返回。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "stream-groups"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [
        {
          "disabled": false,
          "description": {
            "content": "页码，必须为数字；未传时为 1。",
            "type": "text/plain"
          },
          "key": "page",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "每页返回数量，必须为数字；未传时为 10，传 0 表示不分页并返回全部。",
            "type": "text/plain"
          },
          "key": "limit",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "管理员可选。仅返回该用户的转发组；普通用户传入此参数不会改变其只能查看自己的范围。",
            "type": "text/plain"
          },
          "key": "uid",
          "value": ""
        }
      ],
      "variable": []
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}