From a21bd3aef53132ea793b6e1c4ad0f77f1d4a30dc Mon Sep 17 00:00:00 2001 From: BryantHe Date: Wed, 16 Aug 2023 17:21:50 +0800 Subject: [PATCH] feat: api get_presign_url 2 --- app/api/v1/api.py | 4 ++-- app/api/v1/schema/api.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/v1/api.py b/app/api/v1/api.py index 6bf6f88..1b80bae 100644 --- a/app/api/v1/api.py +++ b/app/api/v1/api.py @@ -47,13 +47,13 @@ def upload_image(files_data): @api.doc(summary='获取图片预签名链接', description='获取图片预签名链接') def get_image_presign_url(query_data): try: - result = rpc.storage.get_presign_url(query_data['avatar_id'], + presign_url = rpc.storage.get_presign_url(query_data['avatar_id'], 'bodyrecord', bucket='bodyrecord', expire_time=query_data.get('expire_time', 3600)) except Exception as e: raise ImageNotFound(extra_data={'error_docs': str(e)}) - return result + return {'image_presign_url': presign_url} @api.get('/hello') diff --git a/app/api/v1/schema/api.py b/app/api/v1/schema/api.py index f7c5ce0..25276c2 100644 --- a/app/api/v1/schema/api.py +++ b/app/api/v1/schema/api.py @@ -12,6 +12,6 @@ class ImagePreSignUrlIn(Schema): class ImagePreSignUrlOut(Schema): - image_url = URL() + image_presign_url = URL()