#!/usr/bin/env python3 import sys from pathlib import Path PROJECT_ROOT = Path(__file__).parent.parent sys.path.insert(0, str(PROJECT_ROOT)) from db_helper import update_topic_status, get_topic_by_id def main(): target_ids = ['D01', 'B05'] print(f"正在重置选题状态: {target_ids}") updated = [] for tid in target_ids: if update_topic_status(tid, 'pending'): updated.append(tid) if updated: print(f"[DB] 已重置: {updated}") else: print("[DB] 无更新") print("完成") if __name__ == "__main__": main()