{
  "openapi": "3.0.3",
  "info": {
    "title": "飞凡数融研究站 · 开放数据接口",
    "version": "1.0.0",
    "description": "机器可读的开放数据结构定义。所有端点为构建期生成的静态 JSON，已通过 vercel.json 配置 Access-Control-Allow-Origin: * 支持跨域。推荐主接口：/api/content-index.json。",
    "contact": { "name": "飞凡数融", "url": "https://ffsr.top" }
  },
  "servers": [{ "url": "https://ffsr.top" }],
  "paths": {
    "/api/content-index.json": {
      "get": {
        "summary": "跨端统一内容清单（推荐主接口）",
        "description": "聚合 posts / cases / international / blog 四类，含 access / price / memberZone 策略字段与 teaser 摘要。",
        "responses": {
          "200": {
            "description": "统一内容清单",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["generatedAt", "count", "items"],
                  "properties": {
                    "generatedAt": { "type": "string", "format": "date-time", "description": "构建时刻" },
                    "count": { "type": "integer", "description": "条目总数" },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["id", "collection", "type", "title", "access"],
                        "properties": {
                          "id": { "type": "string" },
                          "collection": { "type": "string", "enum": ["posts", "cases", "international", "blog"] },
                          "type": { "type": "string", "enum": ["bank_intel", "regulatory", "case", "intl", "thought", "report"] },
                          "title": { "type": "string" },
                          "summary": { "type": "string", "description": "一句话摘要（免费 teaser）" },
                          "teaser": { "type": "string", "description": "正文截断摘要" },
                          "category": { "type": "string" },
                          "tags": { "type": "array", "items": { "type": "string" } },
                          "entity": { "type": ["string", "null"] },
                          "region": { "type": ["string", "null"] },
                          "sourceRepo": { "type": "string" },
                          "pubDate": { "type": ["string", "null"], "format": "date", "description": "发布日期 YYYY-MM-DD" },
                          "reportPeriod": { "type": ["string", "null"] },
                          "access": { "type": "string", "enum": ["public", "member", "paid"] },
                          "price": { "type": ["number", "null"] },
                          "memberZone": { "type": "boolean" },
                          "slug": { "type": "string" },
                          "lookupSlug": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/cases.json": {
      "get": {
        "summary": "每日银行 AI 实战案例库",
        "responses": {
          "200": {
            "description": "按日期聚合的案例",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updatedAt": { "type": "string", "format": "date-time" },
                    "count": { "type": "integer", "description": "天数" },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": { "type": "string" },
                          "slug": { "type": "string" },
                          "title": { "type": "string" },
                          "description": { "type": "string" },
                          "url": { "type": "string" },
                          "cases": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "bank": { "type": "string" },
                                "subtitle": { "type": "string" },
                                "category": { "type": "string" },
                                "scene": { "type": "string" },
                                "tech": { "type": "string" },
                                "metrics": { "type": "array", "items": { "type": "string" } },
                                "reuse": { "type": "string" },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "url": { "type": "string" },
                                    "title": { "type": "string" }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/international.json": {
      "get": {
        "summary": "国际前沿动态",
        "responses": {
          "200": {
            "description": "按日期聚合的海外实践",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updatedAt": { "type": "string", "format": "date-time" },
                    "count": { "type": "integer", "description": "天数" },
                    "days": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "date": { "type": "string" },
                          "slug": { "type": "string" },
                          "title": { "type": "string" },
                          "description": { "type": "string" },
                          "url": { "type": "string" },
                          "cases": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "bank": { "type": "string" },
                                "subtitle": { "type": "string" },
                                "category": { "type": "string" },
                                "scene": { "type": "string" },
                                "tech": { "type": "string" },
                                "metrics": { "type": "array", "items": { "type": "string" } },
                                "reuse": { "type": "string" },
                                "source": {
                                  "type": "object",
                                  "properties": {
                                    "url": { "type": "string" },
                                    "title": { "type": "string" }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/research.json": {
      "get": {
        "summary": "深度研究清单",
        "description": "列表仅含 description（短描述）；summary / keyFindings / 飞凡点评为会员专享，须经绑定后受控接口获取。",
        "responses": {
          "200": {
            "description": "研究清单",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updatedAt": { "type": "string", "format": "date-time" },
                    "count": { "type": "integer", "description": "条数" },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": { "type": "string" },
                          "title": { "type": "string" },
                          "description": { "type": "string" },
                          "pubDate": { "type": "string", "format": "date" },
                          "category": { "type": "string" },
                          "topics": { "type": "array", "items": { "type": "string" } },
                          "url": { "type": "string" },
                          "type": { "type": "string" },
                          "access": { "type": "string", "enum": ["public", "member", "paid"] },
                          "price": { "type": ["number", "null"] },
                          "reportPeriod": { "type": ["string", "null"] },
                          "memberZone": { "type": "boolean" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/research/{slug}.json": {
      "get": {
        "summary": "单篇研究元数据",
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "description": "文章编号" }
        ],
        "responses": {
          "200": {
            "description": "单篇元数据（无正文）",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "slug": { "type": "string" },
                    "title": { "type": "string" },
                    "pubDate": { "type": "string", "format": "date" },
                    "category": { "type": "string" },
                    "topics": { "type": "array", "items": { "type": "string" } }
                  }
                }
              }
            }
          },
          "404": { "description": "未找到" }
        }
      }
    }
  }
}
