14 lines
430 B
Python
14 lines
430 B
Python
|
|
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))
|