Impl get dbs
This commit is contained in:
parent
08b153e5b4
commit
a9be3d5261
@ -44,6 +44,7 @@ class Http(FastAPI):
|
|||||||
self.add_api_route("/wxid", self.get_self_wxid, methods=["GET"], summary="获取登录账号 wxid")
|
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("/msg-types", self.get_msg_types, methods=["GET"], summary="获取消息类型")
|
||||||
self.add_api_route("/contacts", self.get_contacts, 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 _set_cb(self, cb):
|
||||||
def callback(msg: WxMsg):
|
def callback(msg: WxMsg):
|
||||||
@ -141,3 +142,10 @@ class Http(FastAPI):
|
|||||||
if ret:
|
if ret:
|
||||||
return {"status": 0, "message": "成功", "data": {"contacts": ret}}
|
return {"status": 0, "message": "成功", "data": {"contacts": ret}}
|
||||||
return {"status": -1, "message": "失败"}
|
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": "失败"}
|
||||||
|
Loading…
Reference in New Issue
Block a user