<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Team Collaboration · 仁才德</title>
    <link>https://jared.lynskey.co.nz/zh-cn/tags/team-collaboration/</link>
    <description>关于软件工程与研发团队领导力的短文——绩效评估、招聘与团队扩张、CI/CD、DevOps 监控、智能体 AI。写于首尔。</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <copyright>© 2026 仁才德</copyright>
    <lastBuildDate>Wed, 28 Oct 2026 00:00:00 +1300</lastBuildDate>
    <atom:link href="https://jared.lynskey.co.nz/zh-cn/tags/team-collaboration/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>API 优先开发：用 OpenAPI 让前后端并行开发</title>
      <link>https://jared.lynskey.co.nz/zh-cn/posts/2023/2023-10-08-open-api/</link>
      <guid isPermaLink="true">https://jared.lynskey.co.nz/zh-cn/posts/2023/2023-10-08-open-api/</guid>
      <pubDate>Sun, 08 Oct 2023 00:30:03 +0000</pubDate>
      <dc:creator>Jared Lynskey</dc:creator>
      <category>OpenAPI</category>
      <category>Backend</category>
      <category>Frontend</category>
      <category>API Design</category>
      <category>Software Development</category>
      <category>Team Collaboration</category>
      <description>API 优先开发的实际做法：先用 OpenAPI 把接口契约定下来，再起一个模拟服务器（mock server），前端就不用干等后端了。</description>
      <content:encoded><![CDATA[<p>我见过的最靠谱的进度杀手，不是什么高难度的工程问题，而是前端干坐着，等一个“马上就好”的接口。我们在公司最后定下的解法很无聊，但很管用：写代码之前，先用 OpenAPI 把接口契约谈妥。</p>

<h3 class="relative group">等待的游戏
    <div id="等待的游戏" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e7%ad%89%e5%be%85%e7%9a%84%e6%b8%b8%e6%88%8f" aria-label="锚点">#</a>
    </span>
    
</h3>
<p>传统流程是串行的：后端先设计并实现 API，等接口真正能跑了，前端才开始对接。后端的每一次延误都会直接砸到前端的日程表上，而发布日期恰恰写在前端的日程表里。</p>

<h3 class="relative group">契约在前，代码在后
    <div id="契约在前代码在后" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e5%a5%91%e7%ba%a6%e5%9c%a8%e5%89%8d%e4%bb%a3%e7%a0%81%e5%9c%a8%e5%90%8e" aria-label="锚点">#</a>
    </span>
    
</h3>
<p>按“接口定义优先”（schema-first）的流程，两边几乎可以同时起跑。在一行代码都不存在的时候，先把 API 的结构写进 OpenAPI 接口定义——每个端点、请求和响应模型、认证方式、错误码。这份文档就是前后端之间的合同。</p>
<p>回报来得很快。功能还没开工，所有人对它的理解就已经一致。后端还在实现，前端就能开始搭 UI。变更也转得更快，因为只有一份公认的事实来源需要更新。而且接口定义可以直接生成模拟服务器，在一个真实接口都没有的时候，前端测试就能开跑。</p>

<h3 class="relative group">实际怎么跑
    <div id="实际怎么跑" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e5%ae%9e%e9%99%85%e6%80%8e%e4%b9%88%e8%b7%91" aria-label="锚点">#</a>
    </span>
    
</h3>
<ol>
<li>收集需求，跟做任何东西一样。</li>
<li>设计接口定义：端点、请求/响应模型、认证、错误码。</li>
<li>让前端和后端一起评审——契约的价值就体现在这一步。</li>
<li>生成模拟服务器（Swagger 和 Postman 都能做），前端先对着它集成。</li>
<li>后端照着同一份接口定义实现真实接口。</li>
<li>接口做好一个就替换一个模拟端点，持续测试，确保契约没被破坏。</li>
<li>保持沟通。接口定义是活文档，不是石碑。</li>
</ol>

<h3 class="relative group">要付的代价
    <div id="要付的代价" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none">
        <a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#%e8%a6%81%e4%bb%98%e7%9a%84%e4%bb%a3%e4%bb%b7" aria-label="锚点">#</a>
    </span>
    
</h3>
<p>这套流程不是免费的。提前写一份周全的接口定义要花实打实的时间。需求一变，得先改接口定义，涟漪会波及两个团队。另外每个人都得对 OpenAPI 和配套工具有基本的手感。</p>
<p>即便如此，我还没见过这笔前期投入输给它省下的集成混乱。前端第一天就能开工，而争论发生在文档上，而不是发生在挂掉的构建里。</p>
]]></content:encoded>
      <media:content url="https://jared.lynskey.co.nz/en/posts/2023/2023-10-08-open-api/featured.jpg" medium="image" type="image/jpeg" />
    </item>
  </channel>
</rss>
