From 4eb8d55ec0a664678895132256c97cc63a80be2b Mon Sep 17 00:00:00 2001
From: zhaoqingang <zhaoqg0118@163.com>
Date: 星期四, 21 十一月 2024 19:56:49 +0800
Subject: [PATCH] 写入记录问题
---
app/service/basic.py | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/app/service/basic.py b/app/service/basic.py
index 733405a..33e5f86 100644
--- a/app/service/basic.py
+++ b/app/service/basic.py
@@ -1,5 +1,7 @@
import httpx
+from Log import logger
+
class BasicService:
def __init__(self, base_url: str):
@@ -71,4 +73,22 @@
print(e)
return
else:
- yield f"Error: {response.status_code}"
\ No newline at end of file
+ yield f"Error: {response.status_code}"
+
+ async def questions_talk(self,question, chat_id: str):
+ logger.error("---------------questions_talk--------------------------")
+ url = f"{self.base_url}/questions/talk"
+ params = {'chat_id': chat_id}
+ headers = {'Content-Type': 'text/plain'}
+ async with httpx.AsyncClient(timeout=1800) as client:
+ response = await client.post(
+ url,
+ data=question,
+ headers=headers,
+ params=params
+ )
+ return self._check_response(response)
+
+ async def questions_talk_word_download(self, file_id: str):
+ url = f"{self.base_url}/questions/download/word"
+ return await self.download_from_url(url, params={'excel_name': file_id})
\ No newline at end of file
--
Gitblit v1.8.0