const modules = [ { key: 'dashboard', title: '仪表盘', ops: [ { id: 'dashboard', name: '统计', method: 'GET', path: '/api/prompt/dashboard', fields: [] }, { id: 'running', name: '进行中任务', method: 'GET', path: '/api/prompt/tasks', fields: [ { key: 'status', label: '状态(1)', type: 'number', in: 'query', default: 1 }, { key: 'page_size', label: '每页数量', type: 'number', in: 'query', default: 5 } ] } ] }, { key: 'robots', title: '机器人管理', ops: [ { id: 'robots-list', name: '机器人列表', method: 'GET', path: '/api/prompt/robots', fields: [] }, { id: 'robots-detail', name: '机器人详情', method: 'GET', path: '/api/prompt/robots/{id}', fields: [ { key: 'id', label: '机器人ID', type: 'number', in: 'path', required: true } ] }, { id: 'robots-create', name: '创建机器人', method: 'POST', path: '/api/prompt/robots', fields: [ { key: 'name', label: '名称', type: 'text', required: true }, { key: 'description', label: '描述', type: 'textarea' }, { key: 'status', label: '状态', type: 'number' }, { key: 'avatar', label: '头像URL', type: 'text' }, { key: 'body_json', label: '自定义JSON(可选)', type: 'json' } ] }, { id: 'robots-update', name: '更新机器人', method: 'PUT', path: '/api/prompt/robots/{id}', fields: [ { key: 'id', label: '机器人ID', type: 'number', in: 'path', required: true }, { key: 'name', label: '名称', type: 'text' }, { key: 'description', label: '描述', type: 'textarea' }, { key: 'status', label: '状态', type: 'number' }, { key: 'avatar', label: '头像URL', type: 'text' }, { key: 'body_json', label: '自定义JSON(可选)', type: 'json' } ] }, { id: 'robots-delete', name: '删除机器人', method: 'DELETE', path: '/api/prompt/robots/{id}', fields: [ { key: 'id', label: '机器人ID', type: 'number', in: 'path', required: true } ] } ] }, { key: 'tasks', title: '任务管理', ops: [ { id: 'tasks-list', name: '任务列表', method: 'GET', path: '/api/prompt/tasks', fields: [ { key: 'page', label: '页码', type: 'number', in: 'query' }, { key: 'page_size', label: '每页数量', type: 'number', in: 'query' }, { key: 'robot_id', label: '机器人ID', type: 'number', in: 'query' }, { key: 'status', label: '状态', type: 'number', in: 'query' }, { key: 'keyword', label: '关键词', type: 'text', in: 'query' } ] }, { id: 'tasks-detail', name: '任务详情(含对话)', method: 'GET', path: '/api/prompt/tasks/{id}', fields: [ { key: 'id', label: '任务ID', type: 'number', in: 'path', required: true }, { key: 'with_conversations', label: '包含对话(true/false)', type: 'text', in: 'query' } ] }, { id: 'tasks-create', name: '创建任务', method: 'POST', path: '/api/prompt/tasks', fields: [ { key: 'title', label: '标题', type: 'text', required: true }, { key: 'robot_id', label: '机器人ID', type: 'number' }, { key: 'content', label: '内容', type: 'textarea' }, { key: 'priority', label: '优先级', type: 'number' }, { key: 'status', label: '状态', type: 'number' }, { key: 'body_json', label: '自定义JSON(可选)', type: 'json' } ] }, { id: 'tasks-update', name: '更新任务', method: 'PUT', path: '/api/prompt/tasks/{id}', fields: [ { key: 'id', label: '任务ID', type: 'number', in: 'path', required: true }, { key: 'title', label: '标题', type: 'text' }, { key: 'robot_id', label: '机器人ID', type: 'number' }, { key: 'content', label: '内容', type: 'textarea' }, { key: 'priority', label: '优先级', type: 'number' }, { key: 'status', label: '状态', type: 'number' }, { key: 'body_json', label: '自定义JSON(可选)', type: 'json' } ] }, { id: 'tasks-delete', name: '删除任务', method: 'DELETE', path: '/api/prompt/tasks/{id}', fields: [ { key: 'id', label: '任务ID', type: 'number', in: 'path', required: true } ] }, { id: 'tasks-status', name: '更新任务状态', method: 'PUT', path: '/api/prompt/tasks/{id}/status', fields: [ { key: 'id', label: '任务ID', type: 'number', in: 'path', required: true }, { key: 'status', label: '状态', type: 'number', required: true } ] }, { id: 'tasks-download', name: '下载任务源文件', method: 'GET', path: '/api/prompt/tasks/{id}/download', responseType: 'file', fields: [ { key: 'id', label: '任务ID', type: 'number', in: 'path', required: true } ] }, { id: 'conv-delete', name: '删除单条对话', method: 'DELETE', path: '/api/prompt/conversations/{convId}', fields: [ { key: 'convId', label: '对话ID', type: 'number', in: 'path', required: true } ] }, { id: 'conv-clear', name: '清空对话', method: 'DELETE', path: '/api/prompt/tasks/{id}/conversations', fields: [ { key: 'id', label: '任务ID', type: 'number', in: 'path', required: true } ] } ] }, { key: 'templates', title: '模板库', ops: [ { id: 'templates-list', name: '模板列表', method: 'GET', path: '/api/prompt/templates', fields: [ { key: 'category', label: '分类', type: 'text', in: 'query' } ] }, { id: 'templates-detail', name: '模板详情', method: 'GET', path: '/api/prompt/templates/{id}', fields: [ { key: 'id', label: '模板ID', type: 'number', in: 'path', required: true } ] }, { id: 'templates-create', name: '创建模板', method: 'POST', path: '/api/prompt/templates', fields: [ { key: 'name', label: '名称', type: 'text', required: true }, { key: 'category', label: '分类', type: 'text' }, { key: 'content', label: '内容', type: 'textarea', required: true }, { key: 'body_json', label: '自定义JSON(可选)', type: 'json' } ] }, { id: 'templates-update', name: '更新模板', method: 'PUT', path: '/api/prompt/templates/{id}', fields: [ { key: 'id', label: '模板ID', type: 'number', in: 'path', required: true }, { key: 'name', label: '名称', type: 'text' }, { key: 'category', label: '分类', type: 'text' }, { key: 'content', label: '内容', type: 'textarea' }, { key: 'body_json', label: '自定义JSON(可选)', type: 'json' } ] }, { id: 'templates-delete', name: '删除模板', method: 'DELETE', path: '/api/prompt/templates/{id}', fields: [ { key: 'id', label: '模板ID', type: 'number', in: 'path', required: true } ] } ] }, { key: 'import', title: '对话导入', ops: [ { id: 'import-parse', name: '解析内容', method: 'POST', path: '/api/prompt/import', fields: [ { key: 'content', label: '内容', type: 'textarea', required: true }, { key: 'check_only', label: '仅检查(true/false)', type: 'text' }, { key: 'overwrite', label: '覆盖(true/false)', type: 'text' }, { key: 'task_id', label: '任务ID', type: 'number' }, { key: 'task_name', label: '任务名称', type: 'text' }, { key: 'robot_id', label: '机器人ID', type: 'number' } ] } ] } ]; module.exports = { modules };