From 2cb3429dcdd4ad91042e86843245f6457a352bad Mon Sep 17 00:00:00 2001 From: liuxiaoqing Date: Wed, 20 Aug 2025 10:37:26 +0800 Subject: [PATCH] =?UTF-8?q?fix(file):=20=E4=BC=98=E5=8C=96=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=8F=92=E5=85=A5=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改文件数据插入流程,先插入再查询 - 优化代码结构,提高可读性和维护性 --- alibabacloud_sample/fileservice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alibabacloud_sample/fileservice.py b/alibabacloud_sample/fileservice.py index f3987fc..272c02b 100644 --- a/alibabacloud_sample/fileservice.py +++ b/alibabacloud_sample/fileservice.py @@ -35,7 +35,8 @@ class FileService: os.remove(filepath) return v_file else: - v_file = dataservice.insert_file_data(file.filename, filepath, file_size, filetype, time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),file_hash) + dataservice.insert_file_data(file.filename, filepath, file_size, filetype, time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),file_hash) + v_file = dataservice.get_file(file_hash, file_size) print("insert v_file:", v_file) return v_file return None