MOD:api
Showing
1 changed file
with
12 additions
and
10 deletions
... | @@ -1940,16 +1940,18 @@ class SearchGBHistoryFileView(GenericView): | ... | @@ -1940,16 +1940,18 @@ class SearchGBHistoryFileView(GenericView): |
1940 | return response.ok(data=True) | 1940 | return response.ok(data=True) |
1941 | 1941 | ||
1942 | class DownloadGBHistoryFileView(GenericView): | 1942 | class DownloadGBHistoryFileView(GenericView): |
1943 | permission_classes = [IsAuthenticated] | 1943 | # permission_classes = [IsAuthenticated] |
1944 | authentication_classes = [OAuth2AuthenticationWithUser] | 1944 | # authentication_classes = [OAuth2AuthenticationWithUser] |
1945 | 1945 | ||
1946 | @use_args(d_gb_file_args, location='data') | 1946 | @use_args(d_gb_file_args, location='data') |
1947 | def post(self, request, args): | 1947 | def post(self, request, args): |
1948 | |||
1949 | business_type = args.get('business_type') | ||
1950 | object_id = args.get('object_id') | ||
1951 | save_path = args.get('save_path') | ||
1952 | ecm = ECM() | ||
1953 | ecm.download(save_path, object_id, 'green_book', business_type) | ||
1954 | self.running_log.info('[DownloadGBHistoryFileView] [args={0}] '.format(args)) | ||
1955 | return response.ok(data=False) | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1948 | try: | ||
1949 | business_type = args.get('business_type') | ||
1950 | object_id = args.get('object_id') | ||
1951 | save_path = args.get('save_path') | ||
1952 | ecm = ECM() | ||
1953 | ecm.download(save_path, object_id, 'green_book', business_type) | ||
1954 | self.running_log.info('[DownloadGBHistoryFileView] [args={0}] '.format(args)) | ||
1955 | return response.ok(data=True) | ||
1956 | except Exception as e: | ||
1957 | return response.ok(data=False) | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment