35dc3f45 by 冯轩

MOD:api

1 parent 33a3d92e
......@@ -1940,16 +1940,18 @@ class SearchGBHistoryFileView(GenericView):
return response.ok(data=True)
class DownloadGBHistoryFileView(GenericView):
permission_classes = [IsAuthenticated]
authentication_classes = [OAuth2AuthenticationWithUser]
# permission_classes = [IsAuthenticated]
# authentication_classes = [OAuth2AuthenticationWithUser]
@use_args(d_gb_file_args, location='data')
def post(self, request, args):
business_type = args.get('business_type')
object_id = args.get('object_id')
save_path = args.get('save_path')
ecm = ECM()
ecm.download(save_path, object_id, 'green_book', business_type)
self.running_log.info('[DownloadGBHistoryFileView] [args={0}] '.format(args))
return response.ok(data=False)
\ No newline at end of file
try:
business_type = args.get('business_type')
object_id = args.get('object_id')
save_path = args.get('save_path')
ecm = ECM()
ecm.download(save_path, object_id, 'green_book', business_type)
self.running_log.info('[DownloadGBHistoryFileView] [args={0}] '.format(args))
return response.ok(data=True)
except Exception as e:
return response.ok(data=False)
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!