Prechádzať zdrojové kódy

品牌培育流程总封装

Sherlock 11 mesiacov pred
rodič
commit
f32475ee67
3 zmenil súbory, kde vykonal 5 pridanie a 6 odobranie
  1. 3 4
      api.py
  2. 1 1
      config/config.py
  3. 1 1
      config/service_config.yaml

+ 3 - 4
api.py

@@ -84,8 +84,8 @@ def generate_report(city_uuid, product_id, recall_count, delivery_count):
     """生成报告"""
     report_util = ReportUtils(city_uuid, product_id)
     report_util.generate_all_data(recall_count, delivery_count)
-    # repots_dir = os.path.join('./data/reports', city_uuid, product_id)
-    # upload_file(repots_dir)
+    repots_dir = os.path.join('./data/reports', city_uuid, product_id)
+    upload_file(repots_dir)
     
 def upload_file(reports_dir):
     """上传报告文件"""
@@ -118,7 +118,6 @@ def upload_file(reports_dir):
                 response = requests.post(
                     base_url,
                     headers=headers,
-                    cookies=cookies,
                     files=files,
                     verify=True
                 )
@@ -149,7 +148,7 @@ async def get_file_id(request: ReportRequest):
             detail="Reports not found"
         )
     
-    with open(files_id_path) as file:
+    with open(files_id_path, 'r', encoding="utf-8") as file:
         lines = file.readlines()
         
     if lines[0].strip() == "failed":

+ 1 - 1
config/config.py

@@ -11,6 +11,6 @@ def load_model_config():
     return config
 
 def load_service_config():
-    with open("./config/model_config.yaml") as file:
+    with open("./config/service_config.yaml") as file:
         config = yaml.safe_load(file)
     return config

+ 1 - 1
config/service_config.yaml

@@ -1,2 +1,2 @@
 aliyun:
-  upload_url: "https://10-79-117-86-8p1kxyomtjwgt3.ztna-dingtalk.com/screen/mapi/file/fileUpload"
+  upload_url: "https://10.79.117.86/screen/mapi/file/fileUpload"