GoWindGoWind
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
  • Introduction

    • GoWind CMS Product Introduction
    • GoWind CMS Installation Guide
  • Backend

    • CMS Backend Architecture Overview
    • CMS Backend Modules Overview
    • CMS Protobuf API Definitions
    • CMS Configuration and Deployment Guide
    • Backend Extension Mechanisms Guide
  • Frontend

    • CMS Frontend Architecture
    • CMS Frontend Modules Overview
  • Getting Started

    • Adding a Content Type, Full Stack in Practice
    • Multi-Client API Client Code Generation Tutorial
  • Core Tutorials

    • Content Multilingual Translation Tutorial
    • Content Publishing Workflow Tutorial
    • Section Editor in Practice
    • Headless API Multi-Client Integration in Practice
    • Frontend Application Development in Practice
  • Intermediate Tutorials

    • Multi-Site Management in Practice
    • Media Asset Management in Practice
    • Comment System Tutorial
    • Event Bus Architecture in Practice
    • Lua Script Extensions in Practice
  • Advanced Topics

    • Permission System in Practice
    • Dual-Client Login Security in Practice
    • Encryption and Security Toolkit Tutorial
    • Full-Text Search in Practice
    • Task Scheduling in Practice
    • Real-Time Message Push (SSE) in Practice
    • Performance Monitoring in Practice
    • Dictionary Management System Tutorial
  • Full-Stack Guides

    • Full-Stack Integration in Practice
    • Three-Service Deployment Tutorial

CMS Protobuf API Definitions

GoWind CMS adopts a Protobuf First API development model, serving the admin console and the frontend applications separately through dual protocols (Admin API + App API). This document details the API organization structure, the content domain model, and the translation mechanism.

1. Protobuf Directory Organization

api/protos/
├── admin/service/v1/           # Admin Service interface definitions (41 proto files)
├── app/service/v1/             # App Service interface definitions (11 proto files)
├── content/service/v1/         # Content domain messages (Post/Category/Tag/Page + translations)
├── site/service/v1/            # Site domain messages (Site/Navigation/SiteSetting)
├── identity/                   # Identity management messages (User/Role/OrgUnit/Tenant...)
├── permission/                 # Permission management messages
├── authentication/             # Authentication messages
├── audit/                      # Audit log messages
├── comment/                    # Comment messages (shared definitions)
├── dict/                       # Dictionary management messages
├── internal_message/           # Internal message notifications
├── media/                      # Media resource messages
├── storage/                    # File storage messages
├── task/                       # Task scheduling messages
└── translator/                 # Translation management messages

Design Principle: Interfaces and Messages Separated

The Protobuf design of the CMS follows the principle of separating interface definitions from message definitions:

  • admin/service/v1/i_post.proto — defines the Admin HTTP routes and RPC methods
  • app/service/v1/i_post.proto — defines the App HTTP routes and RPC methods
  • content/service/v1/post.proto — defines the Post message body (shared by both)

2. Dual-Protocol API Routes

Admin API (Admin Console)

Route prefix: /admin/v1/, port: 6600

// admin/service/v1/i_post.proto
service PostService {
  rpc List (pagination.PagingRequest) returns (content.service.v1.ListPostResponse) {
    option (google.api.http) = { get: "/admin/v1/posts" };
  }
  rpc Get (content.service.v1.GetPostRequest) returns (content.service.v1.Post) {
    option (google.api.http) = { get: "/admin/v1/posts/{id}" };
  }
  rpc Create (content.service.v1.CreatePostRequest) returns (content.service.v1.Post) {
    option (google.api.http) = { post: "/admin/v1/posts" body: "*" };
  }
  rpc Update (content.service.v1.UpdatePostRequest) returns (content.service.v1.Post) {
    option (google.api.http) = { put: "/admin/v1/posts/{id}" body: "*" };
  }
  rpc Delete (content.service.v1.DeletePostRequest) returns (google.protobuf.Empty) {
    option (google.api.http) = { delete: "/admin/v1/posts/{id}" };
  }
  // Check whether a translation exists
  rpc TranslationExists(...) returns (...) {
    option (google.api.http) = { get: "/admin/v1/posts/{post_id}/translations/{language_code}" };
  }
}

App API (Frontend Applications)

Route prefix: /app/v1/, port: 6700

// app/service/v1/i_post.proto
service PostService {
  rpc List (pagination.PagingRequest) returns (content.service.v1.ListPostResponse) {
    option (google.api.http) = { get: "/app/v1/posts" };
  }
  rpc Get (content.service.v1.GetPostRequest) returns (content.service.v1.Post) {
    option (google.api.http) = { get: "/app/v1/posts/{id}" };
  }
  rpc Create (content.service.v1.CreatePostRequest) returns (content.service.v1.Post) {
    option (google.api.http) = { post: "/app/v1/posts" body: "*" };
  }
  // Fetch translation data (frontends fetch content by language)
  rpc GetTranslation(content.service.v1.GetPostRequest) returns (content.service.v1.PostTranslation) {
    option (google.api.http) = { get: "/app/v1/posts/{id}/translation" };
  }
}

Admin API vs App API

AspectAdmin APIApp API
Route prefix/admin/v1//app/v1/
AuthenticationAll endpoints require JWT except loginBrowsing endpoints require no login
Number of endpoints40+ Services9 Services
Write operationsFull CRUDRestricted (users may post and comment)
Translation managementTranslationExists / CreateTranslation / UpdateTranslation / DeleteTranslationGetTranslation only (read by language)

3. Admin API Endpoint List

Content Management

ServiceRouteDescription
PostService/admin/v1/postsPost management + translation management
CategoryService/admin/v1/categoriesCategory management (tree) + translation management
TagService/admin/v1/tagsTag management + translation management
CommentService/admin/v1/commentsComment management (moderation/delete/reply)
PageService/admin/v1/pagesPage management + translation management

Site Management

ServiceRouteDescription
SiteService/admin/v1/sitesSite management (multi-site configuration)
SiteSettingService/admin/v1/site-settingsSite global settings
NavigationService/admin/v1/navigationsNavigation bar management
NavigationItemService/admin/v1/navigation-itemsNavigation item management

Media Resources

ServiceRouteDescription
MediaAssetService/admin/v1/media-assetsMedia asset management (images/videos/documents)
FileService/admin/v1/filesFile record management
FileTransferService/admin/v1/files/*File upload and download (manually registered Handlers)

Organization, Permissions, and System Administration

Shares the same service system as GoWind Admin (UserService, RoleService, PermissionService, DictService, TaskService, etc.); see Admin Backend API for details.

4. App API Endpoint List

ServiceRouteDescriptionLogin-Free
AuthenticationService/app/v1/login /app/v1/logout /app/v1/refresh-tokenFrontend user authenticationLogin is unauthenticated
PostService/app/v1/postsPost browsing/publishing + translation retrievalList/Get are login-free
CategoryService/app/v1/categoriesCategory browsingList/Get are login-free
TagService/app/v1/tagsTag browsingList/Get are login-free
CommentService/app/v1/commentsComment interactionList/Get are login-free
PageService/app/v1/pagesPage displayList/Get are login-free
NavigationService/app/v1/navigationsNavigation retrievalList is login-free
UserProfileService/app/v1/user-profileUser profileLogin required
FileTransferService/app/v1/files/*File upload and downloadLogin required

5. Content Domain Model

Post

The post is the core content entity of the CMS, supporting rich content management features such as multilingual content, categories, tags, and password protection:

message Post {
  optional uint32 id = 1;
  optional string title = 2;          // Title
  optional string slug = 3;           // URL alias
  optional string content = 5;        // Content
  optional Post.Status status = 6;    // Status: draft/published/offline
  optional EditorType editor_type = 7;// Editor type
  repeated Section sections = 8;      // Content sections/blocks (rich-text builder)

  optional uint32 author_id = 20;     // Author ID
  optional string author_name = 21;   // Author name (guest)

  map<string, string> custom_fields = 30;    // Custom fields

  repeated PostTranslation translations = 40; // Multilingual translations
  repeated string available_languages = 41;   // Available language list

  repeated uint32 category_ids = 50;  // Associated categories
  repeated uint32 tag_ids = 51;       // Associated tags

  optional string password_hash = 60; // Password protection
}

Post Status Enum

enum Status {
  POST_STATUS_DRAFT = 0;      // Draft
  POST_STATUS_PUBLISHED = 1;  // Published
  POST_STATUS_OFFLINE = 2;    // Offline
}

Section (Content Block)

The Post supports section-based content building, similar to Notion / Gutenberg editors:

message Section {
  optional SectionType type = 1;  // Section type
  optional string name = 2;       // Section name
  optional uint32 sort_order = 3; // Sort order
  map<string, string> config = 4; // Section config
  map<string, string> content = 5;// Section content
}

Supported section types: rich text, Markdown, heading, image, gallery, video, button, divider, code, HTML, form, carousel, etc.

Category

Categories support a tree structure, using a materialized path to optimize hierarchy queries:

message Category {
  optional string name = 4;        // Category name
  optional string slug = 5;        // URL alias
  optional string icon = 6;        // Icon
  optional string code = 7;        // Unique code

  optional uint32 parent_id = 60;  // Parent node ID
  repeated Category children = 61; // Child node tree
  optional int32 depth = 62;       // Depth level
  optional string path = 63;       // Materialized path (e.g. "1/5/23")

  repeated CategoryTranslation translations = 20; // Multilingual translations
}

6. Multilingual Translation Model

Content translation in the CMS adopts the main table + translation table design pattern, with a corresponding translation message for every content entity.

Translation Message Structure

// Post translation
message PostTranslation {
  optional uint32 post_id = 2;        // Associated post ID
  optional string language_code = 3;  // Language code (e.g. zh-CN, en-US)

  optional string title = 10;         // Translated title
  optional string slug = 11;          // Language-specific slug
  optional string summary = 12;       // Translated summary
  optional string content = 13;       // Translated content
  optional string thumbnail = 15;     // Translated thumbnail
  optional string full_path = 17;     // Full path

  optional SeoMeta seo = 20;          // SEO metadata
}

Translation API Design

The Admin API provides full translation CRUD:

// admin/service/v1/i_post.proto
service PostService {
  // Check whether a translation exists
  rpc TranslationExists(PostTranslationExistsRequest) returns (PostTranslationExistsResponse) {
    option (google.api.http) = {
      get: "/admin/v1/posts/{post_id}/translations/{language_code}"
    };
  }
}

The App API only provides translation reads:

// app/service/v1/i_post.proto
service PostService {
  // Frontends fetch translated content by language
  rpc GetTranslation(GetPostRequest) returns (PostTranslation) {
    option (google.api.http) = {
      get: "/app/v1/posts/{id}/translation"
    };
  }
}

Translation Query Mechanism

When requesting content, the frontend specifies the language via the locale parameter:

# Fetch the English translation of a post
GET /app/v1/posts/42?locale=en-US

# Fetch the Japanese translation of a category
GET /app/v1/categories/10?locale=ja-JP

Each content entity also maintains an available_languages field so frontends can quickly determine the available languages.

7. SEO Metadata

All content entities support the structured SeoMeta metadata:

message SeoMeta {
  optional string seo_title = 1;        // SEO title
  optional string meta_keywords = 2;    // SEO keywords
  optional string meta_description = 3; // SEO description

  optional string og_title = 4;         // Open Graph title
  optional string og_description = 5;   // Open Graph description
  optional string og_image = 6;         // Open Graph image

  optional string canonical_url = 33;   // Canonical URL
}

SEO metadata can be attached to translations, enabling independent SEO configuration for each language version.

8. Code Generation Configuration

Buf Generation Config Files

FileDescription
buf.gen.yamlGo server-side code generation
buf.admin.openapi.gen.yamlAdmin API OpenAPI documents
buf.app.openapi.gen.yamlApp API OpenAPI documents
buf.admin.typescript.gen.yamlAdmin console TypeScript code
buf.react.app.typescript.gen.yamlReact frontend TypeScript code
buf.taro.app.typescript.gen.yamlTaro frontend TypeScript code
buf.vue.app.typescript.gen.yamlVue frontend TypeScript code
buf.app.dart.gen.yamlFlutter frontend Dart code

Generation Commands

cd backend

make api       # Generate Go code
make openapi   # Generate OpenAPI documents (Admin + App)
make ts        # Generate TypeScript code (Admin + React + Taro + Vue)
make gen       # Generate everything at once (ent + wire + api + openapi)

9. Swagger UI

APISwagger URL
Admin APIhttp://localhost:6600/docs/
App APIhttp://localhost:6700/docs/

10. Related Documentation

  • CMS Backend Architecture Overview
  • CMS Frontend Architecture
  • Content Multilingual Translation in Practice
  • GoWind Admin API — shared service system
Edit this page
Last Updated:: 11/3/26, 2:14 PM
Contributors: Bobo
Prev
CMS Backend Modules Overview
Next
CMS Configuration and Deployment Guide