Files
AiDA_Python/app/service/design_batch/utils/save_json.py

14 lines
430 B
Python
Raw Normal View History

2024-09-26 06:09:05 +00:00
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))