mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-08 23:06:03 +00:00
refactor: 恢复所有审计API调用
This commit is contained in:
@@ -38,6 +38,7 @@ class APIGroup(metaclass=abc.ABCMeta):
|
||||
url = self.prefix + path
|
||||
data = json.dumps(data)
|
||||
headers['Content-Type'] = 'application/json'
|
||||
|
||||
try:
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.request(
|
||||
@@ -49,7 +50,7 @@ class APIGroup(metaclass=abc.ABCMeta):
|
||||
**kwargs
|
||||
) as resp:
|
||||
self.ap.logger.debug("data: %s", data)
|
||||
self.ap.logger.debug("ret: %s", await resp.json())
|
||||
self.ap.logger.debug("ret: %s", await resp.text())
|
||||
|
||||
except Exception as e:
|
||||
self.ap.logger.debug(f'上报失败: {e}')
|
||||
|
||||
@@ -9,7 +9,7 @@ class V2MainDataAPI(apigroup.APIGroup):
|
||||
|
||||
def __init__(self, prefix: str, ap: app.Application):
|
||||
self.ap = ap
|
||||
super().__init__(prefix+"/usage", ap)
|
||||
super().__init__(prefix+"/main", ap)
|
||||
|
||||
async def do(self, *args, **kwargs):
|
||||
config = self.ap.cfg_mgr.data
|
||||
|
||||
@@ -9,7 +9,7 @@ class V2PluginDataAPI(apigroup.APIGroup):
|
||||
|
||||
def __init__(self, prefix: str, ap: app.Application):
|
||||
self.ap = ap
|
||||
super().__init__(prefix+"/usage", ap)
|
||||
super().__init__(prefix+"/plugin", ap)
|
||||
|
||||
async def do(self, *args, **kwargs):
|
||||
config = self.ap.cfg_mgr.data
|
||||
|
||||
Reference in New Issue
Block a user