{
  "openapi": "3.1.0",
  "info": {
    "title": "出海快线公开目录",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://chuhai.express"
    }
  ],
  "security": [],
  "paths": {
    "/api/catalog": {
      "get": {
        "operationId": "searchCatalog",
        "summary": "查找公开目录记录",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "tool",
                "category",
                "deal",
                "guide"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "affiliate",
                "cashback",
                "ai",
                "ads",
                "creative",
                "vps",
                "web",
                "payments",
                "seo",
                "numbers",
                "privacy"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "公开查询结果",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total",
                    "offset",
                    "limit",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "offset": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "limit": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Record"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "参数不符合接口要求"
          },
          "404": {
            "description": "记录不存在"
          }
        }
      }
    },
    "/api/catalog/{kind}/{slug}": {
      "get": {
        "operationId": "getEntry",
        "summary": "按类型和编号读取详情",
        "parameters": [
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "tool",
                "category",
                "deal",
                "guide"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "公开查询结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Record"
                }
              }
            }
          },
          "400": {
            "description": "参数不符合接口要求"
          },
          "404": {
            "description": "记录不存在"
          }
        }
      }
    },
    "/api/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "读取分类和工具数量",
        "parameters": [],
        "responses": {
          "200": {
            "description": "公开查询结果",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total",
                    "items"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Record"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "参数不符合接口要求"
          },
          "404": {
            "description": "记录不存在"
          }
        }
      }
    },
    "/api/": {
      "get": {
        "operationId": "catalogIndex",
        "summary": "读取服务入口",
        "parameters": [],
        "responses": {
          "200": {
            "description": "公开查询结果",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "catalog": {
                      "type": "string"
                    },
                    "categories": {
                      "type": "string"
                    },
                    "openapi": {
                      "type": "string"
                    },
                    "mcp": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "参数不符合接口要求"
          },
          "404": {
            "description": "记录不存在"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Record": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "tool",
              "category",
              "deal",
              "guide"
            ]
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "kind",
          "slug",
          "title",
          "url"
        ],
        "additionalProperties": true
      }
    }
  }
}
