通用数据返回格式
<p><strong>返回参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>int</td>
<td>返回码</td>
</tr>
<tr>
<td>msg</td>
<td>string</td>
<td>返回说明</td>
</tr>
<tr>
<td>data</td>
<td>object</td>
<td>返回结果集</td>
</tr>
</tbody>
</table>
<p><strong>code(返回码)定义</strong></p>
<table>
<thead>
<tr>
<th>返回码</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>请求成功</td>
</tr>
<tr>
<td>210</td>
<td>请求失败</td>
</tr>
<tr>
<td>500</td>
<td>服务器异常</td>
</tr>
</tbody>
</table>
<p><strong>请求成功示例</strong></p>
<pre><code> {
&quot;code&quot;: 200,
&quot;msg&quot;:&quot;请求成功&quot;,
&quot;data&quot;: [
{
&quot;batteryCode&quot;: 1,
&quot;voltage&quot;: 3.552
},
{
&quot;batteryCode&quot;: 2,
&quot;voltage&quot;: 3.532
}
]
}</code></pre>
<p><strong>请求失败示例</strong></p>
<pre><code> {
&quot;code&quot;: 210,
&quot;reason&quot;:&quot;数据获取失败&quot;
}</code></pre>