{
  "tags": [
    "DNS 管理"
  ],
  "description": "分页查询 DNS 服务商凭据记录，按 ID 倒序返回。普通用户只能读取自己的记录并忽略 uid 筛选；管理员可用 uid 查询指定用户的记录。响应会直接返回数据库保存的 auth 文本，应避免在不可信环境展示或记录。",
  "operationId": "user_get_v1_dnsapis",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "业务结果使用 HTTP 200 返回。成功响应含 code、count、data，不含 msg 字段；分页参数或认证失败时返回业务错误封装。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "count",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "成功状态码，固定为 0。"
                  },
                  "count": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 0,
                    "description": "当前权限与 uid 条件下的 DNS API 记录总数。"
                  },
                  "data": {
                    "type": "array",
                    "description": "当前页 DNS API 记录，按 id 倒序排列。",
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "uid",
                        "name",
                        "des",
                        "type",
                        "username",
                        "auth"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer",
                          "format": "int64",
                          "description": "DNS API 记录 ID。"
                        },
                        "uid": {
                          "type": "integer",
                          "format": "int64",
                          "nullable": true,
                          "description": "凭据所属用户 ID。"
                        },
                        "name": {
                          "type": "string",
                          "nullable": true,
                          "description": "用户定义的 DNS API 名称。"
                        },
                        "des": {
                          "type": "string",
                          "nullable": true,
                          "description": "凭据备注。"
                        },
                        "type": {
                          "type": "string",
                          "nullable": true,
                          "description": "DNS 服务商类型，例如 CloudFlare、Aliyun 或 DNSPod.cn。"
                        },
                        "username": {
                          "type": "string",
                          "nullable": true,
                          "description": "所属用户登录名；关联用户不存在时为 null。"
                        },
                        "auth": {
                          "type": "string",
                          "nullable": true,
                          "description": "数据库保存的 DNS 服务商鉴权 JSON 文本，包含 API Token、密钥或账号等敏感信息。服务端实际会返回此字段；文档示例已脱敏。"
                        }
                      },
                      "additionalProperties": false,
                      "description": "DNS 服务商凭据记录。"
                    }
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "dnsapi-5",
                      "dnsapi-6",
                      "login_required"
                    ],
                    "description": "分页参数错误或认证失效的业务错误码。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "分页参数或认证失败原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "code": 0,
            "count": 1,
            "data": [
              {
                "id": 3001,
                "uid": 10001,
                "name": "生产 DNS",
                "des": "证书自动签发",
                "type": "CloudFlare",
                "username": "demo-user",
                "auth": "{\"CF_Email\":\"admin@example.invalid\",\"CF_Key\":\"REDACTED\"}"
              }
            ]
          }
        }
      }
    }
  },
  "x-python-handler": "site.DNSAPI",
  "x-python-route-line": 350,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "page",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int32"
      },
      "description": "页码，默认 1。服务端仅校验其为数字；分页偏移按 (page - 1) × limit 计算。",
      "example": 1
    },
    {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int32",
        "minimum": 0
      },
      "description": "每页记录数，默认 10；传 0 时取消 SQL limit 并返回全部记录。",
      "example": 10
    },
    {
      "name": "uid",
      "in": "query",
      "required": false,
      "schema": {
        "type": "integer",
        "format": "int64",
        "minimum": 1
      },
      "description": "仅管理员可用：筛选指定所属用户 ID。普通用户提供该参数不会改变查询范围。",
      "example": 10001
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "site.DNSAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 350
    },
    {
      "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/dnsapis",
  "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": "查询 DNS API 列表",
    "description": {
      "content": "分页查询 DNS 服务商凭据记录，按 ID 倒序返回。普通用户只能读取自己的记录并忽略 uid 筛选；管理员可用 uid 查询指定用户的记录。响应会直接返回数据库保存的 auth 文本，应避免在不可信环境展示或记录。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "dnsapis"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [
        {
          "disabled": false,
          "description": {
            "content": "页码，默认 1。服务端仅校验其为数字；分页偏移按 (page - 1) × limit 计算。",
            "type": "text/plain"
          },
          "key": "page",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "每页记录数，默认 10；传 0 时取消 SQL limit 并返回全部记录。",
            "type": "text/plain"
          },
          "key": "limit",
          "value": ""
        },
        {
          "disabled": false,
          "description": {
            "content": "仅管理员可用：筛选指定所属用户 ID。普通用户提供该参数不会改变查询范围。",
            "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"
        }
      ]
    }
  }
}