/**
 * Framework.init 的 beforeInitApi：在 _setupRoutes 之前注册手动路由（规范见 .cursor/rules/node-core-framework.mdc）
 */
module.exports = async function beforeInitApi(framework) {
  const { buildProxyRoutes } = require("../api/controller_custom/proxy_api");
  const proxy_routes = buildProxyRoutes();
  const n = Object.keys(proxy_routes).length;
  framework.addRoutes("", proxy_routes);
  framework.addRoutes("/api", proxy_routes);
  console.log(`📡 已注册 ${n} 个转发接口（文档路径 + /api 前缀各一套）`);
};
