{
  "tags": [
    "配置模板"
  ],
  "description": "按作用域、类型和名称组成的复合标识读取一条主控配置。登录用户只可读取 site 类型的 clean_url、clean_dir、ip-unlock-max-limit、ip-unlock-max-per-limit、pre_cache_url，以及 system 类型的 recharge；其余标识要求管理员身份。普通用户读取 recharge 时不会取得支付密钥，仅取得默认支付方式和转账说明。",
  "operationId": "user_get_v1_configs_config_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "业务结果使用 HTTP 200 返回。记录不存在时 data 为 null；普通用户读取充值配置时返回脱敏后的支付配置，权限不足或认证失效时返回业务错误码。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "成功状态码，固定为 0。"
                  },
                  "msg": {
                    "type": "string",
                    "nullable": true,
                    "description": "详情读取成功时固定为 null。"
                  },
                  "data": {
                    "description": "按配置名称与当前账户权限返回的配置记录或脱敏支付配置。",
                    "oneOf": [
                      {
                        "type": "object",
                        "required": [
                          "name",
                          "value",
                          "type",
                          "scope_id",
                          "scope_name",
                          "create_at",
                          "update_at",
                          "enable",
                          "task_id",
                          "state",
                          "ret",
                          "task_type"
                        ],
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "配置名称。"
                          },
                          "value": {
                            "type": "string",
                            "description": "数据库保存的原始配置值；JSON 配置仍以 JSON 文本字符串返回。"
                          },
                          "type": {
                            "type": "string",
                            "description": "配置类型。"
                          },
                          "scope_id": {
                            "type": "integer",
                            "format": "int64",
                            "description": "配置作用域实体 ID。"
                          },
                          "scope_name": {
                            "type": "string",
                            "description": "配置作用域名称。"
                          },
                          "create_at": {
                            "type": "string",
                            "nullable": true,
                            "description": "配置创建时间。"
                          },
                          "update_at": {
                            "type": "string",
                            "nullable": true,
                            "description": "配置最后更新时间。"
                          },
                          "enable": {
                            "type": "integer",
                            "enum": [
                              0,
                              1
                            ],
                            "description": "配置启用状态：1 启用，0 禁用。"
                          },
                          "task_id": {
                            "type": "integer",
                            "format": "int64",
                            "nullable": true,
                            "description": "最近一次配置同步任务 ID；没有同步任务时为 null。"
                          },
                          "state": {
                            "type": "string",
                            "nullable": true,
                            "description": "关联同步任务的当前状态；无任务时为 null。"
                          },
                          "ret": {
                            "type": "string",
                            "nullable": true,
                            "description": "关联同步任务的返回内容；无任务时为 null。"
                          },
                          "task_type": {
                            "type": "string",
                            "nullable": true,
                            "description": "关联同步任务类型；无任务时为 null。"
                          }
                        },
                        "additionalProperties": false,
                        "description": "管理员读取时返回的完整配置记录及关联任务信息。"
                      },
                      {
                        "type": "object",
                        "required": [
                          "default-pay",
                          "transfer",
                          "wxpay",
                          "alipay"
                        ],
                        "properties": {
                          "default-pay": {
                            "type": "string",
                            "description": "默认支付渠道标识。"
                          },
                          "transfer": {
                            "type": "object",
                            "required": [
                              "state",
                              "data"
                            ],
                            "properties": {
                              "state": {
                                "type": "boolean",
                                "description": "转账支付启用状态。"
                              },
                              "data": {
                                "type": "string",
                                "description": "转账支付说明或数据。"
                              }
                            },
                            "additionalProperties": false,
                            "description": "转账支付的公开配置。"
                          },
                          "wxpay": {
                            "type": "object",
                            "required": [
                              "state",
                              "subtype"
                            ],
                            "properties": {
                              "state": {
                                "type": "boolean",
                                "description": "微信支付启用状态。"
                              },
                              "subtype": {
                                "type": "string",
                                "description": "微信支付子类型；未配置时为空字符串。"
                              }
                            },
                            "additionalProperties": false,
                            "description": "脱敏后的微信支付配置。"
                          },
                          "alipay": {
                            "type": "object",
                            "required": [
                              "state",
                              "subtype"
                            ],
                            "properties": {
                              "state": {
                                "type": "boolean",
                                "description": "支付宝启用状态。"
                              },
                              "subtype": {
                                "type": "string",
                                "description": "支付宝支付子类型；未配置时为空字符串。"
                              }
                            },
                            "additionalProperties": false,
                            "description": "脱敏后的支付宝配置。"
                          }
                        },
                        "additionalProperties": false,
                        "description": "普通用户读取 system-recharge 时返回的脱敏支付配置。"
                      },
                      {
                        "type": "object",
                        "nullable": true,
                        "additionalProperties": false,
                        "description": "未找到对应配置记录时返回 null。"
                      }
                    ]
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "config-273",
                      "login_required"
                    ],
                    "description": "config-273 表示需要管理员权限；login_required 表示认证无效。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "权限或认证失败原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "example": {
            "code": 0,
            "msg": null,
            "data": {
              "default-pay": "transfer",
              "transfer": {
                "state": true,
                "data": "请按客服指引完成转账"
              },
              "wxpay": {
                "state": false,
                "subtype": ""
              },
              "alipay": {
                "state": false,
                "subtype": ""
              }
            }
          }
        }
      }
    }
  },
  "x-python-handler": "config.ConfigAPI",
  "x-python-route-line": 595,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "config_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "复合配置标识，格式为 {scope_name}-{scope_id}-{type}-{name}。服务端以前三个连字符切分，因此 name 可以包含连字符，例如 global-0-system-recharge。",
      "example": "global-0-system-recharge"
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "config.ConfigAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 595
    },
    {
      "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/configs/{config_id}",
  "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": "按作用域、类型和名称组成的复合标识读取一条主控配置。登录用户只可读取 site 类型的 clean_url、clean_dir、ip-unlock-max-limit、ip-unlock-max-per-limit、pre_cache_url，以及 system 类型的 recharge；其余标识要求管理员身份。普通用户读取 recharge 时不会取得支付密钥，仅取得默认支付方式和转账说明。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "configs",
        ":config_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 复合配置标识，格式为 {scope_name}-{scope_id}-{type}-{name}。服务端以前三个连字符切分，因此 name 可以包含连字符，例如 global-0-system-recharge。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "config_id"
        }
      ]
    },
    "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"
        }
      ]
    }
  }
}