Files
sanguo_vnpy/archive/2026-04-29-cleanup/test/backtest/create_test_task.py
T
2026-04-29 20:15:25 +08:00

36 lines
890 B
Python

import requests
import json
BASE_URL = "http://localhost:7891/api"
print("="*80)
print(" 🎯 创建新任务测试(太子配置已添加)")
print("="*80)
# 创建任务
task_title = "测试:太子(庞统)分拣任务 - 获取创业板指数据"
print(f"\n[1] 创建任务: {task_title}")
r = requests.post(
f"{BASE_URL}/create-task",
json={
'title': task_title,
'org': '户部',
'official': '赵云',
'priority': 'high',
'targetDept': '户部'
}
)
result = r.json()
print(f" 创建结果: {json.dumps(result, ensure_ascii=False, indent=2)}")
if not result.get('ok'):
print("\n ❌ 任务创建失败!")
else:
task_id = result.get('taskId')
print(f"\n ✅ 任务创建成功!任务ID: {task_id}")
print(f"\n 📋 现在开始监控任务流转...")
print(f" (我只监控,不干预)")