数据库/查询数据库
简要描述
请求URL
http://127.0.0.1:8888/api/
请求方式
参数
参数名 | 必选 | 类型 | 说明 |
---|
type | 是 | int | 接口编号 |
dbName | 否 | string | 数据库名称,优先级低于dbHandle |
dbHandle | 否 | int | 数据库句柄,优先级高于dbName |
sql | 是 | string | sql |
请求示例
{
"type": 10058,
"dbName": "MicroMsg.db",
"sql": "select * from sqlite_master where type=\"table\";"
}
返回示例
{
"data": {
"status": 0,
"desc": "",
"data": []
}
}
常用查询
# 获取联系人,MicroMsg.db
select * from Contact where (Type&0xff=3 or Type&0xff=1) and VerifyFlag=0 and UserName NOT IN ('medianote','fmessage','floatbottle');
# 获取用户头像,MicroMsg.db
select smallHeadImgUrl from ContactHeadImgUrl where usrName="filehelper";
# 获取群聊列表,MicroMsg.db
select * from Contact where Type&0xf=2;
# 模糊搜索群聊信息,MicroMsg.db
SELECT a.UserName,a.NickName,b.smallHeadImgUrl,c.RoomData,c.Reserved2 FROM Contact a INNER JOIN ContactHeadImgUrl b ON a.UserName=b.usrName INNER JOIN ChatRoom c ON c.ChatRoomName=a.UserName WHERE a.nickName like "%某不知名的群" AND a.Type&0xf=2;)
返回参数说明
参数名 | 类型 | 说明 |
---|
error_code | int | 错误代码 |
description | string | 错误描述 |
data | json | 业务数据 |
备注