2.17 增加读文件pdf接口测试1

This commit is contained in:
zy123 2025-02-17 12:34:47 +08:00
parent 043a4dd950
commit 3a9bafc63f
2 changed files with 7 additions and 5 deletions

View File

@ -1,3 +1,5 @@
import os
from flask import request, jsonify, Blueprint, g
import uuid
import time
@ -23,10 +25,9 @@ def process_file():
return jsonify({'error': 'Missing file_url parameter'})
# 生成唯一文件名
file_ext = '.pdf'
filename = f"{uuid.uuid4().hex}{file_ext}"
filename = os.path.join(output_folder,'ztbfile.pdf')
file_path,file_type=download_file(file_url, filename)
print(file_path)
# print(file_path)
# 调用预处理函数
start_time = time.time()
result = preprocess_files(

View File

@ -1,3 +1,5 @@
import os.path
from flask import request, jsonify, Blueprint, g
import uuid
import time
@ -24,8 +26,7 @@ def process_file():
return jsonify({'error': 'Missing file_url parameter'})
# 生成唯一文件名
file_ext = '.pdf'
filename = f"{uuid.uuid4().hex}{file_ext}"
filename = os.path.join(output_folder,'ztbfile.pdf')
file_path,file_type=download_file(file_url, filename)
# print(file_path)
# 调用预处理函数