From a9be3d5261b78164790c2a2e6365b3d842f7b8fc Mon Sep 17 00:00:00 2001 From: Changhua Date: Sat, 6 May 2023 22:14:04 +0800 Subject: [PATCH] Impl get dbs --- http/wcfhttp/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http/wcfhttp/core.py b/http/wcfhttp/core.py index 456422d..1ca552f 100644 --- a/http/wcfhttp/core.py +++ b/http/wcfhttp/core.py @@ -44,6 +44,7 @@ class Http(FastAPI): self.add_api_route("/wxid", self.get_self_wxid, methods=["GET"], summary="获取登录账号 wxid") self.add_api_route("/msg-types", self.get_msg_types, methods=["GET"], summary="获取消息类型") self.add_api_route("/contacts", self.get_contacts, methods=["GET"], summary="获取完整通讯录") + self.add_api_route("/dbs", self.get_dbs, methods=["GET"], summary="获取所有数据库") def _set_cb(self, cb): def callback(msg: WxMsg): @@ -141,3 +142,10 @@ class Http(FastAPI): if ret: return {"status": 0, "message": "成功", "data": {"contacts": ret}} return {"status": -1, "message": "失败"} + + def get_dbs(self) -> dict: + """获取所有数据库""" + ret = self.wcf.get_dbs() + if ret: + return {"status": 0, "message": "成功", "data": {"dbs": ret}} + return {"status": -1, "message": "失败"}