design batch 代码整理
This commit is contained in:
13
app/service/design_batch/utils/save_json.py
Normal file
13
app/service/design_batch/utils/save_json.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import json
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
def oss_upload_json(oss_client, json_data, object_name):
|
||||
try:
|
||||
with open(f"app/service/design_batch/response_json/{object_name}", 'w') as file:
|
||||
json.dump(json_data, file, indent=4)
|
||||
oss_client.fput_object("test", object_name, f"app/service/design_batch/response_json/{object_name}")
|
||||
except Exception as e:
|
||||
logger.warning(str(e))
|
||||
Reference in New Issue
Block a user