电子围栏
<p>[TOC]</p>
<h4>禁飞区管理</h4>
<h5>禁飞区列表</h5>
<ol>
<li>服务描述
getAllFences 服务用户获取地面站上的所有航线</li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;getAllFences&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;keyword&quot;: &quot;机场&quot;
}
}
}</code></pre>
<ol>
<li>响应格式 </li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0,
&quot;message&quot;: &quot;成功&quot;,
&quot;data&quot;: [
{
&quot;itemId&quot;: 1,
&quot;name&quot;: &quot;机场禁飞区&quot;,
&quot;type&quot;: 1,
&quot;color&quot;: &quot;#FF0000&quot;,
&quot;geometry&quot;: [
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.2
},
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.3
},
{
&quot;latitude&quot;: 39.5,
&quot;latitude&quot;: 116.3
},
{
&quot;latitude&quot;: 39.5,
&quot;latitude&quot;: 116.2
}
],
&quot;radius&quot;: 0,
&quot;enabled&quot;: true,
&quot;created_at&quot;: &quot;125045613505392&quot;
},
{
&quot;itemId&quot;: 2,
&quot;name&quot;: &quot;军事禁区&quot;,
&quot;type&quot;: 1,
&quot;color&quot;: &quot;#0000FF&quot;,
&quot;geometry&quot;: [
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.2
}
],
&quot;area&quot;:100.1,
&quot;perimeter&quot;:200,
&quot;radius&quot;: 5000.0,
&quot;enabled&quot;: true,
&quot;created_at&quot;: &quot;125045613505392&quot;
}
],
&quot;timestamp&quot;: 1700000000000
}
</code></pre>
<table>
<thead>
<tr>
<th>Column Name</th>
<th>Name</th>
<th>Type</th>
<th>Constraint</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>itemId</td>
<td>禁飞区ID</td>
<td>int</td>
<td>主键,唯一</td>
<td>禁飞区的唯一标识符,可使用UUID或手动设定,用于数据的唯一标识和关联操作。</td>
</tr>
<tr>
<td>name</td>
<td>禁飞区名称</td>
<td>string</td>
<td>非空,≤50字符</td>
<td>禁飞区的业务名称,如“机场禁飞区”“军事禁区”</td>
</tr>
<tr>
<td>type</td>
<td>区域类型</td>
<td>int</td>
<td>1或2</td>
<td>1 多边形禁飞区,2 多边形作业区 3 圆形禁飞区 ,4 圆形作业区</td>
</tr>
<tr>
<td>color</td>
<td>显示颜色</td>
<td>string</td>
<td>标准RGB格式</td>
<td>用于地图可视化的颜色标识,如“#FF0000”(红色)</td>
</tr>
<tr>
<td>geometry</td>
<td>几何数据</td>
<td>string</td>
<td>非空</td>
<td>存储禁飞区的地理坐标信息:多边形为坐标点集合,圆形为圆心坐标,采用JSON格式字符串。</td>
</tr>
<tr>
<td>radius</td>
<td>半径</td>
<td>double</td>
<td>≥0</td>
<td>仅当形状为圆形时有效,单位为米,表示圆形禁飞区的半径范围,多边形时该值为0。</td>
</tr>
<tr>
<td>enabled</td>
<td>启用状态</td>
<td>bool</td>
<td>非空</td>
<td>true表示禁飞区规则生效,false表示临时禁用,用于动态控制禁飞区的有效性。</td>
</tr>
<tr>
<td>created_at</td>
<td>创建时间</td>
<td>string</td>
<td>ISO 8601格式</td>
<td>记录禁飞区的创建时间,采用UTC时区格式</td>
</tr>
<tr>
<td>area</td>
<td>面积</td>
<td>float</td>
<td>非空</td>
<td></td>
</tr>
<tr>
<td>perimeter</td>
<td>周长</td>
<td>float</td>
<td>ISO 8601格式</td>
<td></td>
</tr>
</tbody>
</table>
<h5>新增禁飞区</h5>
<ol>
<li>服务描述</li>
</ol>
<p>addFence 服务用户获取地面站新增禁飞区</p>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;addFence&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;name&quot;: &quot;核电站禁飞区&quot;,
&quot;type&quot;: 1,
&quot;shapeType&quot;: 1,
&quot;color&quot;: &quot;#FF0000&quot;,
&quot;geometry&quot;: [
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.2
},
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.3
},
{
&quot;latitude&quot;: 39.5,
&quot;latitude&quot;: 116.3
},
{
&quot;latitude&quot;: 39.5,
&quot;latitude&quot;: 116.2
}
],
&quot;perimeter&quot;:200,
&quot;radius&quot;: 5000.0,
&quot;radius&quot;: 0,
&quot;enabled&quot;: true
}
}
}</code></pre>
<ol>
<li>响应格式 </li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0, // 结果返回码:0 表示成功,非 0 表示失败
&quot;message&quot;: &quot;成功&quot; // 错误信息(如果失败则返回具体原因)
&quot;data&quot;: {},
&quot;timestamp&quot;: 1700000000000
}</code></pre>
<h5>编辑禁飞区 updateFence</h5>
<ol>
<li>服务描述</li>
</ol>
<p>updateFence 服务用于编辑已存在的禁飞区信息。</p>
<pre><code class="language-json">
{
&quot;tid&quot;: &quot;1234567895&quot;,
&quot;bid&quot;: &quot;9876543215&quot;,
&quot;method&quot;: &quot;updateFence&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;color&quot;: &quot;#FF0000&quot;,
&quot;created_at&quot;: &quot;2025-06-19T09:45:00Z&quot;,
&quot;enabled&quot;: true,
&quot;geometry&quot;: [
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.2
},
{
&quot;latitude&quot;: 39.6,
&quot;latitude&quot;: 116.3
},
{
&quot;latitude&quot;: 39.5,
&quot;latitude&quot;: 116.3
},
{
&quot;latitude&quot;: 39.5,
&quot;latitude&quot;: 116.2
}
],
&quot;itemId&quot;: 4,
&quot;name&quot;: &quot;核电站禁飞区111111111&quot;,
&quot;radius&quot;: 0.0,
&quot;perimeter&quot;:200,
&quot;radius&quot;: 5000.0,
&quot;shapeType&quot;: 1,
&quot;type&quot;: 1
}
}
} </code></pre>
<ol>
<li>响应格式 </li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0, // 结果返回码:0 表示成功,非 0 表示失败
&quot;message&quot;: &quot;成功&quot; // 错误信息(如果失败则返回具体原因)
&quot;data&quot;: {},
&quot;timestamp&quot;: 1700000000000
}</code></pre>
<h5>禁飞区删除服务 deleteFence</h5>
<ol>
<li>服务描述</li>
</ol>
<p>deleteFence 服务用于删除地面站中已存在的禁飞区,支持单条或批量删除操作</p>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567896&quot;, // 交易ID(唯一标识请求)
&quot;bid&quot;: &quot;9876543216&quot;, // 业务ID(标识禁飞区管理业务)
&quot;method&quot;: &quot;deleteFence&quot;, // 接口方法名(删除禁飞区)
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;itemIds&quot;: [2, 5, 8] // 要删除的禁飞区ID列表(支持单个或多个ID)
}
},
&quot;timestamp&quot;: 1744794432020 // 请求时间戳(毫秒级)
}</code></pre>
<ol>
<li>响应格式 </li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0, // 结果返回码:0 表示成功,非 0 表示失败
&quot;message&quot;: &quot;成功&quot; // 错误信息(如果失败则返回具体原因)
&quot;data&quot;: {},
&quot;timestamp&quot;: 1700000000000
}</code></pre>
<h5>启用/停用禁飞区</h5>
<ol>
<li>服务描述</li>
</ol>
<p>setFenceEnabled 服务用于批量启用或停用禁飞区。通过指定禁飞区的 ID 列表和启用状态,可以动态更新禁飞区的启用状态。</p>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;method&quot;: &quot;setFenceEnabled&quot;,
&quot;data&quot;: {
&quot;custom&quot;: {
&quot;itemIds&quot;: [1, 2, 3], // 需要操作的禁飞区ID列表
&quot;enabled&quot;: true // 启用状态,true表示启用,false表示停用
}
}
}</code></pre>
<ol>
<li>响应格式 </li>
</ol>
<pre><code class="language-json">{
&quot;tid&quot;: &quot;1234567890&quot;,
&quot;bid&quot;: &quot;9876543210&quot;,
&quot;code&quot;: 0, // 结果返回码:0 表示成功,非 0 表示失败
&quot;message&quot;: &quot;成功&quot;, // 错误信息(如果失败则返回具体原因)
&quot;data&quot;: {
&quot;updated&quot;: [1, 2, 3] // 实际更新的禁飞区ID列表
},
&quot;timestamp&quot;: 1700000000000
}</code></pre>