查询数据库
<p>[TOC]</p>
<h5>简要描述</h5>
<ul>
<li>查询数据库</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><a href="http://localhost:30001/QueryDB">http://localhost:30001/QueryDB</a></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST </li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">dbname</td>
<td style="text-align: left;">string</td>
<td>数据库文件名(注意区分大小写)</td>
</tr>
<tr>
<td style="text-align: left;">sql</td>
<td style="text-align: left;">string</td>
<td>查询语句</td>
</tr>
</tbody>
</table>
<h5>发送示例</h5>
<pre><code>{
"dbname":"MSG0.db",
"sql":"select * from MSG limit 2"
}</code></pre>
<h5>返回示例</h5>
<pre><code>{
"data": [
{
"localId": "1",
"TalkerId": "1",
"MsgSvrID": "8411306876558530937",
"Type": "1",
"SubType": "0",
"IsSender": "1",
"CreateTime": "1657456857",
"Sequence": "1657456857000",
"StatusEx": "0",
"FlagEx": "0",
"Status": "2",
"MsgServerSeq": "0",
"MsgSequence": "0",
"StrTalker": "filehelper",
"StrContent": "haha666",
"Reserved0": "0",
"BytesExtra":"$\b f422de16a450607ca514e688b0a89235"
},
{
"localId": "2",
"TalkerId": "2",
"MsgSvrID": "8248358209354624495",
"Type": "34",
"SubType": "0",
"IsSender": "0",
"CreateTime": "1657456865",
"Sequence": "1657456865000",
"StatusEx": "0",
"FlagEx": "0",
"Status": "2",
"MsgServerSeq": "1",
"MsgSequence": "763728862",
"StrTalker": "wxid_7jcwnh1hfaka22",
"StrContent": "<msg><voicemsg endflag=\"1\" cancelflag=\"0\" forwardflag=\"0\" voiceformat=\"4\" voicelength=\"6397\" length=\"10750\" bufid=\"796522310088982944\" aeskey=\"727562667567737266796f6a74646854\" voiceurl=\"3052020100044b30490201000204c53fdf6f02033d14b902046b692fb7020462cac8e1042462633166626465332d376665622d343865652d383132322d64326366613034353734333802040128000f0201000400373940b2\" voicemd5=\"db859a0c59c125d9abca13643aa64d88\" clientmsgid=\"416239303931363362353434353664005720400710222ba8da479e1123\" fromusername=\"wxid_123456\" /></msg>",
"Reserved0": "0",
"BytesExtra":"\n\b"
},
]
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">string</td>
<td>查询到的数据</td>
</tr>
</tbody>
</table>
<h5>备注</h5>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>