ming пре 4 година
родитељ
комит
c29587c8bc
1 измењених фајлова са 9 додато и 1 уклоњено
  1. 9 1
      main.py

+ 9 - 1
main.py

@@ -143,7 +143,15 @@ async def history_input():
 async def log_test(req:request2):
 async def log_test(req:request2):
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
     log_table = db['history_input']
     log_table = db['history_input']
-    pk = log_table.insert({'name':req.name,'text_content':req.text_content,'image_urls':req.image_urls})
+    txt_content_seperate_by_dot = ''
+    for txt in text_content:
+        txt_content_seperate_by_dot += txt+","
+    txt_content_seperate_by_dot = txt_content_seperate_by_dot[:-1]
+    img_urls_seperate_by_dot = ''
+    for iurl in image_urls:
+        img_urls_seperate_by_dot += iurl+","
+    img_urls_seperate_by_dot[:-1]
+    pk = log_table.insert({'name':req.name,'text_content':txt_content_seperate_by_dot,'image_urls':img_urls_seperate_by_dot})
     return pk
     return pk
 
 
 def notify_group(msg):
 def notify_group(msg):