Merge branch 'feature/CHINARPA-5131-5234' into feature/uat-tmp
Showing
1 changed file
with
12 additions
and
10 deletions
| ... | @@ -2130,16 +2130,18 @@ class SearchGBHistoryFileView(GenericView): | ... | @@ -2130,16 +2130,18 @@ class SearchGBHistoryFileView(GenericView): |
| 2130 | return response.ok(data=True) | 2130 | return response.ok(data=True) |
| 2131 | 2131 | ||
| 2132 | class DownloadGBHistoryFileView(GenericView): | 2132 | class DownloadGBHistoryFileView(GenericView): |
| 2133 | permission_classes = [IsAuthenticated] | 2133 | # permission_classes = [IsAuthenticated] |
| 2134 | authentication_classes = [OAuth2AuthenticationWithUser] | 2134 | # authentication_classes = [OAuth2AuthenticationWithUser] |
| 2135 | 2135 | ||
| 2136 | @use_args(d_gb_file_args, location='data') | 2136 | @use_args(d_gb_file_args, location='data') |
| 2137 | def post(self, request, args): | 2137 | def post(self, request, args): |
| 2138 | |||
| 2139 | business_type = args.get('business_type') | ||
| 2140 | object_id = args.get('object_id') | ||
| 2141 | save_path = args.get('save_path') | ||
| 2142 | ecm = ECM() | ||
| 2143 | ecm.download(save_path, object_id, 'green_book', business_type) | ||
| 2144 | self.running_log.info('[DownloadGBHistoryFileView] [args={0}] '.format(args)) | ||
| 2145 | return response.ok(data=False) | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 2138 | try: | ||
| 2139 | business_type = args.get('business_type') | ||
| 2140 | object_id = args.get('object_id') | ||
| 2141 | save_path = args.get('save_path') | ||
| 2142 | ecm = ECM() | ||
| 2143 | ecm.download(save_path, object_id, 'green_book', business_type) | ||
| 2144 | self.running_log.info('[DownloadGBHistoryFileView] [args={0}] '.format(args)) | ||
| 2145 | return response.ok(data=True) | ||
| 2146 | except Exception as e: | ||
| 2147 | 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