From 9d3318c6f6a67d38c29b17858d09391459b669f6 Mon Sep 17 00:00:00 2001 From: zy123 <646228430@qq.com> Date: Mon, 23 Sep 2024 17:57:30 +0800 Subject: [PATCH] =?UTF-8?q?9.23=E6=B5=8B=E8=AF=95=E5=88=86=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flask_app/main/start_up.py | 2 +- flask_app/货物标/test.py | 6 ++++-- flask_app/货物标/资格审查main.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/flask_app/main/start_up.py b/flask_app/main/start_up.py index a7a41df..368c408 100644 --- a/flask_app/main/start_up.py +++ b/flask_app/main/start_up.py @@ -154,7 +154,7 @@ def process_and_stream(file_url): def validate_request(): if not request.is_json: return jsonify({'error': 'Missing JSON in request'}), 400 - file_url = request.json.get('file_url')[0] + file_url = request.json.get('file_url') if not file_url: return jsonify({'error': 'No file URL provided'}), 400 return file_url diff --git a/flask_app/货物标/test.py b/flask_app/货物标/test.py index 2d66582..c3539d6 100644 --- a/flask_app/货物标/test.py +++ b/flask_app/货物标/test.py @@ -25,6 +25,8 @@ def contains_number_or_index(key, value): # 如果值是数字或包含数字,且不包含中文字符,或者键包含 "序号",返回 True return is_number or contains_index or contains_digit +#对于同一个字典中,可能存在若干键值对,若它们的键值都是""或者"/" 你就将它们的键值删去,它们的键名用字符串列表保存 +#如果键名是"序号"或者键值中全是数字,删去序号 def preprocess_dict(data): if isinstance(data, dict): if len(data) > 1: @@ -150,5 +152,5 @@ input_data = { } pred=preprocess_dict(input_data) print(json.dumps(pred, ensure_ascii=False, indent=4)) -processed_data = process_dict(pred) -print(json.dumps(processed_data, ensure_ascii=False, indent=4)) \ No newline at end of file +# processed_data = process_dict(pred) +# print(json.dumps(processed_data, ensure_ascii=False, indent=4)) \ No newline at end of file diff --git a/flask_app/货物标/资格审查main.py b/flask_app/货物标/资格审查main.py index 5366e59..6fafa57 100644 --- a/flask_app/货物标/资格审查main.py +++ b/flask_app/货物标/资格审查main.py @@ -32,6 +32,8 @@ def contains_number_or_index(key, value): # 如果值是数字或包含数字,且不包含中文字符,或者键包含 "序号",返回 True return is_number or contains_index or contains_digit +#对于同一个字典中,可能存在若干键值对,若它们的键值都是""或者"/" 你就将它们的键值删去,它们的键名用字符串列表保存 +#如果键名是"序号"或者键值中全是数字,删去序号 def preprocess_dict(data): if isinstance(data, dict): if len(data) > 1: