{{ currentStyle.name }}
+ {{ currentStyle.badge }} +{{ currentStyle.desc }}
+ +{{ currentStyle.example }}
+ diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..de05607
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1 @@
+**/*.md
diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs
index d92d8eb..daa4551 100644
--- a/docs/.vitepress/config.mjs
+++ b/docs/.vitepress/config.mjs
@@ -573,74 +573,224 @@ export default defineConfig({
text: '一、计算机是怎么回事',
collapsed: false,
items: [
- { text: '从晶体管到 CPU', link: '/zh-cn/appendix/1-computer-fundamentals/transistor-to-cpu' },
- { text: '操作系统(进程 / 内存 / 文件系统)', link: '/zh-cn/appendix/1-computer-fundamentals/operating-systems' },
- { text: '数据的编码、存储与传输', link: '/zh-cn/appendix/1-computer-fundamentals/data-encoding-storage' },
- { text: '网络:两台电脑如何对话', link: '/zh-cn/appendix/1-computer-fundamentals/computer-networks' },
- { text: '数据结构', link: '/zh-cn/appendix/1-computer-fundamentals/data-structures' },
- { text: '算法思维入门', link: '/zh-cn/appendix/1-computer-fundamentals/algorithm-thinking' },
- { text: '编程语言图谱', link: '/zh-cn/appendix/1-computer-fundamentals/programming-languages' },
- { text: '类型系统与编译原理入门', link: '/zh-cn/appendix/1-computer-fundamentals/type-systems-compilers' }
+ {
+ text: '从晶体管到 CPU',
+ link: '/zh-cn/appendix/1-computer-fundamentals/transistor-to-cpu'
+ },
+ {
+ text: '操作系统(进程 / 内存 / 文件系统)',
+ link: '/zh-cn/appendix/1-computer-fundamentals/operating-systems'
+ },
+ {
+ text: '数据的编码、存储与传输',
+ link: '/zh-cn/appendix/1-computer-fundamentals/data-encoding-storage'
+ },
+ {
+ text: '网络:从输入网址到返回结果的过程',
+ link: '/zh-cn/appendix/1-computer-fundamentals/computer-networks'
+ },
+ {
+ text: '数据结构',
+ link: '/zh-cn/appendix/1-computer-fundamentals/data-structures'
+ },
+ {
+ text: '算法思维入门',
+ link: '/zh-cn/appendix/1-computer-fundamentals/algorithm-thinking'
+ },
+ {
+ text: '编程语言图谱',
+ link: '/zh-cn/appendix/1-computer-fundamentals/programming-languages'
+ },
+ {
+ text: '类型系统与编译原理入门',
+ link: '/zh-cn/appendix/1-computer-fundamentals/type-systems-compilers'
+ }
]
},
{
text: '二、开发环境与工具',
collapsed: false,
items: [
- { text: '集成开发环境 (IDE) 基础', link: '/zh-cn/appendix/2-development-tools/ide-basics' },
- { text: '命令行与 Shell 脚本', link: '/zh-cn/appendix/2-development-tools/command-line-shell' },
- { text: 'Git:代码的时光机', link: '/zh-cn/appendix/2-development-tools/git-version-control' },
- { text: '环境变量与 PATH', link: '/zh-cn/appendix/2-development-tools/environment-path' },
- { text: '端口与 localhost', link: '/zh-cn/appendix/2-development-tools/ports-localhost' },
- { text: 'SSH 与密钥认证', link: '/zh-cn/appendix/2-development-tools/ssh-authentication' },
- { text: '包管理器(npm / pip / cargo)', link: '/zh-cn/appendix/2-development-tools/package-managers' },
- { text: '调试的艺术', link: '/zh-cn/appendix/2-development-tools/debugging-art/' },
- { text: '正则表达式', link: '/zh-cn/appendix/2-development-tools/regex' }
+ {
+ text: '集成开发环境 (IDE) 基础',
+ link: '/zh-cn/appendix/2-development-tools/ide-basics'
+ },
+ {
+ text: '命令行与 Shell 脚本',
+ link: '/zh-cn/appendix/2-development-tools/command-line-shell'
+ },
+ {
+ text: 'Git:代码的时光机',
+ link: '/zh-cn/appendix/2-development-tools/git-version-control'
+ },
+ {
+ text: '环境变量与 PATH',
+ link: '/zh-cn/appendix/2-development-tools/environment-path'
+ },
+ {
+ text: '端口与 localhost',
+ link: '/zh-cn/appendix/2-development-tools/ports-localhost'
+ },
+ {
+ text: 'SSH 与密钥认证',
+ link: '/zh-cn/appendix/2-development-tools/ssh-authentication'
+ },
+ {
+ text: '包管理器(npm / pip / cargo)',
+ link: '/zh-cn/appendix/2-development-tools/package-managers'
+ },
+ {
+ text: '调试的艺术',
+ link: '/zh-cn/appendix/2-development-tools/debugging-art/'
+ },
+ {
+ text: '正则表达式',
+ link: '/zh-cn/appendix/2-development-tools/regex'
+ }
]
},
{
text: '三、浏览器与前端',
collapsed: false,
items: [
- { text: 'JavaScript 语言深入', link: '/zh-cn/appendix/3-browser-and-frontend/javascript-deep-dive' },
- { text: 'TypeScript:给 JS 加上类型系统', link: '/zh-cn/appendix/3-browser-and-frontend/typescript' },
- { text: '前端框架对比(React / Vue / Svelte / Angular)', link: '/zh-cn/appendix/3-browser-and-frontend/frontend-frameworks' },
- { text: '浏览器是一个操作系统', link: '/zh-cn/appendix/3-browser-and-frontend/browser-as-os' },
- { text: '浏览器渲染管道', link: '/zh-cn/appendix/3-browser-and-frontend/browser-as-os-rendering' },
- { text: 'HTML / CSS 布局体系', link: '/zh-cn/appendix/3-browser-and-frontend/html-css-layout' },
- { text: 'JavaScript 运行时', link: '/zh-cn/appendix/3-browser-and-frontend/javascript-runtime' },
- { text: '前端框架的本质', link: '/zh-cn/appendix/3-browser-and-frontend/frontend-framework-nature' },
- { text: '状态管理哲学', link: '/zh-cn/appendix/3-browser-and-frontend/state-management' },
- { text: '路由与导航', link: '/zh-cn/appendix/3-browser-and-frontend/routing-navigation' },
- { text: '图形与动画(Canvas / SVG / WebGL)', link: '/zh-cn/appendix/3-browser-and-frontend/graphics-animation' },
- { text: '实时通信(WebSocket / SSE)', link: '/zh-cn/appendix/3-browser-and-frontend/realtime-communication' },
- { text: '网页性能的度量与优化', link: '/zh-cn/appendix/3-browser-and-frontend/web-performance' },
- { text: '前端工程化全貌', link: '/zh-cn/appendix/3-browser-and-frontend/frontend-engineering' },
- { text: '无障碍与国际化', link: '/zh-cn/appendix/3-browser-and-frontend/a11n-i18n' }
+ {
+ text: 'JavaScript 语言深入',
+ link: '/zh-cn/appendix/3-browser-and-frontend/javascript-deep-dive'
+ },
+ {
+ text: 'TypeScript:给 JS 加上类型系统',
+ link: '/zh-cn/appendix/3-browser-and-frontend/typescript'
+ },
+ {
+ text: '前端框架对比(React / Vue / Svelte / Angular)',
+ link: '/zh-cn/appendix/3-browser-and-frontend/frontend-frameworks'
+ },
+ {
+ text: '浏览器是一个操作系统',
+ link: '/zh-cn/appendix/3-browser-and-frontend/browser-as-os'
+ },
+ {
+ text: '浏览器渲染管道',
+ link: '/zh-cn/appendix/3-browser-and-frontend/browser-as-os-rendering'
+ },
+ {
+ text: 'HTML / CSS 布局体系',
+ link: '/zh-cn/appendix/3-browser-and-frontend/html-css-layout'
+ },
+ {
+ text: 'JavaScript 运行时',
+ link: '/zh-cn/appendix/3-browser-and-frontend/javascript-runtime'
+ },
+ {
+ text: '前端框架的本质',
+ link: '/zh-cn/appendix/3-browser-and-frontend/frontend-framework-nature'
+ },
+ {
+ text: '状态管理哲学',
+ link: '/zh-cn/appendix/3-browser-and-frontend/state-management'
+ },
+ {
+ text: '路由与导航',
+ link: '/zh-cn/appendix/3-browser-and-frontend/routing-navigation'
+ },
+ {
+ text: '图形与动画(Canvas / SVG / WebGL)',
+ link: '/zh-cn/appendix/3-browser-and-frontend/graphics-animation'
+ },
+ {
+ text: '实时通信(WebSocket / SSE)',
+ link: '/zh-cn/appendix/3-browser-and-frontend/realtime-communication'
+ },
+ {
+ text: '网页性能的度量与优化',
+ link: '/zh-cn/appendix/3-browser-and-frontend/web-performance'
+ },
+ {
+ text: '前端工程化全貌',
+ link: '/zh-cn/appendix/3-browser-and-frontend/frontend-engineering'
+ },
+ {
+ text: '无障碍与国际化',
+ link: '/zh-cn/appendix/3-browser-and-frontend/a11n-i18n'
+ }
]
},
{
text: '四、服务器与后端',
collapsed: false,
items: [
- { text: '后端语言对比(Node.js / Go / Java / Rust)', link: '/zh-cn/appendix/4-server-and-backend/backend-languages' },
- { text: '客户端语言对比(Swift / Kotlin / Dart)', link: '/zh-cn/appendix/4-server-and-backend/client-languages' },
- { text: '跨平台方案对比(React Native / Flutter / Electron / Tauri)', link: '/zh-cn/appendix/4-server-and-backend/cross-platform' },
- { text: 'HTTP 协议', link: '/zh-cn/appendix/4-server-and-backend/http-protocol' },
- { text: '一个请求的完整旅程', link: '/zh-cn/appendix/4-server-and-backend/request-journey' },
- { text: 'Web 框架的本质', link: '/zh-cn/appendix/4-server-and-backend/web-frameworks' },
- { text: 'API 入门', link: '/zh-cn/appendix/4-server-and-backend/api-intro' },
- { text: 'API 设计哲学(REST / GraphQL / gRPC)', link: '/zh-cn/appendix/4-server-and-backend/api-design' },
- { text: '序列化与数据格式', link: '/zh-cn/appendix/4-server-and-backend/serialization' },
- { text: '认证与授权体系', link: '/zh-cn/appendix/4-server-and-backend/auth-authorization' },
- { text: '并发、异步与多线程', link: '/zh-cn/appendix/4-server-and-backend/concurrency-async' },
- { text: '缓存的层次与策略', link: '/zh-cn/appendix/4-server-and-backend/caching' },
- { text: '消息队列与事件驱动', link: '/zh-cn/appendix/4-server-and-backend/message-queues' },
- { text: '异步任务队列与生产消费模型', link: '/zh-cn/appendix/4-server-and-backend/async-task-queues' },
- { text: '限流与背压控制', link: '/zh-cn/appendix/4-server-and-backend/rate-limiting-backpressure' },
- { text: '搜索引擎原理', link: '/zh-cn/appendix/4-server-and-backend/search-engines' },
- { text: '文件存储与对象存储', link: '/zh-cn/appendix/4-server-and-backend/file-storage' },
- { text: '后端分层架构', link: '/zh-cn/appendix/4-server-and-backend/backend-layered-architecture' }
+ {
+ text: '后端语言对比(Node.js / Go / Java / Rust)',
+ link: '/zh-cn/appendix/4-server-and-backend/backend-languages'
+ },
+ {
+ text: '客户端语言对比(Swift / Kotlin / Dart)',
+ link: '/zh-cn/appendix/4-server-and-backend/client-languages'
+ },
+ {
+ text: '跨平台方案对比(React Native / Flutter / Electron / Tauri)',
+ link: '/zh-cn/appendix/4-server-and-backend/cross-platform'
+ },
+ {
+ text: 'HTTP 协议',
+ link: '/zh-cn/appendix/4-server-and-backend/http-protocol'
+ },
+ {
+ text: '一个请求的完整旅程',
+ link: '/zh-cn/appendix/4-server-and-backend/request-journey'
+ },
+ {
+ text: 'Web 框架的本质',
+ link: '/zh-cn/appendix/4-server-and-backend/web-frameworks'
+ },
+ {
+ text: 'API 入门',
+ link: '/zh-cn/appendix/4-server-and-backend/api-intro'
+ },
+ {
+ text: 'API 设计哲学(REST / GraphQL / gRPC)',
+ link: '/zh-cn/appendix/4-server-and-backend/api-design'
+ },
+ {
+ text: '序列化与数据格式',
+ link: '/zh-cn/appendix/4-server-and-backend/serialization'
+ },
+ {
+ text: '认证与授权体系',
+ link: '/zh-cn/appendix/4-server-and-backend/auth-authorization'
+ },
+ {
+ text: '并发、异步与多线程',
+ link: '/zh-cn/appendix/4-server-and-backend/concurrency-async'
+ },
+ {
+ text: '缓存的层次与策略',
+ link: '/zh-cn/appendix/4-server-and-backend/caching'
+ },
+ {
+ text: '消息队列与事件驱动',
+ link: '/zh-cn/appendix/4-server-and-backend/message-queues'
+ },
+ {
+ text: '异步任务队列与生产消费模型',
+ link: '/zh-cn/appendix/4-server-and-backend/async-task-queues'
+ },
+ {
+ text: '限流与背压控制',
+ link: '/zh-cn/appendix/4-server-and-backend/rate-limiting-backpressure'
+ },
+ {
+ text: '搜索引擎原理',
+ link: '/zh-cn/appendix/4-server-and-backend/search-engines'
+ },
+ {
+ text: '文件存储与对象存储',
+ link: '/zh-cn/appendix/4-server-and-backend/file-storage'
+ },
+ {
+ text: '后端分层架构',
+ link: '/zh-cn/appendix/4-server-and-backend/backend-layered-architecture'
+ }
]
},
{
@@ -648,77 +798,218 @@ export default defineConfig({
collapsed: false,
items: [
{ text: 'SQL', link: '/zh-cn/appendix/5-data/sql' },
- { text: '数据库原理(索引 / 事务 / 查询优化)', link: '/zh-cn/appendix/5-data/database-fundamentals' },
- { text: '数据模型全景(文档 / 图 / 时序 / 向量)', link: '/zh-cn/appendix/5-data/data-models' },
- { text: '数据埋点与用户行为采集', link: '/zh-cn/appendix/5-data/data-tracking' },
- { text: '数据分析基础(统计 / 指标 / 漏斗)', link: '/zh-cn/appendix/5-data/data-analysis' },
- { text: 'A/B 测试与实验驱动', link: '/zh-cn/appendix/5-data/ab-testing' },
- { text: '数据可视化与仪表盘', link: '/zh-cn/appendix/5-data/data-visualization' },
- { text: '数据治理与数据质量', link: '/zh-cn/appendix/5-data/data-governance' }
+ {
+ text: '数据库原理(索引 / 事务 / 查询优化)',
+ link: '/zh-cn/appendix/5-data/database-fundamentals'
+ },
+ {
+ text: '数据模型全景(文档 / 图 / 时序 / 向量)',
+ link: '/zh-cn/appendix/5-data/data-models'
+ },
+ {
+ text: '数据埋点与用户行为采集',
+ link: '/zh-cn/appendix/5-data/data-tracking'
+ },
+ {
+ text: '数据分析基础(统计 / 指标 / 漏斗)',
+ link: '/zh-cn/appendix/5-data/data-analysis'
+ },
+ {
+ text: 'A/B 测试与实验驱动',
+ link: '/zh-cn/appendix/5-data/ab-testing'
+ },
+ {
+ text: '数据可视化与仪表盘',
+ link: '/zh-cn/appendix/5-data/data-visualization'
+ },
+ {
+ text: '数据治理与数据质量',
+ link: '/zh-cn/appendix/5-data/data-governance'
+ }
]
},
{
text: '六、架构与系统设计',
collapsed: false,
items: [
- { text: '从单体到微服务的演进', link: '/zh-cn/appendix/6-architecture-and-system-design/monolith-to-microservices' },
- { text: '分布式系统的挑战', link: '/zh-cn/appendix/6-architecture-and-system-design/distributed-systems' },
- { text: '高可用与容灾', link: '/zh-cn/appendix/6-architecture-and-system-design/high-availability' },
- { text: '系统设计方法论', link: '/zh-cn/appendix/6-architecture-and-system-design/system-design-methodology' }
+ {
+ text: '从单体到微服务的演进',
+ link: '/zh-cn/appendix/6-architecture-and-system-design/monolith-to-microservices'
+ },
+ {
+ text: '分布式系统的挑战',
+ link: '/zh-cn/appendix/6-architecture-and-system-design/distributed-systems'
+ },
+ {
+ text: '高可用与容灾',
+ link: '/zh-cn/appendix/6-architecture-and-system-design/high-availability'
+ },
+ {
+ text: '系统设计方法论',
+ link: '/zh-cn/appendix/6-architecture-and-system-design/system-design-methodology'
+ }
]
},
{
text: '七、基础设施与运维',
collapsed: false,
items: [
- { text: 'Linux 基础', link: '/zh-cn/appendix/7-infrastructure-and-operations/linux-basics' },
- { text: 'Docker 容器化', link: '/zh-cn/appendix/7-infrastructure-and-operations/docker-containers' },
- { text: 'Kubernetes 编排', link: '/zh-cn/appendix/7-infrastructure-and-operations/kubernetes' },
- { text: 'CI / CD 自动化', link: '/zh-cn/appendix/7-infrastructure-and-operations/ci-cd' },
- { text: '域名、DNS 与 HTTPS', link: '/zh-cn/appendix/7-infrastructure-and-operations/dns-https' },
- { text: '负载均衡与网关', link: '/zh-cn/appendix/7-infrastructure-and-operations/load-balancing-gateway' },
- { text: '网关与反向代理', link: '/zh-cn/appendix/7-infrastructure-and-operations/gateway-proxy' },
- { text: '云平台实战', link: '/zh-cn/appendix/7-infrastructure-and-operations/cloud-platforms' },
- { text: 'IAM 权限管理', link: '/zh-cn/appendix/7-infrastructure-and-operations/cloud-iam' },
- { text: '对象存储与 CDN', link: '/zh-cn/appendix/7-infrastructure-and-operations/cloud-storage-cdn' },
- { text: '基础设施即代码', link: '/zh-cn/appendix/7-infrastructure-and-operations/infrastructure-as-code' },
- { text: '监控、日志与告警', link: '/zh-cn/appendix/7-infrastructure-and-operations/monitoring-logging' },
- { text: '故障排查与应急响应', link: '/zh-cn/appendix/7-infrastructure-and-operations/incident-response' }
+ {
+ text: 'Linux 基础',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/linux-basics'
+ },
+ {
+ text: 'Docker 容器化',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/docker-containers'
+ },
+ {
+ text: 'Kubernetes 编排',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/kubernetes'
+ },
+ {
+ text: 'CI / CD 自动化',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/ci-cd'
+ },
+ {
+ text: '域名、DNS 与 HTTPS',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/dns-https'
+ },
+ {
+ text: '负载均衡与网关',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/load-balancing-gateway'
+ },
+ {
+ text: '网关与反向代理',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/gateway-proxy'
+ },
+ {
+ text: '云平台实战',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/cloud-platforms'
+ },
+ {
+ text: 'IAM 权限管理',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/cloud-iam'
+ },
+ {
+ text: '对象存储与 CDN',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/cloud-storage-cdn'
+ },
+ {
+ text: '基础设施即代码',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/infrastructure-as-code'
+ },
+ {
+ text: '监控、日志与告警',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/monitoring-logging'
+ },
+ {
+ text: '故障排查与应急响应',
+ link: '/zh-cn/appendix/7-infrastructure-and-operations/incident-response'
+ }
]
},
{
text: '八、人工智能',
collapsed: false,
items: [
- { text: 'AI 简史与核心概念', link: '/zh-cn/appendix/8-artificial-intelligence/ai-history' },
- { text: '神经网络与深度学习', link: '/zh-cn/appendix/8-artificial-intelligence/neural-networks' },
- { text: 'Transformer 与注意力机制', link: '/zh-cn/appendix/8-artificial-intelligence/transformer-attention' },
- { text: '大语言模型的工作原理', link: '/zh-cn/appendix/8-artificial-intelligence/llm-principles' },
- { text: '提示词工程', link: '/zh-cn/appendix/8-artificial-intelligence/prompt-engineering' },
- { text: '上下文工程', link: '/zh-cn/appendix/8-artificial-intelligence/context-engineering' },
- { text: '多模态模型(视觉 / 音频 / 视频)', link: '/zh-cn/appendix/8-artificial-intelligence/multimodal-models' },
- { text: '图像生成原理', link: '/zh-cn/appendix/8-artificial-intelligence/image-generation' },
- { text: '语音合成与识别', link: '/zh-cn/appendix/8-artificial-intelligence/speech-synthesis-recognition' },
- { text: 'Embedding 与向量检索', link: '/zh-cn/appendix/8-artificial-intelligence/embedding-vector-retrieval' },
- { text: 'RAG 架构', link: '/zh-cn/appendix/8-artificial-intelligence/rag' },
- { text: 'AI Agent 与工具调用', link: '/zh-cn/appendix/8-artificial-intelligence/ai-agents' },
- { text: 'AI 协议(MCP & A2A)', link: '/zh-cn/appendix/8-artificial-intelligence/ai-protocols' },
- { text: '模型微调与部署', link: '/zh-cn/appendix/8-artificial-intelligence/model-finetuning-deployment' },
- { text: 'AI 原生应用设计', link: '/zh-cn/appendix/8-artificial-intelligence/ai-native-app-design' },
- { text: 'AI 能力词典', link: '/zh-cn/appendix/8-artificial-intelligence/ai-capability-dictionary' }
+ {
+ text: 'AI 简史与核心概念',
+ link: '/zh-cn/appendix/8-artificial-intelligence/ai-history'
+ },
+ {
+ text: '神经网络与深度学习',
+ link: '/zh-cn/appendix/8-artificial-intelligence/neural-networks'
+ },
+ {
+ text: 'Transformer 与注意力机制',
+ link: '/zh-cn/appendix/8-artificial-intelligence/transformer-attention'
+ },
+ {
+ text: '大语言模型的工作原理',
+ link: '/zh-cn/appendix/8-artificial-intelligence/llm-principles'
+ },
+ {
+ text: '提示词工程',
+ link: '/zh-cn/appendix/8-artificial-intelligence/prompt-engineering'
+ },
+ {
+ text: '上下文工程',
+ link: '/zh-cn/appendix/8-artificial-intelligence/context-engineering'
+ },
+ {
+ text: '多模态模型(视觉 / 音频 / 视频)',
+ link: '/zh-cn/appendix/8-artificial-intelligence/multimodal-models'
+ },
+ {
+ text: '图像生成原理',
+ link: '/zh-cn/appendix/8-artificial-intelligence/image-generation'
+ },
+ {
+ text: '语音合成与识别',
+ link: '/zh-cn/appendix/8-artificial-intelligence/speech-synthesis-recognition'
+ },
+ {
+ text: 'Embedding 与向量检索',
+ link: '/zh-cn/appendix/8-artificial-intelligence/embedding-vector-retrieval'
+ },
+ {
+ text: 'RAG 架构',
+ link: '/zh-cn/appendix/8-artificial-intelligence/rag'
+ },
+ {
+ text: 'AI Agent 与工具调用',
+ link: '/zh-cn/appendix/8-artificial-intelligence/ai-agents'
+ },
+ {
+ text: 'AI 协议(MCP & A2A)',
+ link: '/zh-cn/appendix/8-artificial-intelligence/ai-protocols'
+ },
+ {
+ text: '模型微调与部署',
+ link: '/zh-cn/appendix/8-artificial-intelligence/model-finetuning-deployment'
+ },
+ {
+ text: 'AI 原生应用设计',
+ link: '/zh-cn/appendix/8-artificial-intelligence/ai-native-app-design'
+ },
+ {
+ text: 'AI 能力词典',
+ link: '/zh-cn/appendix/8-artificial-intelligence/ai-capability-dictionary'
+ }
]
},
{
text: '九、工程素养',
collapsed: false,
items: [
- { text: '代码质量与重构', link: '/zh-cn/appendix/9-engineering-excellence/code-quality-refactoring' },
- { text: '测试策略', link: '/zh-cn/appendix/9-engineering-excellence/testing-strategies' },
- { text: '设计模式', link: '/zh-cn/appendix/9-engineering-excellence/design-patterns' },
- { text: '安全思维与攻防基础', link: '/zh-cn/appendix/9-engineering-excellence/security-thinking' },
- { text: '技术文档写作', link: '/zh-cn/appendix/9-engineering-excellence/technical-writing' },
- { text: '开源协作', link: '/zh-cn/appendix/9-engineering-excellence/open-source-collaboration' },
- { text: '技术选型方法论', link: '/zh-cn/appendix/9-engineering-excellence/technology-selection' }
+ {
+ text: '代码质量与重构',
+ link: '/zh-cn/appendix/9-engineering-excellence/code-quality-refactoring'
+ },
+ {
+ text: '测试策略',
+ link: '/zh-cn/appendix/9-engineering-excellence/testing-strategies'
+ },
+ {
+ text: '设计模式',
+ link: '/zh-cn/appendix/9-engineering-excellence/design-patterns'
+ },
+ {
+ text: '安全思维与攻防基础',
+ link: '/zh-cn/appendix/9-engineering-excellence/security-thinking'
+ },
+ {
+ text: '技术文档写作',
+ link: '/zh-cn/appendix/9-engineering-excellence/technical-writing'
+ },
+ {
+ text: '开源协作',
+ link: '/zh-cn/appendix/9-engineering-excellence/open-source-collaboration'
+ },
+ {
+ text: '技术选型方法论',
+ link: '/zh-cn/appendix/9-engineering-excellence/technology-selection'
+ }
]
}
]
diff --git a/docs/.vitepress/theme/components/appendix/api-design/ApiStyleCompare.vue b/docs/.vitepress/theme/components/appendix/api-design/ApiStyleCompare.vue
new file mode 100644
index 0000000..a386aff
--- /dev/null
+++ b/docs/.vitepress/theme/components/appendix/api-design/ApiStyleCompare.vue
@@ -0,0 +1,479 @@
+
+ {{ currentStyle.desc }}{{ currentStyle.name }}
+ {{ currentStyle.badge }}
+
+ {{ currentStyle.example }}单对象 vs 列表
+ {
+ "code": 0,
+ "data": {
+ "id": 123,
+ "name": "张三"
+ }
+}
+ {
+ "code": 0,
+ "data": {
+ "items": [...],
+ "pagination": {
+ "page": 1,
+ "total": 100
+ }
+ }
+}
+ 字段命名规范
+ {{ rule.good }}
+ vs
+ {{ rule.bad }}
+ 时间格式设计
+ {
+ "created_at": "2024-01-15T09:30:00.000Z",
+ "updated_at": "2024-01-15T10:00:00.000Z",
+ "expired_at": "2025-01-15T00:00:00.000Z"
+}
+ 空值处理
+ {
+ "name": "张三",
+ "nickname": null,
+ "avatar": null
+}
+ {
+ "name": "张三"
+}
+ []{}关联数据设计
+
+ {{ currentRelation.code }}参数校验错误
+ {
+ "code": 10001,
+ "message": "参数校验失败",
+ "data": {
+ "errors": [
+ {
+ "field": "email",
+ "message": "邮箱格式不正确",
+ "value": "invalid-email"
+ },
+ {
+ "field": "password",
+ "message": "密码长度至少 8 位",
+ "value": "123"
+ }
+ ]
+ }
+}
+ field
+ 出错字段名,前端可定位表单
+ message
+ 用户友好的错误描述
+ value
+ 客户端提交的值(可选)
+ 业务错误
+ {
+ "code": 20001,
+ "message": "余额不足",
+ "data": {
+ "current_balance": 50.00,
+ "required_amount": 99.00,
+ "shortfall": 49.00,
+ "suggestion": "请充值后重试"
+ }
+}
+ 错误码分层设计
+ HTTP 状态码 vs 业务状态码
+ 常见错误码示例
+ {{ item.code }}
+ {{ item.message }}
+ 为什么要统一响应格式?
+
+// 接口 A
+{ "data": { "user": {...} } }
+
+// 接口 B
+{ "result": { "user": {...} } }
+
+// 接口 C
+{ "user": {...} }
+
+{
+ "code": 0,
+ "message": "success",
+ "data": { ... },
+ "request_id": "req-xxx"
+}
+ 响应字段说明
+ {{ field.name }}
+ {{ field.type }}
+ 必填
+ 业务状态码设计
+ {{ code.code }}
+ {{ code.message }}
+ 不同场景响应示例
+
+ {{ currentExample.code }}分页参数设计
+ page
+ 页码,从 1 开始
+ page_size
+ 每页数量,默认 20
+ sort
+ 排序,如 created_desc
+
+"pagination": {
+ "page": 1,
+ "page_size": 20,
+ "total": 156,
+ "total_pages": 8,
+ "has_next": true
+}
+
最右边一位用,因为没有进位进来
-输入:A、B → 输出:和(S)、进位(C)
-其他位用,因为要加上一位的进位
-输入:A、B、Cin → 输出:和(S)、进位(Cout)
-+ 当前阶段状态:{{ statusMsg }} +
++ 当前选择信号为 {{ muxSel ? '1' : '0' }},因此输出等于 数据 + {{ muxSel ? '1 (D1)' : '0 (D0)' }} 的值:{{ + muxResult ? '1' : '0' + }} +
++ 当前输入为二进制的 {{ decA1 ? '1' : '0' + }}{{ decA0 ? '1' : '0' }} (十进制 {{ decResult }}),因此只有 + Y{{ decResult }} 被激活(输出 1)。 +
+| A | +B | +结果 | +
|---|---|---|
| {{ row[0] }} | +{{ row[1] }} | +{{ row[row.length - 1] }} | +
- 输入 A、B 只能是 0 或 1;四种门按不同规则输出一个 0 或 1。下面表格列出所有 4 种输入组合的结果。 -
- -| A | -B | -AND | -OR | -NOT(A) | -XOR | -
|---|---|---|---|---|---|
| {{ row.a }} | -{{ row.b }} | -{{ row.and }} | -{{ row.or }} | -{{ row.not }} | -{{ row.xor }} | -
- 为啥要看这个?CPU 算到一半要暂时「记住」中间结果,寄存器就是干这个的。它和「直接连线」不同:改输入不会立刻改变里面存的东西,必须主动点一次「写入」才会更新。 -
-- 这些词是啥? - 输入:你想写进去的 0 或 1。 - 写入:点一下,把当前输入「锁进」寄存器。 - 存储值:寄存器里现在记着的数(只有写入时才会变)。 - 输出:从寄存器读出来的数,和存储值一样。 -
-TypeScript 很聪明,它能根据你写的代码自动推断出变量的类型,不需要每次都手动标注。
++ TypeScript + 很聪明,它能根据你写的代码自动推断出变量的类型,不需要每次都手动标注。 +
{{ currentExample.code }}
{{ comparison.withInference }}
{{ comparison.withAnnotation }}