<?php
// 直接测试自动化API功能
require_once 'api/api_router.php';

// 使用反射来测试API
class TestApiRouter extends ApiRouter {
    public function setRequest($method, $path, $params = []) {
        $this->request = [
            'method' => $method,
            'path' => $path,
            'params' => $params,
            'timestamp' => time()
        ];
    }
}

echo "=== 测试自动化统计API ===\n";
$router = new TestApiRouter();
$router->setRequest('GET', 'digital-human/manager/auto-stats');
$result = $router->dispatch();
echo $result . "\n\n";

echo "=== 测试智能任务分配API ===\n";
$router->setRequest('POST', 'digital-human/manager/auto-assign', [
    'description' => '检查音响设备和麦克风',
    'deadline' => '12:00',
    'priority' => 'high'
]);
$result2 = $router->dispatch();
echo $result2 . "\n\n";

echo "=== 测试启动自动模式API ===\n";
$router->setRequest('POST', 'digital-human/manager/auto-start');
$result3 = $router->dispatch();
echo $result3 . "\n\n";

echo "=== 测试自动化处理API ===\n";
$router->setRequest('POST', 'digital-human/manager/auto-process');
$result4 = $router->dispatch();
echo $result4 . "\n\n";

echo "=== 再次测试自动化统计 ===\n";
$router->setRequest('GET', 'digital-human/manager/auto-stats');
$result5 = $router->dispatch();
echo $result5 . "\n";
?>