/** * 路由注册管理 */ import { app } from './app.js' import { autoRegisterControllers } from '../../shared/helpers/routeHelper.js' import { resolve } from 'path' import { fileURLToPath } from 'url' import path from 'path' const __dirname = path.dirname(fileURLToPath(import.meta.url)) /** * 注册所有路由 */ export function registerRoutes() { // 自动注册控制器路由 const controllersPath = resolve(__dirname, '../../modules') autoRegisterControllers(app, controllersPath) // 注册共享控制器 const sharedControllersPath = resolve(__dirname, '../../modules/shared/controllers') autoRegisterControllers(app, sharedControllersPath) } export default registerRoutes