feat: api get_presign_url 2
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
95079adc6b
commit
a21bd3aef5
|
@ -47,13 +47,13 @@ def upload_image(files_data):
|
||||||
@api.doc(summary='获取图片预签名链接', description='获取图片预签名链接')
|
@api.doc(summary='获取图片预签名链接', description='获取图片预签名链接')
|
||||||
def get_image_presign_url(query_data):
|
def get_image_presign_url(query_data):
|
||||||
try:
|
try:
|
||||||
result = rpc.storage.get_presign_url(query_data['avatar_id'],
|
presign_url = rpc.storage.get_presign_url(query_data['avatar_id'],
|
||||||
'bodyrecord',
|
'bodyrecord',
|
||||||
bucket='bodyrecord',
|
bucket='bodyrecord',
|
||||||
expire_time=query_data.get('expire_time', 3600))
|
expire_time=query_data.get('expire_time', 3600))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ImageNotFound(extra_data={'error_docs': str(e)})
|
raise ImageNotFound(extra_data={'error_docs': str(e)})
|
||||||
return result
|
return {'image_presign_url': presign_url}
|
||||||
|
|
||||||
|
|
||||||
@api.get('/hello')
|
@api.get('/hello')
|
||||||
|
|
|
@ -12,6 +12,6 @@ class ImagePreSignUrlIn(Schema):
|
||||||
|
|
||||||
|
|
||||||
class ImagePreSignUrlOut(Schema):
|
class ImagePreSignUrlOut(Schema):
|
||||||
image_url = URL()
|
image_presign_url = URL()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue