"""检查模板数据""" import requests API_BASE = "http://localhost:8000/api" response = requests.get(f"{API_BASE}/templates") templates = response.json() print(f"总模板数: {len(templates)}") print() # 统计 with_body = 0 without_body = 0 for tpl in templates[:10]: has_body = bool(tpl.get('template_body')) if has_body: with_body += 1 print(f"✅ {tpl['machine_model']}/{tpl['template_type']}") print(f" body长度: {len(tpl['template_body'])}") print(f" body前100字符: {tpl['template_body'][:100]}") else: without_body += 1 print(f"❌ {tpl['machine_model']}/{tpl['template_type']} - 无template_body") if tpl.get('reusable_from'): print(f" 复用来源: {tpl['reusable_from']}") print() print(f"\n前10个中: {with_body} 有body, {without_body} 无body")