[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"public-theme-runtime":3,"navigation-bootstrap":38,"public-module-runtime":154,"posts-list-page":175},{"success":4,"data":5,"message":37,"globalStats":-1},true,{"slug":6,"name":7,"version":8,"source":9,"inheritanceChain":10,"layouts":11,"slots":17,"configKeys":32,"assets":34,"config":36},"default","Default Theme","1.0.0","builtin",[6],[12,13,14,15,16],"home","post-list","post-detail","tool-index","user-dashboard",[18,19,20,21,22,23,24,25,26,27,28,29,30,31],"layout.sidebar","layout.mobile-tabbar","home.hero","home.game-strip","home.featured-columns","home.trending-posts","home.trending-tags","post.author","post.body","post.related","post.comments","post.sidebar","tools.hero","user.summary",[33],"theme:default",{"stylesheets":35},[],{},"操作成功",{"navigation":39,"categories":95},{"main":40,"utility":64,"mobile":71,"mobileConfigured":4},[41,49,54,59],{"id":42,"name":43,"path":44,"icon":45,"color":46,"group":47,"target":48,"isVisible":4,"moduleSlug":46},1,"首页","\u002F","i-carbon-home","","MAIN","_self",{"id":50,"name":51,"path":52,"icon":53,"color":46,"group":47,"target":48,"isVisible":4,"moduleSlug":46},2,"文章列表","\u002Fposts","i-carbon-document",{"id":55,"name":56,"path":57,"icon":58,"color":46,"group":47,"target":48,"isVisible":4,"moduleSlug":46},4,"标签云","\u002Ftags","i-carbon-tag",{"id":60,"name":61,"path":62,"icon":63,"color":46,"group":47,"target":48,"isVisible":4,"moduleSlug":46},5,"关于我们","\u002Fabout","i-carbon-information",[65],{"id":66,"name":67,"path":68,"icon":69,"color":46,"group":70,"target":48,"isVisible":4,"moduleSlug":46},6,"Mj·工具箱","\u002Ftools","i-carbon-tool-box","UTILITY",[72,76,81,84,89],{"id":73,"name":74,"path":52,"icon":53,"color":46,"group":75,"target":48,"isVisible":4,"moduleSlug":46},27,"文章","MOBILE",{"id":77,"name":78,"path":79,"icon":80,"color":46,"group":75,"target":48,"isVisible":4,"moduleSlug":46},28,"游戏","\u002Fgames","i-carbon-game-console",{"id":82,"name":43,"path":44,"icon":45,"color":83,"group":75,"target":48,"isVisible":4,"moduleSlug":46},16,"#4f46e5",{"id":85,"name":86,"path":68,"icon":87,"color":88,"group":75,"target":48,"isVisible":4,"moduleSlug":46},18,"工具","i-carbon-tool-kit","#06b6d4",{"id":90,"name":91,"path":92,"icon":93,"color":94,"group":75,"target":48,"isVisible":4,"moduleSlug":46},22,"我的","\u002Fuser","i-carbon-user","#0f172a",[96,106,113,119,124,132,140,147],{"id":42,"name":97,"slug":98,"parentId":99,"sort":42,"createdAt":100,"description":101,"icon":102,"updatedAt":100,"type":103,"isVisible":4,"_count":104,"postCount":105},"技术文章","tech",null,"2026-03-31T13:24:10.236Z","技术相关文章分享","i-carbon-code","ARTICLE",{"posts":105},3,{"id":50,"name":107,"slug":108,"parentId":99,"sort":50,"createdAt":100,"description":109,"icon":110,"updatedAt":100,"type":103,"isVisible":4,"_count":111,"postCount":112},"生活随笔","life","生活感悟与随笔","i-carbon-cafe",{"posts":112},0,{"id":105,"name":114,"slug":115,"parentId":99,"sort":105,"createdAt":100,"description":116,"icon":117,"updatedAt":100,"type":103,"isVisible":4,"_count":118,"postCount":112},"资源分享","resources","实用资源下载分享","i-carbon-download",{"posts":112},{"id":55,"name":120,"slug":121,"parentId":99,"sort":55,"createdAt":100,"description":122,"icon":80,"updatedAt":100,"type":103,"isVisible":4,"_count":123,"postCount":105},"游戏专题","games","游戏相关内容",{"posts":105},{"id":125,"name":126,"slug":127,"parentId":99,"sort":60,"createdAt":128,"description":46,"icon":129,"updatedAt":130,"type":103,"isVisible":4,"_count":131,"postCount":42},7,"AI文章","a-i-ji-shu","2026-06-08T18:53:52.493Z","i-carbon-thumbnail-1","2026-06-08T18:57:08.371Z",{"posts":42},{"id":66,"name":133,"slug":134,"parentId":42,"sort":135,"createdAt":136,"description":46,"icon":137,"updatedAt":138,"type":103,"isVisible":4,"_count":139,"postCount":50},"前端技术","Front-end-technology",10,"2026-04-27T15:35:13.787Z","i-carbon-laptop","2026-04-27T15:35:27.999Z",{"posts":50},{"id":141,"name":142,"slug":143,"parentId":125,"sort":135,"createdAt":144,"description":46,"icon":145,"updatedAt":144,"type":103,"isVisible":4,"_count":146,"postCount":42},8,"AI模型技术","a-i-mo-xing-ji-shu","2026-06-08T18:54:32.060Z","i-carbon-ai-agent-invocation",{"posts":42},{"id":60,"name":148,"slug":149,"parentId":42,"sort":135,"createdAt":150,"description":151,"icon":152,"updatedAt":150,"type":103,"isVisible":4,"_count":153,"postCount":42},"后端技术","Back-end-technology","2026-04-27T11:46:35.299Z","后端开发技术分享","i-carbon-bookmark",{"posts":42},{"success":4,"data":155,"message":37,"globalStats":-1},[156,162,167,171],{"slug":157,"name":158,"version":8,"frontendEntryPath":159,"loadable":160,"enabled":4,"installed":4,"dependenciesResolved":4,"status":161},"ai-keywords","AI关键词库","\u002Fai-keywords",false,"enabled",{"slug":163,"name":164,"version":165,"frontendEntryPath":79,"loadable":160,"enabled":160,"installed":4,"dependenciesResolved":4,"status":166},"game","游戏模块","1.0.1","disabled",{"slug":168,"name":169,"version":8,"frontendEntryPath":170,"loadable":160,"enabled":4,"installed":4,"dependenciesResolved":4,"status":161},"software","软件中心","\u002Fsoftware",{"slug":172,"name":173,"version":174,"frontendEntryPath":68,"loadable":160,"enabled":4,"installed":4,"dependenciesResolved":4,"status":161},"tools","工具箱模块","1.0.2",{"success":4,"data":176,"message":37,"globalStats":-1},{"list":177,"total":50,"stats":219,"page":42,"pageSize":221},[178,201],{"id":179,"title":180,"slug":181,"cover":46,"summary":46,"content":182,"contentFormat":183,"views":184,"likes":112,"status":185,"reviewStatus":186,"reviewRemark":99,"reviewSubmittedAt":99,"reviewedAt":187,"isTop":160,"isRecommend":160,"isVipFree":160,"publishedAt":99,"createdAt":188,"authorId":42,"categoryId":66,"category":189,"author":190,"resourceCount":112,"_count":194,"tags":195,"meta":200},9,"Flutter 完美切换国内镜像源（终极稳定方案，解决所有下载404\u002F超时\u002F引擎缺失）","f-l-u-t-t-e-r-wan-mei-qie-huan-guo-nei-jing-xiang-yuan-zhong-ji-wen-ding-fang-an-jie-jue-suo-you-xia-zai-4-0-4-chao-shi-yin-qing-que-shi","\u003Ch2>一、前言（必看，解决你所有报错根源）\u003C\u002Fh2>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>清华 Flutter 镜像已不再推荐\u003C\u002Fstrong>：同步滞后、引擎包经常404、新版本缺失，你的报错全部源于此。\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>目前国内 \u003Cstrong>最稳定、官方认可、同步最全\u003C\u002Fstrong> 的镜像：\u003Cstrong>Flutter 社区官方镜像（flutter-io.cn）\u003C\u002Fstrong>\u003C\u002Fp>\n\u003C\u002Fli>\n\u003Cli>\u003Cp>切换后可解决：\u003C\u002Fp>\n\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cul>\n\u003Cli>flutter upgrade 404 下载失败\u003C\u002Fli>\n\u003Cli>flutter run 引擎 jar 包找不到\u003C\u002Fli>\n\u003Cli>Gradle 编译缺失 debug 引擎文件\u003C\u002Fli>\n\u003Cli>pub get 超时、下载失败\u003C\u002Fli>\n\u003Cli>Dart SDK 下载失败、重试报错\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>二、核心镜像地址（永久固定）\u003C\u002Fh2>\n\u003Cp>\u003Cstrong>只使用这两组，放弃所有清华源\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Flutter 存储源（引擎\u002FSDK\u002F资源）：\u003Ccode>https:\u002F\u002Fstorage.flutter-io.cn\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cp>Pub 包管理源（第三方依赖）：\u003Ccode>https:\u002F\u002Fpub.flutter-io.cn\u003C\u002Fcode>\u003C\u002Fp>\n\u003Ch2>三、Windows 系统配置教程（你的系统）\u003C\u002Fh2>\n\u003Ch3>步骤1：删除旧的错误镜像（关键！）\u003C\u002Fh3>\n\u003Cp>很多人报错是因为残留清华镜像，先彻底清空。\u003C\u002Fp>\n\u003Cp>打开 \u003Cstrong>系统属性 → 高级 → 环境变量\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>在「用户变量」和「系统变量」中，删除以下变量（如果存在）：\u003C\u002Fp>\n\u003Cul>\n\u003Cli>FLUTTER_STORAGE_BASE_URL\u003C\u002Fli>\n\u003Cli>PUB_HOSTED_URL\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3>步骤2：配置稳定国内源\u003C\u002Fh3>\n\u003Cp>新建两个 \u003Cstrong>用户环境变量\u003C\u002Fstrong>：\u003C\u002Fp>\n\u003Cp>变量1：\u003C\u002Fp>\n\u003Cp>\u003Cstrong>变量名\u003C\u002Fstrong>：FLUTTER_STORAGE_BASE_URL\u003C\u002Fp>\n\u003Cp>\u003Cstrong>变量值\u003C\u002Fstrong>：\u003Ca href=\"https:\u002F\u002Fstorage.flutter-io.cn\">https:\u002F\u002Fstorage.flutter-io.cn\u003C\u002Fa>\u003C\u002Fp>\n\u003Cp>变量2：\u003C\u002Fp>\n\u003Cp>\u003Cstrong>变量名\u003C\u002Fstrong>：PUB_HOSTED_URL\u003C\u002Fp>\n\u003Cp>\u003Cstrong>变量值\u003C\u002Fstrong>：\u003Ca href=\"https:\u002F\u002Fpub.flutter-io.cn\">https:\u002F\u002Fpub.flutter-io.cn\u003C\u002Fa>\u003C\u002Fp>\n\u003Ch3>步骤3：重启终端生效\u003C\u002Fh3>\n\u003Cp>关闭所有 PowerShell、CMD、VS Code 终端，重新打开。\u003C\u002Fp>\n\u003Ch2>四、临时切换\u002F还原官方源命令（应急必备）\u003C\u002Fh2>\n\u003Ch3>1. 临时切回【官方源】（用于升级 Flutter 解决404）\u003C\u002Fh3>\n\u003Cp>每次升级前执行，避免镜像同步问题：\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-powershell\">$env:PUB_HOSTED_URL=&quot;&quot;\n$env:FLUTTER_STORAGE_BASE_URL=&quot;&quot;\nflutter upgrade\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>2. 临时切回【国内源】（日常开发用）\u003C\u002Fh3>\n\u003Cpre>\u003Ccode class=\"language-powershell\">$env:PUB_HOSTED_URL=&quot;https:\u002F\u002Fpub.flutter-io.cn&quot;\n$env:FLUTTER_STORAGE_BASE_URL=&quot;https:\u002F\u002Fstorage.flutter-io.cn&quot;\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>五、Android Gradle 镜像修复（解决你 jar 包缺失报错）\u003C\u002Fh2>\n\u003Cp>这是你当前 \u003Cstrong>checkDebugDuplicateClasses 报错\u003C\u002Fstrong> 的终极修复，必须配置。\u003C\u002Fp>\n\u003Cp>打开项目 \u003Ccode>android\u002Fbuild.gradle\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cp>找到\u003Ccode>allprojects &gt; repositories\u003C\u002Fcode>，替换为以下内容：\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-gradle\">allprojects {\n    repositories {\n        \u002F\u002F 优先本地缓存，彻底解决引擎jar找不到\n        maven { url &quot;${System.env.FLUTTER_SDK}\u002Fbin\u002Fcache\u002Fartifacts\u002Fengine\u002Fandroid&quot; }\n        \u002F\u002F 官方国内镜像（稳定）\n        maven { url &#39;https:\u002F\u002Fstorage.flutter-io.cn\u002Fdownload.flutter.io&#39; }\n        google()\n        mavenCentral()\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>六、验证镜像是否配置成功\u003C\u002Fh2>\n\u003Cp>终端执行：\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-powershell\">flutter doctor -v\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>看到如下字段即成功：\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-Plain\">Flutter assets will be downloaded from https:\u002F\u002Fstorage.flutter-io.cn\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>七、全套修复收尾命令（配置完必执行）\u003C\u002Fh2>\n\u003Cp>进入你的项目目录，执行全套清理修复：\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-powershell\">flutter clean\nflutter pub cache clean\nflutter pub get\nflutter run\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2>八、避坑总结（重点）\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>禁止再使用清华 Flutter 镜像\u003C\u002Fstrong>：同步不全、新版本必404\u003C\u002Fli>\n\u003Cli>升级 Flutter 优先切官方源，日常开发用国内源\u003C\u002Fli>\n\u003Cli>Gradle 必须配置 Flutter 国内 Maven 地址，否则编译必报错\u003C\u002Fli>\n\u003Cli>环境变量修改后必须重启终端，否则不生效\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2>九、Mac\u002FLinux 快速配置（附赠）\u003C\u002Fh2>\n\u003Cp>编辑 ~\u002F.bashrc 或 ~\u002F.zshrc：\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-shell\">export PUB_HOSTED_URL=https:\u002F\u002Fpub.flutter-io.cn\nexport FLUTTER_STORAGE_BASE_URL=https:\u002F\u002Fstorage.flutter-io.cn\n\u003C\u002Fcode>\u003C\u002Fpre>\n","markdown",61,"published","APPROVED","2026-05-24T10:01:34.823Z","2026-05-24T10:01:34.826Z",{"id":66,"name":133},{"id":42,"username":191,"nickname":192,"avatar":99,"gender":193},"admin","小米酒","MALE",{"comments":112,"resources":112},[196],{"name":197,"slug":198,"color":199},"Flutter","f-l-u-t-t-e-r","#6366f1",{},{"id":141,"title":202,"slug":203,"cover":204,"summary":205,"content":206,"contentFormat":183,"views":207,"likes":112,"status":185,"reviewStatus":186,"reviewRemark":99,"reviewSubmittedAt":99,"reviewedAt":208,"isTop":160,"isRecommend":160,"isVipFree":160,"publishedAt":99,"createdAt":209,"authorId":42,"categoryId":66,"category":210,"author":211,"resourceCount":112,"_count":212,"tags":213,"meta":218},"Node.js 注释规范模板（AI 可用标准版）","n-o-d-e-j-s-zhu-shi-gui-fan-mu-ban-a-i-ke-yong-biao-zhun-ban","https:\u002F\u002Fmjblog.res.ziyowl.com\u002F2026\u002F04\u002F27\u002F1777304019183-9pchqeze.jpg","在 Node.js 项目开发中，清晰规范的注释不仅能够提升代码可读性，还能有效降低团队协作和维护成本。本文提供了一套完整的 Node.js 注释规范模板，涵盖文件头、类\u002F模块、函数\u002F方法、行内注释、TODO\u002FFIXME 等各类场景，并严格遵循 JSDoc 标准，支持异步函数和回调函数的规范化注释。通过统一风格、分层注释与工具辅助检查，这套规范不仅便于开发者理解代码逻辑，还能让 AI 辅助生成代码时自动遵循标准，提高开发效率与团队协作质量。","\u003Ch2>\u003Cstrong>一、总原则\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Col>\n\u003Cli>\u003Cstrong>清晰简洁\u003C\u002Fstrong>\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cul>\n\u003Cli>注释说明“为什么”和“做什么”，避免解释“怎么做”。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Col>\n\u003Cli>\u003Cstrong>统一风格\u003C\u002Fstrong>\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cul>\n\u003Cli>团队统一中文或英文。\u003C\u002Fli>\n\u003Cli>行内注释与代码间空一格。\u003C\u002Fli>\n\u003Cli>注释首字母大写。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Col>\n\u003Cli>\u003Cstrong>分层注释\u003C\u002Fstrong>\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cul>\n\u003Cli>文件头 → 模块\u002F类 → 函数\u002F方法 → 关键逻辑行内 → TODO\u002FFIXME\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Col>\n\u003Cli>\u003Cstrong>工具辅助\u003C\u002Fstrong>\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cul>\n\u003Cli>推荐 ESLint + \u003Ccode>eslint-plugin-jsdoc\u003C\u002Fcode>，强制函数必须有 JSDoc 注释。\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>二、文件头模板（File Header）\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>\u002F**\n * @file 文件名.js\n * @description 文件功能简介\n * @author 作者名\n * @date YYYY-MM-DD\n * @version 版本号\n * @license 许可信息（可选）\n *\u002F\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>示例：\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F**\n * @file userController.js\n * @description 用户模块控制器，处理注册、登录及信息管理\n * @author ZhangYaLong\n * @date 2026-03-29\n * @version 1.0.0\n *\u002F\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>三、类\u002F模块注释模板（Class\u002FModule）\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>\u002F**\n * 类名\u002F模块名\n * 功能描述\n * 注意事项或使用说明\n *\u002F\nclass ClassName {}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>示例：\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F**\n * UserService 类\n * 提供用户增删改查及认证功能\n * 注意：所有方法均异步执行\n *\u002F\nclass UserService {}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>四、函数\u002F方法注释模板（JSDoc 标准）\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>\u002F**\n * 功能描述\n * @async (可选，异步函数)\n * @param {类型} 参数名 - 参数说明\n * @param {类型} 参数名.prop - 对象属性说明\n * @returns {类型} 返回值说明\n * @throws {Error} 异常说明\n * @deprecated (可选，废弃方法)\n * @example (可选，使用示例)\n *\u002F\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>示例：\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F**\n * 根据用户ID获取用户信息\n * @async\n * @param {number} userId - 用户ID\n * @returns {Promise&lt;Object&gt;} 用户信息对象\n * @throws {Error} 当用户不存在时抛出异常\n * @example\n * const user = await getUserById(123);\n *\u002F\nasync function getUserById(userId) {}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>五、行内注释规范（Inline Comment）\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Col>\n\u003Cli>仅在关键逻辑或复杂算法处使用。\u003C\u002Fli>\n\u003Cli>单行注释使用 \u003Ccode>\u002F\u002F\u003C\u002Fcode>，多行注释使用 \u003Ccode>\u002F* ... *\u002F\u003C\u002Fcode>。\u003C\u002Fli>\n\u003Cli>注释与代码间空一格。\u003C\u002Fli>\n\u003Cli>避免注释显而易见的代码。\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>\u003Cstrong>示例：\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F\u002F 将日期格式化为 YYYY-MM-DD\nconst formattedDate = date.toISOString().slice(0, 10);\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>六、TODO \u002F FIXME 注释规范\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>\u002F\u002F TODO: 待实现的功能描述\n\u002F\u002F FIXME: 待修复的问题描述\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cstrong>示例：\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cpre>\u003Ccode>\u002F\u002F TODO: 用户登录失败超过5次应锁定账户\n\u002F\u002F FIXME: 密码加密逻辑性能低，需要优化\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>七、异步函数 \u002F 回调函数模板\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>\u002F**\n * 异步操作示例\n * @async\n * @param {Function} callback - 回调函数\n * @returns {Promise&lt;void&gt;}\n *\u002F\nexport async function doAsyncTask(callback) {\n    try {\n        const result = await someAsyncOperation();\n        callback(null, result);\n    } catch (err) {\n        callback(err);\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>八、Controller \u002F Service \u002F Model 模板（AI 可直接套用）\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Ch3>\u003Cstrong>Controller 模板\u003C\u002Fstrong>\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>\u002F**\n * @file 模块名Controller.js\n * @description 控制器，处理接口请求逻辑\n * @author 作者名\n * @date YYYY-MM-DD\n * @version 1.0.0\n *\u002F\nimport { ModuleService } from &#39;..\u002Fservice\u002FmoduleService.js&#39;;\n​\nexport class ModuleController {\n    constructor() {\n        this.service = new ModuleService();\n    }\n​\n    \u002F**\n     * 示例接口方法\n     * @async\n     * @param {Object} ctx - 请求上下文\n     * @returns {Promise&lt;void&gt;}\n     *\u002F\n    async exampleMethod(ctx) {\n        try {\n            const data = await this.service.exampleService();\n            ctx.body = { success: true, data };\n        } catch (err) {\n            ctx.status = 400;\n            ctx.body = { success: false, message: err.message };\n        }\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>\u003Cstrong>Service 模板\u003C\u002Fstrong>\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>\u002F**\n * @file moduleService.js\n * @description 服务层，处理业务逻辑\n * @author 作者名\n * @date YYYY-MM-DD\n * @version 1.0.0\n *\u002F\nexport class ModuleService {\n    \u002F**\n     * 示例业务方法\n     * @async\n     * @returns {Promise&lt;Object&gt;} 返回结果\n     *\u002F\n    async exampleService() {\n        \u002F\u002F TODO: 实现业务逻辑\n        return { message: &#39;示例数据&#39; };\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>\u003Cstrong>Model 模板\u003C\u002Fstrong>\u003C\u002Fh3>\n\u003Cpre>\u003Ccode>\u002F**\n * @file moduleModel.js\n * @description 数据模型层，封装数据库操作\n *\u002F\nexport class ModuleModel {\n    \u002F**\n     * 根据 ID 查询数据\n     * @param {number} id - 数据ID\n     * @returns {Promise&lt;Object|null&gt;} 数据对象或 null\n     *\u002F\n    static async findById(id) {\n        \u002F\u002F TODO: 数据库查询逻辑\n        return null;\n    }\n​\n    \u002F**\n     * 创建数据\n     * @param {Object} data - 数据对象\n     * @returns {Promise&lt;Object&gt;} 创建成功对象\n     *\u002F\n    static async create(data) {\n        \u002F\u002F TODO: 数据库写入逻辑\n        return data;\n    }\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch2>\u003Cstrong>九、工具函数模板（Utils）\u003C\u002Fstrong>\u003C\u002Fh2>\n\u003Cpre>\u003Ccode>\u002F**\n * @file utils.js\n * @description 工具函数集合\n *\u002F\n​\n\u002F**\n * 格式化日期为 YYYY-MM-DD\n * @param {Date|string} date - 日期对象或字符串\n * @returns {string} 格式化后日期\n *\u002F\nexport function formatDate(date) {\n    const d = date instanceof Date ? date : new Date(date);\n    return d.toISOString().slice(0, 10);\n}\n​\n\u002F**\n * 获取当前时间戳（秒）\n * @returns {number} 当前时间戳\n *\u002F\nexport function nowTimestamp() {\n    return Math.floor(Date.now() \u002F 1000);\n}\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Chr \u002F>\n\u003Ch3>\u003Cstrong>✅ 使用方法\u003C\u002Fstrong>\u003C\u002Fh3>\n\u003Col>\n\u003Cli>AI 自动生成代码时：\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cul>\n\u003Cli>文件头模板 → 自动写入文件名\u002F作者\u002F日期\u003C\u002Fli>\n\u003Cli>类\u002F函数模板 → 套用 JSDoc 标准\u003C\u002Fli>\n\u003Cli>行内注释 → AI 生成关键逻辑时自动生成\u003C\u002Fli>\n\u003Cli>TODO\u002FFIXME → 标记 AI 未实现部分\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Col>\n\u003Cli>ESLint + \u003Ccode>eslint-plugin-jsdoc\u003C\u002Fcode> 可辅助检查规范\u003C\u002Fli>\n\u003Cli>所有模块可直接复制粘贴使用\u003C\u002Fli>\n\u003C\u002Fol>\n",75,"2026-04-27T15:35:50.431Z","2026-04-27T15:29:27.606Z",{"id":66,"name":133},{"id":42,"username":191,"nickname":192,"avatar":99,"gender":193},{"comments":112,"resources":112},[214],{"name":215,"slug":216,"color":217},"TypeScript","typescript","#3178c6",{},{"total":141,"published":141,"draft":112,"totalViews":220},348,12]