<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Wails3 &#43; Go &#43; AI 实战课程 on Go Home</title>
    <link>https://blog.911015.com/wails3/</link>
    <description>Recent content in Wails3 &#43; Go &#43; AI 实战课程 on Go Home</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <atom:link href="https://blog.911015.com/wails3/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>课程导学</title>
      <link>https://blog.911015.com/wails3/00.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/00.html</guid>
      <description>00 - 课程导学 学完这门课，你能做什么？ 完成全部 8 个章节后，你将拥有：&#xA;一个 完整的桌面端 AI 应用（可分发为 .exe / .dmg / .AppImage） 一套 可复用的 Go 服务架构 模板（配置管理 → AI 调用 → API 集成 → 文档生成 → 编排） 对 Wails3 框架 的深入理解（绑定机制、服务注册、跨平台打包） 将 大模型嵌入桌面产品 的实战经验 更重要的是，这套模式可以快速迁移到任何内容创作场景 — 把&amp;quot;宠物&amp;quot;换成&amp;quot;科技&amp;quot;&amp;ldquo;美食&amp;quot;&amp;ldquo;旅游&amp;rdquo;，把 DeepSeek 换成 OpenAI / 文心一言 / 通义千问，把 Pexels 换成 Unsplash / 自有图库，核心架构不变。&#xA;我们做什么？ pet-content-creator — 今日头条宠物内容创作工具。&#xA;一句话描述：&#xA;输入主题 → AI 自动写文章 + 搜配图 → 一键导出图文并茂的 Word 文档&#xA;工作流程：&#xA;用户输入: 主题 + 宠物类型 + 写作风格 + 字数 + 配图数 ↓ ┌────────────────────────────┐ │ 1.</description>
    </item>
    <item>
      <title>环境搭建与Wails3初体验</title>
      <link>https://blog.911015.com/wails3/01.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/01.html</guid>
      <description>01 - 环境搭建与 Wails3 初体验 本章目标 安装 Go 1.25+ 和 Node.js 18+ 安装 Wails3 CLI 理解 Wails3 项目结构 跑通第一个 Wails3 桌面窗口 了解开发模式的热重载机制 1.1 安装 Go Windows 去 go.dev/dl 下载 .msi 安装包，双击安装即可。&#xA;安装完成后打开终端验证：&#xA;go version # go version go1.25.0 windows/amd64 macOS brew install go Linux # 下载最新版本 wget https://go.dev/dl/go1.25.0.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.25.0.linux-amd64.tar.gz # 添加到 PATH (写入 ~/.bashrc 或 ~/.zshrc) export PATH=$PATH:/usr/local/go/bin 配置 Go 代理（国内推荐） go env -w GOPROXY=https://goproxy.cn,direct go env -w GOPRIVATE=git.</description>
    </item>
    <item>
      <title>配置管理与Go服务架构</title>
      <link>https://blog.911015.com/wails3/02.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/02.html</guid>
      <description>02 - 配置管理与 Go 服务架构 本章目标 设计一个可持久化的配置系统 用 Go struct + JSON 管理 API Key 实现 API Key 的脱敏策略 理解 Wails3 的 Service 注册机制 将 ConfigService 注册到 Wails 应用 2.1 配置设计 我们的应用需要三个配置项：&#xA;配置项 用途 敏感度 deepseek_api_key DeepSeek 大模型 API Key 🔴 敏感 deepseek_model 模型名称（如 deepseek-chat） 🟢 公开 pexels_api_key Pexels 图片搜索 API Key 🔴 敏感 配置文件存储在用户目录下的隐藏文件夹：&#xA;Windows: C:\Users\&amp;lt;用户名&amp;gt;\.pet-content-creator\config.json macOS: /Users/&amp;lt;用户名&amp;gt;/.pet-content-creator/config.json Linux: /home/&amp;lt;用户名&amp;gt;/.pet-content-creator/config.json 2.2 Go Struct 定义 创建 backend/config.go：&#xA;package backend // Config 应用配置 type Config struct { DeepSeekAPIKey string `json:&amp;#34;deepseek_api_key&amp;#34;` DeepSeekModel string `json:&amp;#34;deepseek_model&amp;#34;` PexelsAPIKey string `json:&amp;#34;pexels_api_key&amp;#34;` } 💡 知识点： json:&amp;quot;deepseek_api_key&amp;quot; 是 Go 的 struct tag。encoding/json 包会读取这些 tag 来决定 JSON 字段名。如果不写 tag，Go 默认使用大写开头的字段名。</description>
    </item>
    <item>
      <title>AI文章生成 - Eino集成DeepSeek</title>
      <link>https://blog.911015.com/wails3/03.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/03.html</guid>
      <description>03 - AI 文章生成 — Eino 集成 DeepSeek 本章目标 了解 CloudWeGo Eino 框架的核心抽象 创建 DeepSeek ChatModel 并调用 设计 System Prompt 模板 解析 AI 返回的文章内容（标题 + 标签提取） 将 AgentService 注册为 Wails Service 3.1 为什么选择 Eino 在 Go 生态中调用大模型，你有几种选择：&#xA;方案 优点 缺点 直接 HTTP 调用 OpenAI 兼容 API 简单直接 需要自己处理重试、流式、上下文管理 使用模型官方 SDK 功能完整 锁定模型供应商 CloudWeGo Eino 统一抽象，可切换模型 学习曲线稍高 Eino 是字节跳动开源的 AI 应用开发框架。它的 ChatModel 接口统一了不同大模型的调用方式：&#xA;// Eino 的 ChatModel 接口（简化版） type BaseChatModel interface { Generate(ctx context.</description>
    </item>
    <item>
      <title>免费图库集成 - Pexels API实战</title>
      <link>https://blog.911015.com/wails3/04.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/04.html</guid>
      <description>04 - 免费图库集成 — Pexels API 实战 本章目标 注册 Pexels API 并获取免费 Key 用 Go 的 net/http 调用 REST API JSON 反序列化处理 API 响应 下载图片并限制文件大小 将 PexelsService 注册为 Wails Service 4.1 Pexels API 简介 Pexels 是全球最大的免费图库之一，提供高质量的照片和视频。它的 API 对开发者非常友好：&#xA;免费 — 无需信用卡，注册即用 速率限制 — 每月 200 次请求（免费版），开发测试完全够用 高质量 — 照片均由专业摄影师上传 无需署名 — 虽然建议署名，但不强制 注册获取 API Key 访问 pexels.com/api 点击「Join Pexels」注册账号 登录后到 pexels.com/api/new 创建应用 复制生成的 API Key（格式类似：AbCDeFgHiJkLmNoPqRsTuVwXyZ123456） 4.2 API 接口分析 搜索图片 GET https://api.</description>
    </item>
    <item>
      <title>纯Go生成Word文档 - OOXML探秘</title>
      <link>https://blog.911015.com/wails3/05.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/05.html</guid>
      <description>05 - 纯 Go 生成 Word 文档 — OOXML 探秘 本章目标 理解 OOXML（Office Open XML）的文件格式 用 Go 标准库 archive/zip 构建 docx 文件 手工编写 Word 所需的 XML 文件 将图片嵌入 Word 文档 不依赖任何第三方库，纯 Go 标准库实现 5.1 OOXML 是什么？ 很多人以为 Word 的 .docx 文件是一个神秘的二进制格式，实际上它是一个 ZIP 压缩包。&#xA;验证一下 找一个 .docx 文件，改后缀为 .zip，然后解压：&#xA;cp my-document.docx my-document.zip unzip my-document.zip -d docx-contents/ tree docx-contents/ 你会看到：&#xA;docx-contents/ ├── [Content_Types].xml ├── _rels/ │ └── .rels └── word/ ├── document.xml ← 文档内容 ├── styles.</description>
    </item>
    <item>
      <title>前后端桥接 - Wails绑定与React UI</title>
      <link>https://blog.911015.com/wails3/06.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/06.html</guid>
      <description>06 - 前后端桥接 — Wails 绑定与 React UI 本章目标 理解 Wails3 自动生成 TypeScript 绑定的机制 完成 React 前端 UI 的完整开发 实现配置面板、输入表单、结果展示三大模块 掌握前后端数据交互的错误处理模式 管理应用的三种状态：闲置 → 创作中 → 完成 6.1 Wails3 绑定机制回顾 当你运行 wails3 dev 后，Wails3 会自动扫描 Services 中注册的 Go struct，提取所有公开方法，并在 frontend/bindings/ 下生成 TypeScript 绑定文件。&#xA;绑定生成规则 Go 方法 生成的 TS 方法 func (cs *ConfigService) GetConfig() (*Config, error) ConfigService.GetConfig(): Promise&amp;lt;Config | null&amp;gt; func (cs *ConfigService) SaveConfig(cfg *Config) error ConfigService.SaveConfig(cfg: Config): Promise&amp;lt;void&amp;gt; func (as *AgentService) GenerateArticle(ctx context.</description>
    </item>
    <item>
      <title>编排服务 - 串联完整创作流水线</title>
      <link>https://blog.911015.com/wails3/07.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/07.html</guid>
      <description>07 - 编排服务 — 串联完整创作流水线 本章目标 用编排模式串联 3 个独立服务 实现&amp;quot;一键生成&amp;quot;的端到端流程 多关键词搜图 + 去重 错误隔离：局部失败不中断整体流程 注册 CreatorService 为前端唯一调用入口 7.1 为什么需要编排层？ 回顾一下我们已有的 3 个服务：&#xA;AgentService → AI 生成文章 + 提取关键词 PexelsService → 搜索图片 + 下载图片 WordService → 生成 docx 文件 如果让前端直接调用这 3 个服务，前端需要：&#xA;调用 AgentService → 拿到文章和关键词 遍历关键词 → 逐个调用 PexelsService 收集图片 → 调用 WordService 处理每个步骤的错误 这会导致前端代码变得复杂、状态管理困难、且难以复用。&#xA;📌 关键概念： 编排模式（Orchestration Pattern）将多个独立服务的调用序列封装在一个编排器中，对外暴露一个简洁的接口。前端只需要调用 CreatorService.Create()，后端负责协调所有步骤。&#xA;7.2 创建 CreatorService 创建 backend/creator.go：&#xA;package backend import ( &amp;#34;context&amp;#34; &amp;#34;fmt&amp;#34; &amp;#34;log&amp;#34; ) 请求与响应 // CreateRequest 创作请求（前端传入） type CreateRequest struct { Topic string `json:&amp;#34;topic&amp;#34;` PetType string `json:&amp;#34;pet_type&amp;#34;` Style string `json:&amp;#34;style&amp;#34;` Keywords string `json:&amp;#34;keywords&amp;#34;` WordCount int `json:&amp;#34;word_count&amp;#34;` ImageCount int `json:&amp;#34;image_count&amp;#34;` } // CreateResponse 创作响应 type CreateResponse struct { Title string `json:&amp;#34;title&amp;#34;` Content string `json:&amp;#34;content&amp;#34;` Photos []PexelsPhoto `json:&amp;#34;photos&amp;#34;` WordPath string `json:&amp;#34;word_path&amp;#34;` Error string `json:&amp;#34;error,omitempty&amp;#34;` } 💡 知识点： CreateResponse 中的 Error 字段用了 string 而非 Go error。因为 Go 的 error 接口无法通过 Wails 序列化到前端。当流程中有非致命错误时，我们通过这个字段告知前端。</description>
    </item>
    <item>
      <title>打包分发与扩展方向</title>
      <link>https://blog.911015.com/wails3/08.html</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://blog.911015.com/wails3/08.html</guid>
      <description>08 - 打包分发与扩展方向 本章目标 将应用打包为可分发的安装包 跨平台构建（Windows / macOS / Linux） Docker Server 模式部署 了解应用图标替换与版本管理 探索项目的 6 个扩展方向 8.1 生产构建 桌面应用构建 # 当前平台构建 wails3 build # 指定平台构建 wails3 build -platform windows/amd64 wails3 build -platform darwin/amd64 wails3 build -platform linux/amd64 构建产物：&#xA;build/ ├── bin/ │ └── pet-content-creator.exe (Windows) │ └── pet-content-creator (macOS / Linux) └── ... 构建优化标志 # 减小二进制体积 wails3 build -ldflags &amp;#34;-s -w&amp;#34; # -s 去除符号表 # -w 去除 DWARF 调试信息 加上这两个标志后，二进制文件体积通常可以减小 30-40%。</description>
    </item>
  </channel>
</rss>
