42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
"""
|
||
测试通过fileId生成文档(不再依赖templateCode)
|
||
"""
|
||
import sys
|
||
import os
|
||
sys.path.insert(0, os.path.dirname(__file__))
|
||
|
||
from services.document_service import DocumentService
|
||
|
||
# 测试通过fileId获取文件配置
|
||
print("="*80)
|
||
print("Test: Get file config by fileId")
|
||
print("="*80)
|
||
|
||
service = DocumentService()
|
||
|
||
# 测试查询一个已知的文件ID(从之前的查询结果中获取)
|
||
# "1.请示报告卡(初核谈话)" 的ID是 1765273963893166
|
||
test_file_id = 1765273963893166
|
||
|
||
print(f"\nTest file ID: {test_file_id}")
|
||
print("-" * 80)
|
||
|
||
result = service.get_file_config_by_id(test_file_id)
|
||
|
||
if result:
|
||
print("\n[OK] Found file config:")
|
||
print(f" - ID: {result['id']}")
|
||
print(f" - Name: {result['name']}")
|
||
print(f" - File Path: {result['file_path']}")
|
||
else:
|
||
print("\n[ERROR] File config not found")
|
||
print(" Possible reasons:")
|
||
print(" 1. File ID does not exist")
|
||
print(" 2. File state is not enabled (state != 1)")
|
||
print(" 3. Tenant ID mismatch")
|
||
|
||
print("\n" + "="*80)
|
||
print("Test completed")
|
||
print("="*80)
|
||
|