#!/usr/bin/env python3
"""
Collector 修复脚本
解决 field 和 priority_score 参数问题
"""

import sys
import os
sys.path.insert(0, '/root/openclaw-workspace/projects/yu-zhi-ran/platform/backend')

from app.models import Topic
from datetime import datetime

def fix_topic_creation():
    """修复选题创建时的参数问题"""

    # 测试用例
    try:
        # 正确的参数
        topic = Topic(
            id="T001",
            title="城市农业ROI报告：20㎡阳台种菜一年，省了多少钱？",
            field="城市农业",
            priority_score=10,
            status="待处理",
            compliance_score=100,
            ready_at=None,
            published_at=None,
            platform_urls={},
            created_at=datetime.now(),
            updated_at=datetime.now()
        )
        print("✅ 选题创建成功")
        return True
    except Exception as e:
        print(f"❌ 选题创建失败: {e}")
        return False

if __name__ == "__main__":
    fix_topic_creation()