<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>架构实践 on </title>
    <link>/tags/%E6%9E%B6%E6%9E%84%E5%AE%9E%E8%B7%B5/</link>
    <description>Recent content in 架构实践 on </description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Fri, 10 Apr 2026 10:00:00 +0800</lastBuildDate><atom:link href="/tags/%E6%9E%B6%E6%9E%84%E5%AE%9E%E8%B7%B5/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>微服务架构下的 OpenAPI 聚合文档实践</title>
      <link>/posts/openapi-aggregation-in-microservice-architecture/</link>
      <pubDate>Fri, 10 Apr 2026 10:00:00 +0800</pubDate>
      
      <guid>/posts/openapi-aggregation-in-microservice-architecture/</guid>
      <description>📦 本文基于的完整项目源码：https://github.com/meirongdev/shop
🏷️ 当前文章对应的代码版本：main
背景 在一个典型的微服务架构中，每个服务都独立维护自己的 API 文档。随着服务数量增长，前端开发者和第三方集成方常常面临一个痛点：
我需要去哪里找某个接口的文档？
传统的解决方案是让开发者记住每个服务的地址，或者维护一个手动的聚合页面。但这些方案都存在明显的问题：容易过时、维护成本高、无法与 CI/CD 集成。
本文以一个云原生电商平台的实际案例，记录我们当前如何通过 Spring Cloud Gateway MVC + SpringDoc 维护一套相对省事的 OpenAPI 聚合方案。
架构概览 我们的平台采用 Gateway + Thin BFF + Domain Service 三层架构：
Client └→ api-gateway:8080 (Spring Cloud Gateway MVC, JWT validation, rate limiting) ├→ /auth/** → auth-server ├→ /buyer/** → buyer-portal (Kotlin + Thymeleaf SSR) ├→ /seller/** → seller-app (KMP WASM SPA) ├→ /api/buyer/** → buyer-bff (aggregates domain services) ├→ /api/seller/** → seller-bff (aggregates domain services) ├→ /api/loyalty/** → loyalty-service ├→ /api/activity/** → activity-service ├→ /api/webhook/** → webhook-service └→ /api/subscription/** → subscription-service 共包含：</description>
    </item>
    
  </channel>
</rss>
