feat(drone-dock): 添加安全控制接口本地模拟调试

接入 command 请求合同与底部暂停、继续、返航、取消返航交互;支持同任务单次回查、防重复提交及未知结果锁。保留真实指令禁飞拦截,补充隔离测试、模拟回执与截图。
This commit is contained in:
2026-10-30 10:32:31 +08:00
parent b95b251de1
commit 20877b425c
21 changed files with 2668 additions and 43 deletions
@@ -0,0 +1,61 @@
# 拍摄任务底部安全控制:本地模拟调试
日期:2026-10-30。全部请求与回执来自纯内存 Mock,**未访问后端、未向无人机发送指令**,不代表后端受理或设备执行成功。
## 接口合同
朱工提供 `POST /api/app/airport/command`,只发送同一订单飞行任务的 `id` 和指令码:
| 按钮 | command |
| --- | --- |
| 紧急暂停 | `flighttask_pause` |
| 继续拍摄 | `flighttask_recovery` |
| 立即返航 | `return_home` |
| 取消返航 | `return_home_cancel` |
不传 `plane_id`、`airport_sn`,也不编造 `dry_run` 参数。响应解析 `order_flight_task_id`、`command`、`airport_sn`、任意 JSON 类型的 `dji_status` 和非实时 `metrics`;回显任务及指令必须与请求一致。
成功后只查询同一任务 `shooting` 一次,不轮询;受理回执不直接代替设备状态。底部两列分别展示暂停/继续、返航/取消返航,位置固定。
## 模拟入口与场景
- Debug 启动参数 `--dock-command-mock`:直接进入合成任务 `901` 的模拟拍摄中。
- `--dock-command-result=success`(默认)、`business-failure`、`timeout` 分别验证成功、明确拒绝与结果未知。
- 原有准备页“本地模拟”及 `--dock-preparation-mock`、`--dock-start-shoot-mock` 也接入同一内存指令服务;不携带真实订单或设备身份。
- 右上角文档图标展示当前模拟会话的完整请求、响应及错误,含 `source=local_mock`、`network_sent=false`。
真实入口仍未注入指令服务,按钮禁用。Debug 统一网络层的禁飞拦截未改动;普通传输即使实例化指令 API,也会在发送前被拦截。模拟传输仅接受 `https://mock.invalid` 的已知请求,未知请求本地失败,无网络回退能力。
## 交互与状态边界
- 必须存在有效任务、锁定飞机及明确的 `ui.commands` 白名单指令;缺失或未知指令不开放按钮。不用开拍门禁推导暂停/返航权限。
- 连点只提交一次;开拍、指令和刷新互斥,等待时保留旧阶段与六项读数。
- 明确业务拒绝可由用户再次点击重试;超时、错误回执或发送后取消会锁定控制操作,只允许读取状态,不自动重试。
- 回查仍为旧数据时,所有已受理且仍出现在旧列表的指令分别保持防重锁,不能通过暂停/返航交替点击绕过。
- 立即返航先弹确认。本地状态按文档模拟任务中断;取消返航后任务仍中断,不恢复任务、自动开拍或新建任务。该模拟状态是测试场景,不是后端当前行为的实测证据。
- 离页、后台和身份变化会使迟到响应失效。
## 验证
首轮模拟器相关测试 99 项全部通过,覆盖 API、ViewModel、UI、既有开拍/准备流程和禁飞保护。防重复边界修正后,18 项指令 ViewModel 测试与 1 项暂停/恢复 UI 测试再次全部通过;累计 100 项不同测试通过。构建通过,`git diff --check` 通过。
- 首轮结果包:`test_sim_2026-10-30T02-17-48-735Z_pid48214_75e97ac8.xcresult`。
- 最终结果包:`test_sim_2026-10-30T02-20-02-298Z_pid48214_c1e1a9c1.xcresult`。
- 手动操作:在 iPhone 18 Pro / iOS 27 模拟器依次点击暂停、继续、返航并确认、取消返航;共 9 次本地交换(首次 GET + 4 组 POST/GET),全程任务 `901`。
- [完整成功流程请求与回执](success-flow.mock.json):从本次实际模拟器操作日志提取,四个指令均有模拟 `code=100000` 回执。
- [明确拒绝及再次点击记录](business-failure.mock.json)、[超时及只读刷新记录](timeout.mock.json):来自隔离 UI 测试附件。
- 暂停后按钮变为继续;返航后只开放取消返航;取消后保持任务中断且控制按钮禁用。
## 模拟器截图
暂停后:
![暂停成功(纯本地模拟)](paused-mock.png)
返航中断任务后:
![取消返航入口(纯本地模拟)](returning-mock.png)
[取消返航后的中断状态](return-cancelled-mock.png) · [返航确认弹窗](return-confirmation-mock.png) · [超时结果待核对](timeout-mock.png)
后续真实联调仍需在用户解除禁飞限制后进行,并核对后端不同阶段的 `ui.commands`、返航中断与取消返航的实际响应。本次不验证真实网络、设备飞行或素材产生。
@@ -0,0 +1,154 @@
{
"command_scenario" : "business-failure",
"description" : "纯内存模拟,未调用后端或设备",
"network_sent" : false,
"records" : [
{
"http_status" : 200,
"method" : "GET",
"path" : "/api/app/airport/shooting",
"query" : "id=901&live_battery=1",
"response_body" : {
"code" : 100000,
"data" : {
"air_line" : {
"id" : 401,
"name" : "模拟航线",
"scenic_spot_id" : 301
},
"current_plane" : {
"id" : 201,
"online_status" : 1,
"sn_number" : "LOCAL-MOCK-PLANE-201",
"status_text" : "本地模拟 · 拍摄中 · 电量95%",
"work_status" : 2,
"work_status_label" : "拍摄中"
},
"execute_gate" : {
"can_execute" : false,
"code" : "already_started",
"message" : "本地模拟:开拍已受理",
"primary_action" : "shooting",
"primary_action_label" : "拍摄中"
},
"header" : {
"order_number" : "LOCAL-MOCK-ORDER-901",
"package_name" : "模拟套餐 · 含5次拍摄",
"title" : "模拟点位 · 模拟航线",
"tourist_label" : "本地模拟,无设备指令"
},
"metrics" : [
{
"key" : "battery",
"value" : "95%"
},
{
"key" : "env_temp",
"value" : "20.3℃"
},
{
"key" : "wind_speed",
"value" : "0m/s"
},
{
"key" : "rainfall",
"value" : "无雨"
},
{
"key" : "signal",
"value" : "良好"
},
{
"key" : "satellite",
"value" : "36颗"
}
],
"order_flight_task" : {
"id" : 901,
"order_number" : "LOCAL-MOCK-ORDER-901",
"scenic_id" : 128,
"status" : 20,
"status_label" : "执行中(模拟)",
"wayline_status" : 20,
"wayline_status_label" : "执行中(模拟)"
},
"order_number" : "LOCAL-MOCK-ORDER-901",
"plane_status" : {
"connected" : true,
"poll_hint_ms" : 5000,
"scenic_id" : 128
},
"scenic" : {
"id" : 128,
"name" : "本地模拟景区"
},
"scenic_spot" : {
"id" : 301,
"name" : "模拟点位"
},
"task" : {
"id" : 901,
"order_number" : "LOCAL-MOCK-ORDER-901",
"scenic_id" : 128,
"status" : 20,
"status_label" : "执行中(模拟)",
"wayline_status" : 20,
"wayline_status_label" : "执行中(模拟)"
},
"ui" : {
"commands" : [
{
"command" : "flighttask_pause",
"label" : "紧急暂停",
"sub" : "悬停待命"
},
{
"command" : "return_home",
"label" : "立即返航",
"sub" : "中断任务"
}
],
"message" : "本地模拟状态回查,未向设备发送指令。",
"phase" : "shooting",
"title" : "无人机正在拍摄中(模拟)"
}
},
"msg" : "local mock success"
}
},
{
"http_status" : 200,
"method" : "POST",
"path" : "/api/app/airport/command",
"request_body" : {
"command" : "flighttask_pause",
"id" : 901
},
"response_body" : {
"code" : 100099,
"data" : {
},
"msg" : "本地模拟:指令被拒绝,未改变任务状态"
}
},
{
"http_status" : 200,
"method" : "POST",
"path" : "/api/app/airport/command",
"request_body" : {
"command" : "flighttask_pause",
"id" : 901
},
"response_body" : {
"code" : 100099,
"data" : {
},
"msg" : "本地模拟:指令被拒绝,未改变任务状态"
}
}
],
"scenario" : "success",
"source" : "local_mock"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

@@ -0,0 +1,745 @@
{
"source": "local_mock",
"description": "模拟器实际点击,纯内存处理,未调用后端或设备",
"network_sent": false,
"task_id": 901,
"records": [
{
"method": "GET",
"path": "/api/app/airport/shooting",
"query": "id=901&live_battery=1",
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"air_line": {
"id": 401,
"name": "模拟航线",
"scenic_spot_id": 301
},
"current_plane": {
"id": 201,
"online_status": 1,
"sn_number": "LOCAL-MOCK-PLANE-201",
"status_text": "本地模拟 · 拍摄中 · 电量95%",
"work_status": 2,
"work_status_label": "拍摄中"
},
"execute_gate": {
"can_execute": false,
"code": "already_started",
"message": "本地模拟:开拍已受理",
"primary_action": "shooting",
"primary_action_label": "拍摄中"
},
"header": {
"order_number": "LOCAL-MOCK-ORDER-901",
"package_name": "模拟套餐 · 含5次拍摄",
"title": "模拟点位 · 模拟航线",
"tourist_label": "本地模拟,无设备指令"
},
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"scenic_id": 128,
"status": 20,
"status_label": "执行中(模拟)",
"wayline_status": 20,
"wayline_status_label": "执行中(模拟)"
},
"order_number": "LOCAL-MOCK-ORDER-901",
"plane_status": {
"connected": true,
"poll_hint_ms": 5000,
"scenic_id": 128
},
"scenic": {
"id": 128,
"name": "本地模拟景区"
},
"scenic_spot": {
"id": 301,
"name": "模拟点位"
},
"task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"scenic_id": 128,
"status": 20,
"status_label": "执行中(模拟)",
"wayline_status": 20,
"wayline_status_label": "执行中(模拟)"
},
"ui": {
"commands": [
{
"command": "flighttask_pause",
"label": "紧急暂停",
"sub": "悬停待命"
},
{
"command": "return_home",
"label": "立即返航",
"sub": "中断任务"
}
],
"message": "本地模拟状态回查,未向设备发送指令。",
"phase": "shooting",
"title": "无人机正在拍摄中(模拟)"
}
},
"msg": "local mock success"
}
},
{
"method": "POST",
"path": "/api/app/airport/command",
"request_body": {
"id": 901,
"command": "flighttask_pause"
},
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"airport_sn": "LOCAL-MOCK-DOCK-201",
"command": "flighttask_pause",
"dji_status": "paused",
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task_id": 901
},
"msg": "local mock success"
}
},
{
"method": "GET",
"path": "/api/app/airport/shooting",
"query": "id=901&live_battery=1",
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"air_line": {
"id": 401,
"name": "模拟航线",
"scenic_spot_id": 301
},
"current_plane": {
"id": 201,
"online_status": 1,
"sn_number": "LOCAL-MOCK-PLANE-201",
"status_text": "本地模拟 · 悬停中 · 电量95%",
"work_status": 2,
"work_status_label": "悬停中"
},
"execute_gate": {
"can_execute": false,
"code": "already_started",
"message": "本地模拟:开拍已受理",
"primary_action": "paused",
"primary_action_label": "拍摄中"
},
"header": {
"order_number": "LOCAL-MOCK-ORDER-901",
"package_name": "模拟套餐 · 含5次拍摄",
"title": "模拟点位 · 模拟航线",
"tourist_label": "本地模拟,无设备指令"
},
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"scenic_id": 128,
"status": 20,
"status_label": "执行中(模拟)",
"wayline_status": 20,
"wayline_status_label": "执行中(模拟)"
},
"order_number": "LOCAL-MOCK-ORDER-901",
"plane_status": {
"connected": true,
"poll_hint_ms": 5000,
"scenic_id": 128
},
"scenic": {
"id": 128,
"name": "本地模拟景区"
},
"scenic_spot": {
"id": 301,
"name": "模拟点位"
},
"task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"scenic_id": 128,
"status": 20,
"status_label": "执行中(模拟)",
"wayline_status": 20,
"wayline_status_label": "执行中(模拟)"
},
"ui": {
"commands": [
{
"command": "flighttask_recovery",
"label": "继续拍摄",
"sub": "恢复航线"
},
{
"command": "return_home",
"label": "立即返航",
"sub": "中断任务"
}
],
"message": "本地模拟状态回查,未向设备发送指令。",
"phase": "paused",
"title": "拍摄已暂停(模拟)"
}
},
"msg": "local mock success"
}
},
{
"method": "POST",
"path": "/api/app/airport/command",
"request_body": {
"id": 901,
"command": "flighttask_recovery"
},
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"airport_sn": "LOCAL-MOCK-DOCK-201",
"command": "flighttask_recovery",
"dji_status": "shooting",
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task_id": 901
},
"msg": "local mock success"
}
},
{
"method": "GET",
"path": "/api/app/airport/shooting",
"query": "id=901&live_battery=1",
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"air_line": {
"id": 401,
"name": "模拟航线",
"scenic_spot_id": 301
},
"current_plane": {
"id": 201,
"online_status": 1,
"sn_number": "LOCAL-MOCK-PLANE-201",
"status_text": "本地模拟 · 拍摄中 · 电量95%",
"work_status": 2,
"work_status_label": "拍摄中"
},
"execute_gate": {
"can_execute": false,
"code": "already_started",
"message": "本地模拟:开拍已受理",
"primary_action": "shooting",
"primary_action_label": "拍摄中"
},
"header": {
"order_number": "LOCAL-MOCK-ORDER-901",
"package_name": "模拟套餐 · 含5次拍摄",
"title": "模拟点位 · 模拟航线",
"tourist_label": "本地模拟,无设备指令"
},
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"scenic_id": 128,
"status": 20,
"status_label": "执行中(模拟)",
"wayline_status": 20,
"wayline_status_label": "执行中(模拟)"
},
"order_number": "LOCAL-MOCK-ORDER-901",
"plane_status": {
"connected": true,
"poll_hint_ms": 5000,
"scenic_id": 128
},
"scenic": {
"id": 128,
"name": "本地模拟景区"
},
"scenic_spot": {
"id": 301,
"name": "模拟点位"
},
"task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"scenic_id": 128,
"status": 20,
"status_label": "执行中(模拟)",
"wayline_status": 20,
"wayline_status_label": "执行中(模拟)"
},
"ui": {
"commands": [
{
"command": "flighttask_pause",
"label": "紧急暂停",
"sub": "悬停待命"
},
{
"command": "return_home",
"label": "立即返航",
"sub": "中断任务"
}
],
"message": "本地模拟状态回查,未向设备发送指令。",
"phase": "shooting",
"title": "无人机正在拍摄中(模拟)"
}
},
"msg": "local mock success"
}
},
{
"method": "POST",
"path": "/api/app/airport/command",
"request_body": {
"id": 901,
"command": "return_home"
},
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"airport_sn": "LOCAL-MOCK-DOCK-201",
"command": "return_home",
"dji_status": "returning",
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task_id": 901
},
"msg": "local mock success"
}
},
{
"method": "GET",
"path": "/api/app/airport/shooting",
"query": "id=901&live_battery=1",
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"air_line": {
"id": 401,
"name": "模拟航线",
"scenic_spot_id": 301
},
"current_plane": {
"id": 201,
"online_status": 1,
"sn_number": "LOCAL-MOCK-PLANE-201",
"status_text": "本地模拟 · 返航中 · 电量95%",
"work_status": 2,
"work_status_label": "返航中"
},
"execute_gate": {
"can_execute": false,
"code": "return_home",
"message": "本地模拟:开拍已受理",
"primary_action": "returning",
"primary_action_label": "拍摄中"
},
"header": {
"order_number": "LOCAL-MOCK-ORDER-901",
"package_name": "模拟套餐 · 含5次拍摄",
"title": "模拟点位 · 模拟航线",
"tourist_label": "本地模拟,无设备指令"
},
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"result_code": "return_home",
"result_message": "本地模拟:立即返航中断任务;无人机返航中。",
"scenic_id": 128,
"status": 40,
"status_label": "任务已中断(模拟)",
"wayline_status": 40,
"wayline_status_label": "已中断(模拟)"
},
"order_number": "LOCAL-MOCK-ORDER-901",
"plane_status": {
"connected": true,
"poll_hint_ms": 5000,
"scenic_id": 128
},
"scenic": {
"id": 128,
"name": "本地模拟景区"
},
"scenic_spot": {
"id": 301,
"name": "模拟点位"
},
"task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"result_code": "return_home",
"result_message": "本地模拟:立即返航中断任务;无人机返航中。",
"scenic_id": 128,
"status": 40,
"status_label": "任务已中断(模拟)",
"wayline_status": 40,
"wayline_status_label": "已中断(模拟)"
},
"ui": {
"commands": [
{
"command": "return_home_cancel",
"label": "取消返航",
"sub": "不恢复已中断任务"
}
],
"message": "本地模拟:立即返航中断任务;无人机返航中",
"phase": "returning",
"title": "本地模拟:立即返航中断任务;无人机返航中"
}
},
"msg": "local mock success"
}
},
{
"method": "POST",
"path": "/api/app/airport/command",
"request_body": {
"command": "return_home_cancel",
"id": 901
},
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"airport_sn": "LOCAL-MOCK-DOCK-201",
"command": "return_home_cancel",
"dji_status": "failed",
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task_id": 901
},
"msg": "local mock success"
}
},
{
"method": "GET",
"path": "/api/app/airport/shooting",
"query": "id=901&live_battery=1",
"http_status": 200,
"response_body": {
"code": 100000,
"data": {
"air_line": {
"id": 401,
"name": "模拟航线",
"scenic_spot_id": 301
},
"current_plane": {
"id": 201,
"online_status": 1,
"sn_number": "LOCAL-MOCK-PLANE-201",
"status_text": "本地模拟 · 悬停中 · 电量95%",
"work_status": 2,
"work_status_label": "悬停中"
},
"execute_gate": {
"can_execute": false,
"code": "return_home",
"message": "本地模拟:开拍已受理",
"primary_action": "failed",
"primary_action_label": "拍摄中"
},
"header": {
"order_number": "LOCAL-MOCK-ORDER-901",
"package_name": "模拟套餐 · 含5次拍摄",
"title": "模拟点位 · 模拟航线",
"tourist_label": "本地模拟,无设备指令"
},
"metrics": [
{
"key": "battery",
"value": "95%"
},
{
"key": "env_temp",
"value": "20.3℃"
},
{
"key": "wind_speed",
"value": "0m/s"
},
{
"key": "rainfall",
"value": "无雨"
},
{
"key": "signal",
"value": "良好"
},
{
"key": "satellite",
"value": "36颗"
}
],
"order_flight_task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"result_code": "return_home",
"result_message": "本地模拟:返航已取消,任务仍已中断,不能继续拍摄。",
"scenic_id": 128,
"status": 40,
"status_label": "任务已中断(模拟)",
"wayline_status": 40,
"wayline_status_label": "已中断(模拟)"
},
"order_number": "LOCAL-MOCK-ORDER-901",
"plane_status": {
"connected": true,
"poll_hint_ms": 5000,
"scenic_id": 128
},
"scenic": {
"id": 128,
"name": "本地模拟景区"
},
"scenic_spot": {
"id": 301,
"name": "模拟点位"
},
"task": {
"id": 901,
"order_number": "LOCAL-MOCK-ORDER-901",
"result_code": "return_home",
"result_message": "本地模拟:返航已取消,任务仍已中断,不能继续拍摄。",
"scenic_id": 128,
"status": 40,
"status_label": "任务已中断(模拟)",
"wayline_status": 40,
"wayline_status_label": "已中断(模拟)"
},
"ui": {
"commands": [],
"message": "本地模拟:返航已取消,任务仍已中断",
"phase": "failed",
"title": "本地模拟:返航已取消,任务仍已中断"
}
},
"msg": "local mock success"
}
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

@@ -0,0 +1,244 @@
{
"command_scenario" : "timeout",
"description" : "纯内存模拟,未调用后端或设备",
"network_sent" : false,
"records" : [
{
"http_status" : 200,
"method" : "GET",
"path" : "/api/app/airport/shooting",
"query" : "id=901&live_battery=1",
"response_body" : {
"code" : 100000,
"data" : {
"air_line" : {
"id" : 401,
"name" : "模拟航线",
"scenic_spot_id" : 301
},
"current_plane" : {
"id" : 201,
"online_status" : 1,
"sn_number" : "LOCAL-MOCK-PLANE-201",
"status_text" : "本地模拟 · 拍摄中 · 电量95%",
"work_status" : 2,
"work_status_label" : "拍摄中"
},
"execute_gate" : {
"can_execute" : false,
"code" : "already_started",
"message" : "本地模拟:开拍已受理",
"primary_action" : "shooting",
"primary_action_label" : "拍摄中"
},
"header" : {
"order_number" : "LOCAL-MOCK-ORDER-901",
"package_name" : "模拟套餐 · 含5次拍摄",
"title" : "模拟点位 · 模拟航线",
"tourist_label" : "本地模拟,无设备指令"
},
"metrics" : [
{
"key" : "battery",
"value" : "95%"
},
{
"key" : "env_temp",
"value" : "20.3℃"
},
{
"key" : "wind_speed",
"value" : "0m/s"
},
{
"key" : "rainfall",
"value" : "无雨"
},
{
"key" : "signal",
"value" : "良好"
},
{
"key" : "satellite",
"value" : "36颗"
}
],
"order_flight_task" : {
"id" : 901,
"order_number" : "LOCAL-MOCK-ORDER-901",
"scenic_id" : 128,
"status" : 20,
"status_label" : "执行中(模拟)",
"wayline_status" : 20,
"wayline_status_label" : "执行中(模拟)"
},
"order_number" : "LOCAL-MOCK-ORDER-901",
"plane_status" : {
"connected" : true,
"poll_hint_ms" : 5000,
"scenic_id" : 128
},
"scenic" : {
"id" : 128,
"name" : "本地模拟景区"
},
"scenic_spot" : {
"id" : 301,
"name" : "模拟点位"
},
"task" : {
"id" : 901,
"order_number" : "LOCAL-MOCK-ORDER-901",
"scenic_id" : 128,
"status" : 20,
"status_label" : "执行中(模拟)",
"wayline_status" : 20,
"wayline_status_label" : "执行中(模拟)"
},
"ui" : {
"commands" : [
{
"command" : "flighttask_pause",
"label" : "紧急暂停",
"sub" : "悬停待命"
},
{
"command" : "return_home",
"label" : "立即返航",
"sub" : "中断任务"
}
],
"message" : "本地模拟状态回查,未向设备发送指令。",
"phase" : "shooting",
"title" : "无人机正在拍摄中(模拟)"
}
},
"msg" : "local mock success"
}
},
{
"error" : "未能完成操作。(NSURLErrorDomain错误-1001。)",
"method" : "POST",
"path" : "/api/app/airport/command",
"request_body" : {
"command" : "flighttask_pause",
"id" : 901
}
},
{
"http_status" : 200,
"method" : "GET",
"path" : "/api/app/airport/shooting",
"query" : "id=901&live_battery=1",
"response_body" : {
"code" : 100000,
"data" : {
"air_line" : {
"id" : 401,
"name" : "模拟航线",
"scenic_spot_id" : 301
},
"current_plane" : {
"id" : 201,
"online_status" : 1,
"sn_number" : "LOCAL-MOCK-PLANE-201",
"status_text" : "本地模拟 · 拍摄中 · 电量95%",
"work_status" : 2,
"work_status_label" : "拍摄中"
},
"execute_gate" : {
"can_execute" : false,
"code" : "already_started",
"message" : "本地模拟:开拍已受理",
"primary_action" : "shooting",
"primary_action_label" : "拍摄中"
},
"header" : {
"order_number" : "LOCAL-MOCK-ORDER-901",
"package_name" : "模拟套餐 · 含5次拍摄",
"title" : "模拟点位 · 模拟航线",
"tourist_label" : "本地模拟,无设备指令"
},
"metrics" : [
{
"key" : "battery",
"value" : "95%"
},
{
"key" : "env_temp",
"value" : "20.3℃"
},
{
"key" : "wind_speed",
"value" : "0m/s"
},
{
"key" : "rainfall",
"value" : "无雨"
},
{
"key" : "signal",
"value" : "良好"
},
{
"key" : "satellite",
"value" : "36颗"
}
],
"order_flight_task" : {
"id" : 901,
"order_number" : "LOCAL-MOCK-ORDER-901",
"scenic_id" : 128,
"status" : 20,
"status_label" : "执行中(模拟)",
"wayline_status" : 20,
"wayline_status_label" : "执行中(模拟)"
},
"order_number" : "LOCAL-MOCK-ORDER-901",
"plane_status" : {
"connected" : true,
"poll_hint_ms" : 5000,
"scenic_id" : 128
},
"scenic" : {
"id" : 128,
"name" : "本地模拟景区"
},
"scenic_spot" : {
"id" : 301,
"name" : "模拟点位"
},
"task" : {
"id" : 901,
"order_number" : "LOCAL-MOCK-ORDER-901",
"scenic_id" : 128,
"status" : 20,
"status_label" : "执行中(模拟)",
"wayline_status" : 20,
"wayline_status_label" : "执行中(模拟)"
},
"ui" : {
"commands" : [
{
"command" : "flighttask_pause",
"label" : "紧急暂停",
"sub" : "悬停待命"
},
{
"command" : "return_home",
"label" : "立即返航",
"sub" : "中断任务"
}
],
"message" : "本地模拟状态回查,未向设备发送指令。",
"phase" : "shooting",
"title" : "无人机正在拍摄中(模拟)"
}
},
"msg" : "local mock success"
}
}
],
"scenario" : "success",
"source" : "local_mock"
}
@@ -37,4 +37,4 @@ Debug 启动参数 `--dock-start-shoot-mock`,可加 `--dock-start-shoot-result
此入口使用独立客户端 `https://mock.invalid` 和纯内存传输;未知请求直接本地失败,不回退网络。`live_battery=1` 仅用于验证 Mock 的查询合同,不触发实时采集;真实 Debug 查询强制改为 0。合成订单、飞机 ID、任务 UUID 和机巢序列号均不可作为真实业务参数。
正式任务页未注入开拍服务,按钮仍禁用;统一网络层继续阻断真实 `tasks/create/shoot/start-shoot/command/live`。底部暂停和返航也未启用。后端目前没有约定不会下发设备指令的模拟协议,因此本次只验证客户端行为,不验证后端接收及实际执行。
正式任务页未注入开拍服务,按钮仍禁用;统一网络层继续阻断真实 `tasks/create/shoot/start-shoot/command/live`。2026-10-30 已为同一纯内存流程增加底部安全指令,见[安全控制模拟记录](../safety-command-mock-2026-10-30/README.md),真实暂停和返航仍未启用。后端目前没有约定不会下发设备指令的模拟协议,因此本次只验证客户端行为,不验证后端接收及实际执行。